block/live migration doesn't work with LVM as libvirt storage

Bug #1282643 reported by mouadino
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dan Genin

Bug Description

## What we did:

We were trying to use block migration in a setup that use LVM as libvirt storage:

nova live-migrate --block-migrate <uuid> <host-name>

## Current Result:

Nothing happens, no migration, but in libvirtd.log of the destination hypervisor we saw:

   error : virNetClientProgramDispatchError:175 : Failed to open file '/dev/instances/instance-0000015f_disk': No such file or directory

the /dev/instances/instance-0000015f_disk is the root disk of our instance.

## What we found:

After a bit of wondering in the code of nova, we saw that nova in the destination host actually fails to create the instance resources. This should have been done as part of pre_live_migration RPC call, but this one doesn't receive any disks in the disk_info argument (https://github.com/openstack/nova/blob/stable/havana/nova/virt/libvirt/driver.py#L4132) except the config disk. We found that this due to the fact that LVM disks (e.g. root disk) are skipped by driver.get_instance_disk_info method, specially by this line https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L4585-L4587, which skip any disk that is not a file thinking that it must be a block storage which not true because LVM disk are created as a block type (https://github.com/openstack/nova/blob/stable/havana/nova/virt/libvirt/imagebackend.py#L358), snippets for the libvirt.xml below:

 <devices>
    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="none"/>
      <source dev="/dev/instances/instance-00000163_disk"/>
      <target bus="virtio" dev="vda"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw" cache="none"/>
      <source file="/var/lib/nova/instances/6ed79840-c850-498f-9607-ffa92e7cf944/disk.config"/>
      <target bus="ide" dev="hdd"/>
    </disk>
    <interface type="bridge">
      <mac address="fa:16:3e:f0:61:24"/>
      <model type="virtio"/>
      <source bridge="brqe914da2f-c4"/>
      <target dev="tap258425f6-9b"/>
    </interface>
    <serial type="file">
      <source path="/var/lib/nova/instances/6ed79840-c850-498f-9607-ffa92e7cf944/console.log"/>
    </serial>
    <serial type="pty"/>
    <input type="tablet" bus="usb"/>
    <graphics type="vnc" autoport="yes" keymap="en-us" listen="0.0.0.0"/>
  </devices>

mouadino (mouadino)
description: updated
description: updated
description: updated
Changed in nova:
assignee: nobody → Vladik Romanovsky (vladik-romanovsky)
Revision history for this message
Michael Still (mikal) wrote :

I'm not sure that the underlying libvirt knows how to migration lvm disks either though, so even if we got this working in get_instance_disk_info I think you might be out of luck.

tags: added: compute live-migration
tags: added: libvirt
Revision history for this message
Solly Ross (sross-7) wrote :

Perhaps we should do something similar to https://review.openstack.org/#/c/73387/4?

Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → High
Revision history for this message
mouadino (mouadino) wrote :

Fix proposed under https://review.openstack.org/#/c/80029/

(Sorry but Gerrit didn't do it automatically)

Changed in nova:
assignee: Vladik Romanovsky (vladik-romanovsky) → mouadino (mouadino)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

What version of libvirt/qemu is being tested?

Revision history for this message
Dan Genin (daniel-genin) wrote :

This is a duplicate of https://bugs.launchpad.net/nova/+bug/1270305. As Michael mentioned libvirt driver does not have code for migrating LVM volumes. If you would like to implement this unquestionably useful and important feature you will need to submit a blueprint to nova-spec, since it is going to involve substantial modification of libvirt migration code. In the mean time, I have submitted a "fix" that raises a not implemented exception https://review.openstack.org/#/c/73387/.

Dan Genin (daniel-genin)
Changed in nova:
assignee: mouadino (mouadino) → Dan Genin (daniel-genin)
Revision history for this message
Dan Genin (daniel-genin) wrote :
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.