apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.05k stars 1.1k forks source link

Instances volumes stored on linstor are of format qcow2 instead of raw #9176

Open wornet-mwo opened 4 months ago

wornet-mwo commented 4 months ago
ISSUE TYPE
COMPONENT NAME
storage
database
linstor
CLOUDSTACK VERSION
4.19.0.1
CONFIGURATION

N/A

OS / ENVIRONMENT
SUMMARY

Volumes attached to instances created in a primary storage backed by linstor are set to format QCOW2. That leads to unmigratable Instances.

STEPS TO REPRODUCE
EXPECTED RESULTS
The correct format is used, when creating an instance.
ACTUAL RESULTS

The migration of an instance from a linstor to nfs storage failed. The failed command pointed me to the database. Migrating an instance to the linstor storage works great and does not cause the issue, only creating an instance is affected.

root@rz0-vh01:~# zgrep qemu-img /var/log/cloudstack/agent/agent.log.2024-06-04.gz
2024-06-04 10:04:56,779 WARN  [utils.script.Script] (agentRequest-Handler-4:null) (logid:0af75212) Execution of process [28987] for command [qemu-img convert -O qcow2 -U --image-opts driver=qcow2,file.filename=/dev/drbd1001 /mnt/f8a61f1d-8644-31f2-a519-83ac3f94c267/eaf6e6cb-50c9-4cb0-9368-e757fa488d79.qcow2 ] failed.
2024-06-04 10:04:56,779 WARN  [utils.script.Script] (agentRequest-Handler-4:null) (logid:0af75212) Process [28987] for command [qemu-img convert -O qcow2 -U --image-opts driver=qcow2,file.filename=/dev/drbd1001 /mnt/f8a61f1d-8644-31f2-a519-83ac3f94c267/eaf6e6cb-50c9-4cb0-9368-e757fa488d79.qcow2 ] encountered the error: [qemu-img: Could not open 'driver=qcow2,file.filename=/dev/drbd1001': Image is not in qcow2 format].
2024-06-04 10:04:56,780 ERROR [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:0af75212) Failed to convert /dev/drbd1001 to /mnt/f8a61f1d-8644-31f2-a519-83ac3f94c267/eaf6e6cb-50c9-4cb0-9368-e757fa488d79.qcow2 the error was: qemu-img: Could not open 'driver=qcow2,file.filename=/dev/drbd1001': Image is not in qcow2 format
DaanHoogland commented 4 months ago

@rp- , can you triage this, please?

rp- commented 4 months ago

I noticed this mistake too, I think 2 months ago. It was sadly hidden, because the format is nowhere displayed in CloudStack, just in the database. I tried to just update the database tables and correctly set it on volume creation, but this sadly created some problems with snapshots and templates AFAIR. So I thought I would leave it like it is, as I wasn't aware of any problems from it. Until now...