Live migration: "Disk of instance is too large" when using a volume stored on NFS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Cyril Roelandt | ||
Icehouse |
Fix Released
|
Undecided
|
Unassigned | ||
Juno |
Fix Released
|
Undecided
|
John Griffith |
Bug Description
When live-migrating an instance that has a Cinder volume (stored on NFS) attached, the operation fails if the volume size is bigger than the space left on the destination node. This should not happen, since this volume does not have to be migrated. Here is how to reproduce the bug on a cluster with one control node and two compute nodes, using the NFS backend of Cinder.
$ nova boot --flavor m1.tiny --image 173241e-
...
$ nova volume-create --display-name test_volume 100
...
| id | 6b9e1d03-
...
$ nova volume-attach test_vm 6b9e1d03-
...
$ nova show test_vm | grep OS-EXT-
| OS-EXT-
$ nova service-list | grep nova-compute
| nova-compute | t1-cpunode0 | nova | enabled | up | 2014-08-
| nova-compute | t1-cpunode1 | nova | enabled | up | 2014-08-
Now, let's say I want to live-migrate test_vm to t1-cpunode1:
$ nova live-migration --block-migrate test_vm t1-cpunode1
ERROR: Migration pre-check error: Unable to migrate a0d9c991-
In nova/virt/
...
if disk_type != 'file':
if target in volume_devices:
...
But for some reason, we never get into these conditions.
If we ssh the compute where the instance currently lies, we can get more information about it:
$ virsh dumpxml 11
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/
<target dev='vdb' bus='virtio'/>
<
<alias name='virtio-
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
...
The disk type is "file", which might explain why this volume is not skipped in the code snippet shown above. When we use the default Cinder backend, we get something such as:
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source dev='/dev/
<target dev='vdb' bus='virtio'/>
<
<alias name='virtio-
<address type='pci' domain='0x0000' bus='0x00' slot='0x07'
function='0x0'/>
</disk>
I think that the code in LibvirtNFSVolum
Any thoughts ?
tags: | added: libvirt |
Changed in nova: | |
assignee: | nobody → Vladik Romanovsky (vladik-romanovsky) |
tags: | added: juno-backport-potential |
Changed in nova: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | kilo-1 → 2015.1.0 |
Also, I think it's worth noticing that_assert_ dest_node_ has_enough_ disk() calls self.get_ instance_ disk_info( instance[ 'name'] ), which means that get_instance_ disk_info( ) has a block_device_info parameter equal to None, and _get_instance_ disk_info( ) as well. In the end, block_device_ info_get_ mapping( ) returns an empty list, and volume_devices is an empty set, which explains why we never get in the following condition:
if target in volume_devices:
LOG.debug( 'skipping disk %(path)s (%(target)s) as it is a '
'volume' , {'path': path, 'target': target})
continue
So, we either have a problem with the libvirt configuration written by Nova for NFS volumes, or with volume devices not being properly detected when calling _assert_ dest_node_ has_enough_ disk().