cloudstack/plugins
Wei Zhou db1e0f49dc
kvm: set Backing Format of qcow2 images in vm start and migration (#4656)
In previous cloudstack versions, qcow2 image does not have a backing file format.
however, it is required in newer qemu versions, for example qemu 4.2 on ubuntu 20.04.

steps to reproduce the issue
(1) install cloudstack 4.14 or previous version, and ubuntu 19.04 or 18.04/16.04 LTS.
(2) create vms.
(3) upgrade to 4.15, upgrade os to ubuntu 20.04 , or install a new server with ubuntu 20.04.
(4) migrate vm from old ubuntu version to ubuntu 20.04, failed with exception below
```
2021-02-04 13:43:07,397 DEBUG [resource.wrapper.LibvirtMigrateCommandWrapper] (agentRequest-Handler-1:null) (logid:93da9385) ExecutionException : org.libvirt.LibvirtException: Requested operation is not valid: format of backing image '/mnt/03b6f487-9eaf-38bf-ad2d-d985423b832f/66990fcc-fd98-4932-9649-989bf6583d59' of image '/mnt/03b6f487-9eaf-38bf-ad2d-d985423b832f/a3dd1f0f-2557-4e07-951c-e4eb7b3f38b2' was not specified in the image metadata (See https://libvirt.org/kbase/backing_chains.html for troubleshooting)
```
(5)stop vm, and start it on ubuntu 20.04 server. failed with exception below
```
2021-02-04 13:46:29,766 WARN  [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-5:null) (logid:b54745a7) LibvirtException
org.libvirt.LibvirtException: Requested operation is not valid: format of backing image '/mnt/03b6f487-9eaf-38bf-ad2d-d985423b832f/66990fcc-fd98-4932-9649-989bf6583d59' of image '/mnt/03b6f487-9eaf-38bf-ad2d-d985423b832f/a3dd1f0f-2557-4e07-951c-e4eb7b3f38b2' was not specified in the image metadata (See https://libvirt.org/kbase/backing_chains.html for troubleshooting)
```

To make testing easier, step 1 and 2 can be replaced by
```
qemu-img create -f qcow2 -b <backing file> <qcow2 image>
```
so qcow2 image does not have a backing file format.
2021-02-19 14:06:47 +05:30
..
acl Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
affinity-group-processors Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
alert-handlers Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
api API discovery: Prevent overwrite of API parameters in case the API names are the same (#4609) 2021-02-18 14:37:20 +05:30
backup Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
ca/root-ca Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
database Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
dedicated-resources Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
deployment-planners Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
event-bus Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
ha-planners/skip-heurestics Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
host-allocators/random Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
hypervisors kvm: set Backing Format of qcow2 images in vm start and migration (#4656) 2021-02-19 14:06:47 +05:30
integrations Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
metrics Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
network-elements Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
outofbandmanagement-drivers Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
storage Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
storage-allocators/random Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
user-authenticators Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30
pom.xml Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT 2021-01-11 13:58:30 +05:30