Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to add RAM to a guest VM in without using XenCenter, but from the host machine console or a remote machine?

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

In XenServer 6.0, this can be done with the vm-memory-limits-set command:

[root@localhost 1274]# xe help vm-memory-limits-set
command name            : vm-memory-limits-set
        reqd params     : static-min, static-max, dynamic-min, dynamic-max
        optional params : <vm-selectors>
        description     : Configure the memory limits of a VM. The simplest way to select the VM on which the operation is to be performed is by supplying the argument 'vm=<name or uuid>'. VMs can also be specified by filtering the full list of VMs on the values of fields. For example, specifying 'power-state=halted' will select all VMs whose power-state field is equal to 'halted'. Where multiple VMs are matching, the option '--multiple' must be specified to perform the operation. The full list of fields that can be matched can be obtained by the command 'xe vm-list params=all'. If no parameters to select VMs are given, the operation will be performed on all VMs.

Assuming the VM is powered down, here is an example of actually using it:

[root@localhost 1274]# xe vm-list name-label=Local-PerformanceVM params=all |grep memory
                 memory-actual ( RO): 0
                 memory-target ( RO): <expensive field>
               memory-overhead ( RO): 4194304
             memory-static-max ( RW): 268435456
            memory-dynamic-max ( RW): 268435456
            memory-dynamic-min ( RW): 268435456
             memory-static-min ( RW): 16777216
               recommendations ( RO): <restrictions><restriction field="memory-static-max" max="34359738368" /><restriction field="vcpus-max" max="8" /><restriction property="number-of-vbds" max="7" /><restriction property="number-of-vifs" max="7" /></restrictions>
                        memory (MRO):
[root@localhost 1274]# xe vm-memory-limits-set dynamic-max=300000000 dynamic-min=300000000 static-max=300000000 static-min=16777216 name-label=Local-PerformanceVM
[root@localhost 1274]# xe vm-list name-label=Local-PerformanceVM params=all |grep memory
                 memory-actual ( RO): 0
                 memory-target ( RO): <expensive field>
               memory-overhead ( RO): 5242880
             memory-static-max ( RW): 300000000
            memory-dynamic-max ( RW): 300000000
            memory-dynamic-min ( RW): 300000000
             memory-static-min ( RW): 16777216
               recommendations ( RO): <restrictions><restriction field="memory-static-max" max="34359738368" /><restriction field="vcpus-max" max="8" /><restriction property="number-of-vbds" max="7" /><restriction property="number-of-vifs" max="7" /></restrictions>
                        memory (MRO):
[root@localhost 1274]#
share|improve this answer
add comment

I'm a bit new to XenServer, so I've never had to try this, but there appear to be XE commands for updating the dynamic memory config, but I think that's limited to the pay versions.

It's probably a bit long to paste here, but check out pages 66-67 of the 5.6 SP2 Admin guide here: http://support.citrix.com/servlet/KbServlet/download/27187-102-658234/reference.pdf

If you're using an older version without dynamic memory, all of the XenServer admin guides are here, just select the version, then the Documentation tab, then the Administrators guide: http://support.citrix.com/product/xens/

share|improve this answer
add comment

Sorry joeqwerty, but I fully disagree.

These are the commands I ran to up the memory on my nameserver VM.

xe vm-shutdown name-label="WINS Nameserver"
xe vm-list params=all name-label="WINS Nameserver" | grep memory
xe vm-list params=uuid name-label="WINS Nameserver"
xe vm-param-set memory-static-max=668435456 memory-dynamic-max=668435456 memory-dynamic-min=668435456 uuid=ffffb8a9-ffff-ffff-2df1-fffc9bd9688a
xe vm-start name-label="WINS Nameserver"

The start and stop commands are "blocking" aka they wait till the vm shuts down before returning. This means you can run these commands as fast as possible and it will work fine.

If you already know the uuid if your vm, you can use "uuid=" in-place of the "name-label=" option. Also note: if you know the first 3 characters of your uuid, you can press tab and XenServer will auto-complete the rest for you! epic! Let me know if you have any further issues with this!

Regards, Port Forward Podcast

share|improve this answer
1  
do not edit other people's answer to change the content of the answer. You have been warned. –  Chris S Aug 19 '11 at 0:53
add comment

Not that I'm aware of. Resources are allocated from the host to the guest via the XenCenter management console.

share|improve this answer
1  
-1. This is an incorrect answer, at least for the current XenServer. –  Jed Daniels Mar 10 '12 at 15:50
    
Jed: Was this answer correct for the version of XenCenter available at the time this question was asked and answered? If so, please reverse your downvote. –  joeqwerty Mar 10 '12 at 17:29
    
Sorry Joe, but I do not believe so (although I can not definitively prove it, since I don't have an XS 5.6 up and running). Jesse's answer links to the 5.6 guide that references adjusting memory from the CLI, and portforwardpodcast's answer actually has an example. His example won't actually work in 6.0 though, as the command appears to have changed slightly (I'll post an answer with this info momentarily). Sorry to downvote you. –  Jed Daniels Mar 10 '12 at 19:42
    
No worries. If my answer isn't right, then it isn't right. –  joeqwerty Mar 11 '12 at 1:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.