You can clone with
If vm (pv) migrated on localhost, every migration raise maxmem_kb limit for domain.
Steps to reproduce:
create and start vm (f.e. test).
get an maxmem_kb value for domain from xc.domain_getinfo()
for a in `seq 1 1000`;do xe vm-migration vm=test host=`hostname`;done
recheck maxmem_kb from xc.domain_getinfo()
Expected: same value
Actual: very large value, raising up after every new migration.
I believe that this is a known issue, though it was only recently discovered by the @jeromemaloberti on the Xapi team. He's on holiday now, but I'll assign this issue to him so that he can confirm whether this is the same issue he found.
It is the same the same issue. Some additional memory is allocated for the migration, but it is never reclaimed. The solution is not known for now.
The memory is requested by xapi through squeezed, but then transfered to xen.
Well, if you have an idea how to fix it, I will be very happy to test it when I return from holiday :).
However, I don't know what xen is actually doing with the additional memory. If it is just used during the migration, that's fine, but if xen keeps using it after, it will be a problem. Any suggestion ?
The root of the problem here appears to be confusion over Xen's memory handling.
A VM is made up of static-max pages and delta, where delta is the extra overhead for Xen.
This delta is dependent on the version of Xen, the hardware available, command line options at boot, VM configuration, runtime tweaks to the VM and even down to the VM physmap fragmentation.
The delta for the VM on its source host bares no specific relation to the delta for the same VM on the destination host (although in general it should approximate to linear function of static-max).
The reason VMs get bigger across migrate is that the xenops finds VM(static-max + delta) on the source and creates a new domain on the destination of the same size. This is completely wrong, and defeats the purpose it seems to have been implemented for. When the new domain is static-max + old delta, Xen must find a new slightly larger delta from elsewhere in memory.
The target domain must be created as static-max, to be the same as source domain. Xen will find its delta from other free memory.
If the toolstack wishes to approximate this delta, it should look at the ratio for HVM domains on the target host as a better guess, but there is no way to reserve this memory for Xen; Attempting to do so by making a bigger domain is actively counter-productive.
Potential fix: #1486