-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
problem
Validate Qcow2 for a backing file during vm import
Currently, CloudStack checks if a QCOW2 file has a backing file during the following operations and throws the following exception (Volume with backing file cannot be imported or unmanaged)
- Register Template (Normal and Direct Download)
https://cloudstack.apache.org/api/apidocs-4.20/apis/registerTemplate.html
- Upload Volume
https://cloudstack.apache.org/api/apidocs-4.20/apis/uploadVolume.html
- Import Volume
https://cloudstack.apache.org/api/apidocs-4.20/apis/importVolume.html
The agent for the kvm host checks for backing for not and throws the exception
2025-07-18 05:35:53,182 DEBUG [utils.script.Script] (AgentRequest-Handler-3:[]) (logid:) Executing command [qemu-img info -U /var/lib/libvirt/images/test-backing-file-sdb.qcow2 ].
2025-07-18 05:35:53,190 DEBUG [utils.script.Script] (AgentRequest-Handler-3:[]) (logid:) Successfully executed process [28240] for command [qemu-img info -U /var/lib/libvirt/images/test-backing-file-sdb.qcow2 ].
versions
ACS 4.20.1 , ACS 4.19.x
The steps to reproduce the bug
- Create a backing file using qcow2 on a local storage or a shared storage
qemu-img create -f qcow2 -b /dev/sdb -F raw test-backing-file-sdb.qcow2 5G
-
As a Admin user Navigate to Tools> Import-Export Instances > Kvm
-
Import Qcow2 image from Local Storage
- Import Qcow2 image from Shared Storage
- The qcow2 file is imported successfully
What to do about it?
Expected behaviour
Ideally, CloudStack should check if the volume has a backing file and throw the same exception during import vm
https://cloudstack.apache.org/api/apidocs-4.20/apis/importVm.html