1 Commits

Author SHA1 Message Date
zhu.boxiang
6c6ffc0476 Fix failure to boot instances with qcow2 format images
Ceph doesn't support QCOW2 for hosting a virtual machine
disk:

  http://docs.ceph.com/docs/master/rbd/rbd-openstack/

When we set image_type as rbd and force_raw_images as
False and we don't launch an instance with boot-from-volume,
the instance is spawned using qcow2 as root disk but
fails to boot because data is accessed as raw.

To fix this, we raise an error and refuse to start
nova-compute service when force_raw_images and
image_type are incompatible.
When we import image into rbd, check the format of cache
images. If the format is not raw, remove it first and
fetch it again. It will be raw format now.

Change-Id: I1aa471e8df69fbb6f5d9aeb35651bd32c7123d78
Closes-Bug: 1816686
2019-05-20 19:10:31 +08:00