您的位置:首页 > 运维架构 > Linux

调整XenServer中VM的内存上下限

2013-12-19 19:59 253 查看
工作中使用的平台是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
操作成功



参考:http://hi.baidu.com/betajiang/item/01d4be27c0c06c9bb7326315
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux VM XenServer