OpenNebula / one

The open source Cloud & Edge Computing Platform bringing real freedom to your Enterprise Cloud 🚀
http://opennebula.io
Apache License 2.0
1.19k stars 473 forks source link

Add qcow2 format support for volatile disk type "swap" #6622

Open OpenNebulaSupport opened 1 week ago

OpenNebulaSupport commented 1 week ago

Description The only supported format for the volatile disk type swap now is raw. There is a request from our customers and users to add qcow2 format too. Having only raw format for the volatile disk type swap leads to the error during VM snapshotting:

Thu Jun 20 09:20:17 2024 [Z0][VM][I]: New LCM state is RUNNING
Thu Jun 20 09:20:35 2024 [Z0][VM][I]: New LCM state is HOTPLUG_SNAPSHOT
Thu Jun 20 09:20:35 2024 [Z0][VMM][I]: Command execution failed (exit code: 255): 'if [ -x "/var/tmp/one/vmm/kvm/snapshot_create" ]; then /var/tmp/one/vmm/kvm/snapshot_create 3e2a214f-7f71-47b5-8464-7787130c3340 1 6 ubuntu2204-kvm-nfs-6-8-m9jmf-2.test; else                              exit 42; fi'
Thu Jun 20 09:20:35 2024 [Z0][VMM][I]: error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw
Thu Jun 20 09:20:35 2024 [Z0][VMM][I]: Could not create snapshot  for domain 3e2a214f-7f71-47b5-8464-7787130c3340.
Thu Jun 20 09:20:35 2024 [Z0][VMM][E]: SNAPSHOTCREATE: error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw Could not create snapshot  for domain 3e2a214f-7f71-47b5-8464-7787130c3340.
Thu Jun 20 09:20:35 2024 [Z0][VM][I]: New LCM state is RUNNING

Use case Having qcow2 format for the volatile disk type swap would allow users to choose more appropriate format for their circumstances.

Interface Changes One needs to keep "Format" drop-down menu with raw and qcow2 options when the user selects Swap as "Disk type" (i.e. the same as for FS disk type but without "Filesystem" menu).

Progress Status

rsmontero commented 1 week ago

Probably change default here:

https://github.com/OpenNebula/one/blob/master/src/mad/sh/scripts_common.sh#L480

also we may change this: https://github.com/OpenNebula/one/blob/master/src/mad/sh/scripts_common.sh#L475 and create the volume in the final format qcow2/raw