[pve-devel] pve-manager : expose balloon to gui

Alexandre DERUMIER aderumier at odiso.com
Sun Dec 9 12:41:33 CET 2012


>>I also check the mom code, they use qemu-ga to retrieve guest memory infos 
>>(reading /proc/meminfo and /proc/vmstat with guest-agent) 

But they don't seem to check buffured memory, only free  mem

(def shrink_guest (guest)
{
    # Determine the degree of host memory pressure
    (if (<= host_free_percent pressure_critical)
        # Pressure is critical:
        #   Force guest to swap by making free memory negative
        (defvar guest_free_percent (+ -0.05 host_free_percent))
        # Normal pressure situation
        #   Scale the guest free memory back according to host pressure
        (defvar guest_free_percent (* min_guest_free_percent
                                    (/ host_free_percent pressure_threshold))))

    # Given current conditions, determine the ideal guest memory size
    (defvar guest_used_mem (- (guest.StatAvg "balloon_cur")
                              (guest.StatAvg "mem_unused")))
    (defvar balloon_min (+ guest_used_mem
                           (* guest_free_percent guest.balloon_cur)))
    # But do not change it too fast
    (defvar balloon_size (* guest.balloon_cur
                            (- 1 max_balloon_change_percent)))
    (if (< balloon_size balloon_min)
        (set balloon_size balloon_min)
        0)
    # Set the new target for the BalloonController.  Only set it if the
    # value makes sense and is a large enough change to be worth it.
    (if (and (<= balloon_size guest.balloon_cur)
            (change_big_enough guest balloon_size))
        (guest.Control "balloon_target" balloon_size)
        0)
})


----- Mail original ----- 

De: "Alexandre DERUMIER" <aderumier at odiso.com> 
À: "Dietmar Maurer" <dietmar at proxmox.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Dimanche 9 Décembre 2012 11:24:35 
Objet: Re: [pve-devel] pve-manager : expose balloon to gui 

I also check the mom code, they use qemu-ga to retrieve guest memory infos 
(reading /proc/meminfo and /proc/vmstat with guest-agent) 

----- Mail original ----- 

De: "Alexandre DERUMIER" <aderumier at odiso.com> 
À: "Dietmar Maurer" <dietmar at proxmox.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Dimanche 9 Décembre 2012 11:10:54 
Objet: Re: [pve-devel] pve-manager : expose balloon to gui 

>>Do you follow the discussion on the qemu-devel list? 
Yes. 

>> The virtio-balloon 
><driver only report free RAM, without information about buffers. 
Yes,I have see that. 

I need to do test, but if we use free ram counter, maybe buffer ram will be taked to go into free_ram if we reduce the memory with ballooning. 

ex: 

1)maxmem: 8GB - freeram:1G buffer:6G usedram:1G balloon driver:0G 

ballon to 7G 

2)maxmem:8GB - freeram:0G buffer:6G usedram:1G balloon driver:1G 
then wait a little, guest kernel should take some buffered memory to go in free_mem. 

2)maxmem:8GB - freeram:1G buffer:5G usedram:1G balloon driver:1G 

So maybe using free_mem counter is enough ? 
(We should of course check the swap to see if the kernel is not swapping to keep free mem) 


But yes, having buffer stats could help a lot. 



Note that citrix xenserver is using only the min_balloon size defined in vm config, it should be tunned to be enough big to not crash the guest if memory is reduced. 
(in worst case you should have enough swap in guest to handle the memory reduce) 


>>So maybe it is faster to work on the guest-agent infrastructure instead. I guess 
>>it is much easier to modify the user space tools than a kernel driver. 

Yes, I think we could implement qemu-ga for this. Easy for linux (get free command result), not sure for windows guest(lauching some scripts ?). 
I don't have too much time to work on qemu-ga (multiplexing give me headache ;). 
Can you work on this ? (my old patches works but need to be polished) 


>>Note: fixing the kernel driver is quite easy, but I doubt we can force all distrib. to 
>>apply/backport those patches. 
Yes, I don't think distro will backport,I'll just be include in new kernel version. So it can take time. 


>>They also talk about a kernel-based auto-ballooning feature! I requested more 
>>information about that. 
Never heart about this. But it can take time to be ready (years ?) 


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Samedi 8 Décembre 2012 13:16:23 
Objet: RE: [pve-devel] pve-manager : expose balloon to gui 

> Subject: Re: [pve-devel] pve-manager : expose balloon to gui 
> 
> 
> >>They lock quite simple, so we can add them if they work fine. 
> Ok, thanks. I'll begin to work on it next week ! 

Do you follow the discussion on the qemu-devel list? The virtio-balloon 
driver only report free RAM, without information about buffers. 
So maybe it is faster to work on the guest-agent infrastructure instead. I guess 
it is much easier to modify the user space tools than a kernel driver. 

Note: fixing the kernel driver is quite easy, but I doubt we can force all distrib. to 
apply/backport those patches. 

They also talk about a kernel-based auto-ballooning feature! I requested more 
information about that. 
_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



More information about the pve-devel mailing list