Skip to content

validate qcow2 for a backing file during vm import #11260

@kiranchavala

Description

@kiranchavala

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)

https://prnt.sc/odMIHijU1pJ3

  1. Register Template (Normal and Direct Download)

https://cloudstack.apache.org/api/apidocs-4.20/apis/registerTemplate.html

  1. Upload Volume

https://cloudstack.apache.org/api/apidocs-4.20/apis/uploadVolume.html

  1. 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

  1. 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

  1. As a Admin user Navigate to Tools> Import-Export Instances > Kvm

  2. Import Qcow2 image from Local Storage

https://prnt.sc/NPU9hV6s6v_k

  1. Import Qcow2 image from Shared Storage

https://prnt.sc/uRmuv2j49KZW

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions