mallu mallu
2014-Jan-30 17:11 UTC
[libvirt-users] Dynamically setting permanent memory libvirt-lxc
I'm trying to permanently change memory allocation for a libvirt-lxc domain. So far I tried changing memory in memory.limit_in_bytes under /cgroup/memory/libvirt/lxc/<container>/. This didn't help. It appears that libvirt is not reading changes in cgroup. My requirements are 1) Be able to dynamically change memory of a LXC domain without reboot 2) The memory change must survive LXC domain reboot. Any help would be greatly appreciated
Eric Blake
2014-Jan-30 19:36 UTC
Re: [libvirt-users] Dynamically setting permanent memory libvirt-lxc
On 01/30/2014 10:11 AM, mallu mallu wrote:> I'm trying to permanently change memory allocation for a libvirt-lxc domain. So far I tried changing memory in memory.limit_in_bytes under /cgroup/memory/libvirt/lxc/<container>/. This didn't help. It appears that libvirt is not reading changes in cgroup. > > My requirements are > > 1) Be able to dynamically change memory of a LXC domain without reboot > 2) The memory change must survive LXC domain reboot.virsh memtune, virsh setmaxmem, and virsh setmem are the appropriate tools to use. Changing things directly in cgroups goes behind libvirt's back, while changing it through the libvirt API allows you to hot-plug the changes as well as control whether the next boot will have the same new limits. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
mallu mallu
2014-Jan-30 20:26 UTC
Re: [libvirt-users] Dynamically setting permanent memory libvirt-lxc
Eric, thank you for your response. Virsh memtune, setmaxmem and setmem won't survive a reboot. I'm hoping to find a solution that can survive reboot. On Thursday, January 30, 2014 11:36 AM, Eric Blake <eblake@redhat.com> wrote: On 01/30/2014 10:11 AM, mallu mallu wrote:> I'm trying to permanently change memory allocation for a libvirt-lxc domain. So far I tried changing memory in memory.limit_in_bytes under /cgroup/memory/libvirt/lxc/<container>/. This didn't help. It appears that libvirt is not reading changes in cgroup. > > My requirements are > > 1) Be able to dynamically change memory of a LXC domain without reboot > 2) The memory change must survive LXC domain reboot.virsh memtune, virsh setmaxmem, and virsh setmem are the appropriate tools to use. Changing things directly in cgroups goes behind libvirt's back, while changing it through the libvirt API allows you to hot-plug the changes as well as control whether the next boot will have the same new limits. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Seemingly Similar Threads
- Re: Dynamically setting permanent memory libvirt-lxc
- Re: Dynamically setting permanent memory libvirt-lxc
- cgroups inside LXC containers losts memory limits after some time
- Re: Dynamically setting permanent memory libvirt-lxc
- Re: Dynamically setting permanent memory libvirt-lxc