调整XenServer中VM的内存上下限

   工作中使用的平台是win2008R2,XenServer5.6上的虚机,然后ssh登陆linux服务器,最近老是卡,而且多人使用,cpu,内存资源实在是少的可怜,而所在的物理机资源又消耗殆尽,于是乎将该虚机打一个快照导出xva文件导入到另一个XenServer6.2(XenServer6.2以后才开始支持不同spool的热迁移);

   虚机起来之后发现cpu可以上调,而内存死活调不上去,还只能往小的调,应该是某个参数写死了虚机可分配的内存最大值;

   经查处理如下:

   在XenServer上执行以下命令查看虚机内存峰值限制,

[root@XEN-216-23 ~]# xe vm-list name-label=192.168.11.102 params=memory-static-max,recommendations

memory-static-max ( RW)    : 4294967296

     recommendations ( RO): <restrictions><restriction field="memory-static-max" max="4294967296" /><restriction field="vcpus-max" max="8" /><restriction property="number-of-vbds" max="7" /><restriction property="number-of-vifs" max="7" /></restrictions>


查看虚机uuid:

[root@XEN-216-23 ~]# xe vm-list name-label=192.168.11.102

uuid ( RO)           : 64dadd50-32e2-431a-4d89-6b538108ae56

    name-label ( RW): 192.168.11.102

   power-state ( RO): running


调整内存最大值:

[root@XEN-216-23 ~]# xe vm-param-set uuid=64dadd50-32e2-431a-4d89-6b538108ae56 memory-static-max=16384M

Error: Failed to parse field 'memory-static-max': Unknown suffix: 'M' (try KiB, MiB, GiB or TiB)##########提示输入格式

[root@XEN-216-23 ~]# xe vm-param-set uuid=64dadd50-32e2-431a-4d89-6b538108ae56 memory-static-max=16384MiB

You attempted an operation on a VM that was not in an appropriate power state at the time; for example, you attempted to start a VM that was already running.  The parameters returned are the VM's handle, and the expected and actual VM state at the time of the call.

vm: 64dadd50-32e2-431a-4d89-6b538108ae56 (192.168.11.102)

expected: halted

actual: running###################提示应该关机操作

关机之后:

]# xe vm-param-set uuid=64dadd50-32e2-431a-4d89-6b538108ae56 memory-static-max=16384MiB

操作成功195639686.jpg


参考:http://hi.baidu.com/betajiang/item/01d4be27c0c06c9bb7326315



你可能感兴趣的:(linux,VM,xenserver)