When creating a volume from an image, and even if cinder converts it from qcow2 to raw, the volume metadata still shows it as a qcow2 volume: mysql> select * from volume_admin_metadata where volume_id='cb45a18f-3577-4908-9a38-1eba2e5fa954'; +---------------------+------------+------------+---------+----+--------------------------------------+--------+-------+ | created_at | updated_at | deleted_at | deleted | id | volume_id | key | value | +---------------------+------------+------------+---------+----+--------------------------------------+--------+-------+ | 2023-06-27 14:18:59 | NULL | NULL | 0 | 12 | cb45a18f-3577-4908-9a38-1eba2e5fa954 | format | qcow2 | +---------------------+------------+------------+---------+----+--------------------------------------+--------+-------+ 1 row in set (0.01 sec) When lauching an instance from this volume, and as a result of the above, the attachment and connection info to this volume reflects a qcow2 volume. tack@ubuntu2204-devstack:~/cinder/cinder/volume/drivers$ openstack volume attachment --os-volume-api-version 3.27 show cb7d407e-8f05-427d-81c2-3fe700843c4f +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ID | cb7d407e-8f05-427d-81c2-3fe700843c4f | | Volume ID | cb45a18f-3577-4908-9a38-1eba2e5fa954 | | Instance ID | 76dfd939-85d4-491c-803e-1566e226552d | | Status | attached | | Attach Mode | rw | | Attached At | 2023-06-27T14:19:33.000000 | | Detached At | | | Properties | access_mode='rw', attachment_id='cb7d407e-8f05-427d-81c2-3fe700843c4f', cacheable='False', driver_volume_type='nfs', encrypted='False', export='10.225.104.121:/openstack-nfs1', format='qcow2', mount_point_base='/opt/stack/data/cinder/mnt', name='volume-cb45a18f-3577-4908-9a38-1eba2e5fa954', options=, qos_specs= | +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ As a result, a resize operation will end up in error libvirt.libvirtError: internal error: process exited while connecting to monitor: 2023-06-27T14:26:32.925733Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}: Image is not in qcow2 format The proposed change is to add a validation step which aligns the format if the current format is different that the block disk format. diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py index 11a2fb97d..329a3f49e 100644 --- a/cinder/volume/drivers/remotefs.py +++ b/cinder/volume/drivers/remotefs.py @@ -548,6 +548,12 @@ class RemoteFSDriver(driver.BaseVD): data = image_utils.qemu_img_info(self.local_path(volume), run_as_root=self._execute_as_root) virt_size = data.virtual_size // units.Gi + disk_fmt = data.file_format + curr_disk_fmt = volume.admin_metadata['format'] + # NOTE (happystacker): updating metadata when current format does + # not match the metadata format + if curr_disk_fmt != disk_fmt: + volume.admin_metadata['format'] = disk_fmt if virt_size != volume.size: raise exception.ImageUnacceptable( image_id=image_id, Now when creating a volume from an image, the metadata reflects the appropriate format mysql> select * from volume_admin_metadata where volume_id='e3dfd77c-c47c-4787-a518-3ee869f54fda'; +---------------------+---------------------+------------+---------+----+--------------------------------------+--------+-------+ | created_at | updated_at | deleted_at | deleted | id | volume_id | key | value | +---------------------+---------------------+------------+---------+----+--------------------------------------+--------+-------+ | 2023-06-27 14:31:05 | 2023-06-27 14:31:10 | NULL | 0 | 13 | e3dfd77c-c47c-4787-a518-3ee869f54fda | format | raw | +---------------------+---------------------+------------+---------+----+--------------------------------------+--------+-------+ 1 row in set (0.00 sec) The volume attachment and associated connection information looks better and matches the format stack@ubuntu2204-devstack:~/cinder/cinder/volume/drivers$ openstack volume attachment --os-volume-api-version 3.27 show d8026770-753a-4e80-8774-f377f8a519eb +-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ID | d8026770-753a-4e80-8774-f377f8a519eb | | Volume ID | e3dfd77c-c47c-4787-a518-3ee869f54fda | | Instance ID | b204c38f-85ed-48c9-a705-1feba9b9af1b | | Status | attached | | Attach Mode | rw | | Attached At | 2023-06-27T14:33:21.000000 | | Detached At | | | Properties | access_mode='rw', attachment_id='d8026770-753a-4e80-8774-f377f8a519eb', cacheable='False', driver_volume_type='nfs', encrypted='False', export='10.225.104.121:/openstack-nfs1', format='raw', mount_point_base='/opt/stack/data/cinder/mnt', name='volume-e3dfd77c-c47c-4787-a518-3ee869f54fda', options=, qos_specs= | +-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ And the resize operation completes with success.