# Increase memory for XEN VM

**URL:** <https://forums.suse.com/t/increase-memory-for-xen-vm/25228>\
**Category:** SLES Virtualization\
**Created:** [March 7, 2014, 5:14pm UTC](https://forums.suse.com/t/increase-memory-for-xen-vm/25228 "2014-03-07T17:14:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdoeconsulting](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jdoeconsulting](https://forums.suse.com/u/jdoeconsulting)\
**Post date:** [March 7, 2014, 5:14pm UTC](https://forums.suse.com/t/increase-memory-for-xen-vm/25228/1 "2014-03-07T17:14:12Z")

</div>

I have the need to add more memory to a XEN VM and I’m bit uncertain of the  
procedure for this. I would be very please if some kind soul could take the time  
to enlighten me.

Problem is that one of my XEN VMs is maxed out on memory (8 GB) and I need to  
increase it’s memory to 9 GB. I know this should in theory be able to do on the fly  
with the help of ‘xm mem-set memory’ but I’m reluctant to change  
a heavily used VM on the fly, because of the risks attached to doing so.  
However, in this case the maxmem parameter for the VM is set to what is  
currently allocated by the VM, so I can’t increase memory on the fly as I  
understand. I need to take the VM down.  
Also checking with ‘free -g’ on the XEN Host I got about 4GB free so I understand  
it should be possible to add 1 GB to the VM.

Is it as simple as to just run the following commands?;

xm list -l \> /root/.vm-premem  
xm shutdown   
xm mem-max 10000  
xm mem-set 9000  
xm start   
xm list -l \> /root/.vm-postmem

Should anything go wrong I can use the backed up profile to recreate the VM?

Thanks!

---

<div class="post-metadata">

**Author:** ![Willem1](https://avatars.discourse-cdn.com/v4/letter/w/c57346/32.png) [@Willem1](https://forums.suse.com/u/Willem1)\
**Post date:** [March 9, 2014, 11:20pm UTC](https://forums.suse.com/t/increase-memory-for-xen-vm/25228/2 "2014-03-09T23:20:19Z")

</div>

[QUOTE=jdoeconsulting;19728]I have the need to add more memory to a XEN VM and I’m bit uncertain of the  
procedure for this. I would be very please if some kind soul could take the time  
to enlighten me.

Problem is that one of my XEN VMs is maxed out on memory (8 GB) and I need to  
increase it’s memory to 9 GB. I know this should in theory be able to do on the fly  
with the help of ‘xm mem-set memory’ but I’m reluctant to change  
a heavily used VM on the fly, because of the risks attached to doing so.  
However, in this case the maxmem parameter for the VM is set to what is  
currently allocated by the VM, so I can’t increase memory on the fly as I  
understand. I need to take the VM down.  
Also checking with ‘free -g’ on the XEN Host I got about 4GB free so I understand  
it should be possible to add 1 GB to the VM.

Is it as simple as to just run the following commands?;

xm list -l \> /root/.vm-premem  
xm shutdown   
xm mem-max 10000  
xm mem-set 9000  
xm start   
xm list -l \> /root/.vm-postmem

Should anything go wrong I can use the backed up profile to recreate the VM?

Thanks![/QUOTE]

Those steps are fine. You might however find it easier to use virt-manager to change the setting from the GUI.

Cheers,  
Willem

---

<div class="post-metadata">

**Author:** ![jdoeconsulting](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jdoeconsulting](https://forums.suse.com/u/jdoeconsulting)\
**Post date:** [March 10, 2014, 4:16pm UTC](https://forums.suse.com/t/increase-memory-for-xen-vm/25228/3 "2014-03-10T16:16:38Z")

</div>

Magic31 wrote:

Thanks Willem!
