[pve-devel] batch migrate : add a optionnal flag to check available memory on target node ?

Alexandre DERUMIER aderumier at odiso.com
Thu Jan 18 08:58:57 CET 2018


>>Since this involves functionality used in HA as well, I wonder if we 
>>could find a way to share code there. HA currently doesn't look at 
>>memory that way, but it could be extended to be able to do that. 

yes sure !

>>However, I wouldn't go with memory usage but total available vs 
>>how much was assigned to the VMs already on the target vs the RAM 
>>assigned to the current VM. 
>>Otherwise you may end up migrating a VM to a host which starts out with 
>>lots of free RAM while at the same time some other VM which was already 
>>on the target host but hasn't done anything in a long while suddenly 
>>wakes and pulls gigabytes of data out of swap into active RAM. 

>From my experience (but maybe it's specific to my workloads), if process in vms need
more memory, they will use memory used in the vm buffer cache. (Generally, vm os try 
to use as much memory as possible).
So from the host view, this don't change nothing too much.

>>Or just now starts using up RAM for the first time. 
yes, indeed.

>>It also seems simpler as we can literally just sum up the memory 
>>settings of VMs. 

We also need to take care of ksm, and memory balloning. not sure how to handle them.


>>That way you could also figure out the distribution beforehand. Iow. 
>>instead of saying "migrate as many VMs as possible from host A to host 
>>B and error out when it's "full"" you can say "distribute VMs of host A 
>>to the other hosts" (optionally masking out hosts). 

yes, this was my plan for V2 ;)  But I think this need some kind of global scheduler
(could be also done for cpu). If you do try to dispatch vm from hostA to others host,
and at same time dispatch vm from hostB to others host, I'll be very difficult
without a central coordination.

Currently, I just want to add some simple protection to avoid reach 100% memory when doing a live migration.

>>The mechanics are similar to what HA does when a host dies, the only 
>>difference is that VMs get live-migrated, so a common code base for the 
>>distribution mechanics would be nice. 
>>I think Thomas might know how feasible such an approach would be? 

I think we have talked about workload balancing scheduler in the past, this could be a great feature from proxmox :)





More information about the pve-devel mailing list