libvirt KVM migration – error: unsupported configuration: Target domain max memory does not match source
I recently ran in to trouble trying to migrate a KVM libvirt virtual machine (AKA domain):
[user@hypervisor01 ~]# time virsh migrate --live webserver01 qemu+ssh://hypervisor03.mydomain.com/system --copy-storage-all --persistent --undefinesource --verbose --abort-on-error --xml virtmigrate/webserver01.xml
error: unsupported configuration: Target domain max memory 8388608 does not match source 9437184
[user@hypervisor01 ~]# tail /var/log/libvirt/libvirtd.log
2015-08-13 07:44:07.781+0000: 4418: error : virDomainDefCheckABIStability:11730 : unsupported configuration: Target domain max memory 8388608 does not match source 9437184
These hypervisors were not using shared storage, so I had previously created updated copies of the configs (in this case, virtmigrate/webserver01.xml) that contained the correct path to their new storage location (source dev). The error I was receiving was due to the memory assigned to webserver01 being changed since I created the updated configs.
The migration config (virtmigrate/webserver01.xml) contained the older, smaller memory parameters:
While the current/running config contained the larger:
I updated the migration config virtmigrate/webserver01.xml and it is now working fine.
Here are some additional commands that may be useful in a similar situation.
virsh dominfo (domain): Returns basic information about the domain, including max and used memory
[user@hypervisor01 ~]# virsh dominfo webserver01
OS Type: hvm
CPU time: 1578499.8s
Max memory: 9437184 KiB
Used memory: 9437184 KiB
virsh edit domain: Edit the XML configuration file for a domain, which will affect the next boot of the guest.
This is equivalent to:
virsh dumpxml --inactive --security-info domain > domain.xml
vi domain.xml (make changes)
virsh define domain.xml
except that it does some error checking.
virsh setmaxmem (domain) 16G --config: Set the max memory for a domain, will take effect at next boot of guest