4

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

Alexander Gladysh
  • 2,343
  • 7
  • 30
  • 47

4 Answers4

3

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/

Jesse
  • 121
  • 1
3

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]#
Jed Daniels
  • 7,172
  • 2
  • 33
  • 41
2

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!

Falcon Momot
  • 24,975
  • 13
  • 61
  • 92
benathon
  • 472
  • 2
  • 12
0

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

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • 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 01:26