Xen
Citrix XenServer:如何在沒有 XenCenter 的情況下將 RAM 添加到來賓 VM?
是否可以在不使用 XenCenter 的情況下,而是從主機控制台或遠端電腦向來賓 VM 添加 RAM?
在 XenServer 6.0 中,這可以通過以下
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.
假設 VM 已關閉,以下是實際使用它的範例:
[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]#