image format change during migration breaks instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Pavlo Shchelokovskyy |
Bug Description
Discovered in a environment that was configured with
[libvirt]
images_type = raw
only, the other relevant options were at their defaults (use_cow_images = True, force_raw_images = True).
Symptom - the instances were non-responsive and non running after cold migration (e.g. no console log at all), live migration works fine.
Workaround - setting use_cow_
Reproduction on a current multinode devstack:
1. Configure computes as described above - set [libvirt]
2. Create a raw image in Glance.
3. Boot an instance from that raw image.
4. Inspect the image on the file system - the image is in fact raw.
5. Cold-migrate the server.
6. Migration finishes successfully, instance is reported as up and running on the new host - but in fact it has completely failed to start (not accessible, no console log, nothing).
7. If you check the image file nova uses on the new compute - it is now qcow2, not raw.
8. But the libvirt XML of the instance still defines the disk as raw!
Oct 09 12:15:35 pshchelo-
Oct 09 12:15:35 pshchelo-
Oct 09 12:15:35 pshchelo-
Oct 09 12:15:35 pshchelo-
Oct 09 12:15:35 pshchelo-
Oct 09 12:15:35 pshchelo-
Stopping the instance and manually converting the disk back to raw allows instance to start properly.
I tracked it down to this place in finish_migration method:
https:/
if (disk_name != 'disk.config' and
Effectively, nova changes disk type but not changing the XML appropriately to reflect the actual new disk format, and thus the instance fails to start.
description: | updated |
description: | updated |
Changed in nova: | |
assignee: | nobody → Pavlo Shchelokovskyy (pshchelo) |
what's more, disk.info is also not updated:
❯ qemu-img info disk | head -n2
image: disk
file format: qcow2
❯ qemu-img info disk.eph0 | head -n2
image: disk.eph0
file format: qcow2
❯ qemu-img info disk.swap | head -n2
image: disk.swap
file format: qcow2
❯ cat disk.info stack/data/ nova/instances/ be952acc- 2774-48ca- ad87-bd2fa77342 3a/disk" : "raw", "/opt/stack/ data/nova/ instances/ be952acc- 2774-48ca- ad87-bd2fa77342 3a/disk. eph0": "raw", "/opt/stack/ data/nova/ instances/ be952acc- 2774-48ca- ad87-bd2fa77342 3a/disk. swap": "raw", "/opt/stack/ data/nova/ instances/ be952acc- 2774-48ca- ad87-bd2fa77342 3a/disk. config" : "raw"}
{"/opt/