No XenServer 6.0, isso pode ser feito com o comando vm-memory-limits-set
:
[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.
Supondo que a VM está desativada, aqui está um exemplo de como usá-la:
[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]#