NFS driverS don't honor size parameter while creating a volume from an image

Bug #1183459 reported by Sébastien Han on 2013-05-23
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Sébastien Han

Bug Description

The bug has been encountered with the NFS generic driver (cinder.volume.nfs.NfsDriver) and the NetApp NFS driver (cinder.volume.drivers.netapp.nfs.NetAppDirectCmodeNfsDriver). I believe that drivers based on distributed filesystem such as GlusterFS, nexenta and scality are also impacted however I didn't test it those backends. However since most of them already inherit from the RemoteFsDriver class, this should be fine.

Step to reproduce (the first file is the image file fetched from glance by cinder):

vagrant@ceph-client:~/test$ ls
tmpox4Fof

vagrant@ceph-client:~/test$ qemu-img info tmpox4Fof
image: tmpox4Fof
file format: qcow2
virtual size: 2.0G (2147483648 bytes)
disk size: 240M
cluster_size: 65536

vagrant@ceph-client:~/test$ truncate -s 5G file

vagrant@ceph-client:~/test$ ls -lah
total 241M
drwxrwxr-x 2 vagrant vagrant 4.0K May 21 09:26 .
drwxr-xr-x 9 vagrant vagrant 4.0K May 21 09:23 ..
-rw-rw-r-- 1 vagrant vagrant 5.0G May 21 09:26 file
-rw------- 1 vagrant vagrant 241M May 21 09:24 tmpox4Fof

vagrant@ceph-client:~/test$ qemu-img convert -O raw tmpox4Fof file

vagrant@ceph-client:~/test$ ls -lah
total 1021M
drwxrwxr-x 2 vagrant vagrant 4.0K May 21 09:26 .
drwxr-xr-x 9 vagrant vagrant 4.0K May 21 09:23 ..
-rw-rw-r-- 1 vagrant vagrant 2.0G May 21 09:26 file
-rw------- 1 vagrant vagrant 241M May 21 09:24 tmpox4Fof

vagrant@ceph-client:~/test$ qemu-img info file
image: file
file format: raw
virtual size: 2.0G (2147483648 bytes)
disk size: 780M

The main problem is that the rootfs size of the VM will be equal to the virtual size of the image

This is expected behavior I assume, the easiest way to fix it is to "qemu-img resize" and set the virtual size according to the size that the client asked for in the first place.

Fix proposed to branch: master
Review: https://review.openstack.org/30298

Changed in cinder:
assignee: nobody → Sébastien Han (sebastien-han)
status: New → In Progress

Reviewed: https://review.openstack.org/30298
Committed: http://github.com/openstack/cinder/commit/824a3b45218d2d548486eec6dac84bea148f4de5
Submitter: Jenkins
Branch: master

commit 824a3b45218d2d548486eec6dac84bea148f4de5
Author: leseb <email address hidden>
Date: Thu May 23 19:09:06 2013 +0200

    NFS drivers don't honor vm size with volume from an image

    The bug has been encountered with the NFS generic driver
    (cinder.volume.nfs.NfsDriver) and the NetApp NFS driver
    (cinder.volume.drivers.netapp.nfs.NetAppDirectCmodeNfsDriver). I believe
    that drivers based on distributed filesystem such as GlusterFS, nexenta
    and scality are also impacted however I didn't test it those backends.
    However since most of them already inherit from the RemoteFsDriver
    class, this should be fine.

    Change-Id: I14575da69a2c99c7cbcece27b40a171153371ee3
    Fixes: bug #1183459

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-07-17
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers