记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。
在XenServer中创建虚机的时候,VM的最大最小值都有规定值,内存无法设置太低,也没法设置的更高, 我们安装centos5.5 64位,时发现最高可设置内存为16G;而我们现有使用要32G;
XenServer为了保证通常情况下的系统运行,为每个类型的系统设置了合适的内存范围,常用的部分如下表:
Operating SystemMinimum RAMMaximum RAM          Disk space
CentOS 4.5, 4.6, 4.7256MB16GB        800MB
CentOS 5.0, 5.1, 5.2, 5.3, 5.4512MB16GB800MB
Windows Server 2008 R2           512MB       32GBMinimum 32GB
Windows Server 2008 32-bit/64-bit512MB        32GB  Minimum 10GB, 40GB or more recommended
Windows Server 2003  256MB32GB2GB


查询
-xe template-list用来查看模版的设置,而xe vm-list是用来查看虚机的设置
-直接使用params=memory-static-min可以查看可以设置的最小内存
-直接使用params=memory-static-max可以查看可以设置的最大内存
-增加recommendations参数,可以参考XenServer中对模版或者VM的一些限制,如vCPU,网卡等数量限制
xe template-list name-label=<Name of Template> params=memory-static-max,recommendations
Or
xe vm-list name-label=<Name of VM> params=memory-static-max,recommendations
在虚拟主机上执行
  1. # xe template-list

  2. uuid ( RO)                : 5dde4fa4-d8fa-e7eb-085e-2030c54561c0
  3.           name-label ( RW): CentOS 5 (64-bit)
  4.     name-description ( RW): Template that allows VM installation from Xen-aware EL-based distros. To use this template from the CLI, install your VM using vm-install, then set other-config-install-repository to the path to your network repository, e.g. http://<server>/<path> or nfs:server:/<path>
  5. ...


  6. # xe template-list  params=memory-static-max,recommendations  uuid=5dde4fa4-d8fa-e7eb-085e-2030c54561c0
  7. memory-static-max ( RW)    : 1073741824
  8.       recommendations ( RO): <restrictions><restriction field="memory-static-max" max="17179869184" /><restriction field="vcpus-max" max="16" /><restriction property="number-of-vbds" max="7" /><restriction property="number-of-vifs" max="7" /></restrictions>
复制代码
设置最大最小值类似
xe template-param-set uuid=<UUID of Selected Template> memory-static-max=<New Memory Limit in Bytes/MiB/GiB>
Or
xe vm-param-set uuid=<UUID of Selected VM> memory-static-max=<New Memory Limit in Bytes/MiB/G

上面的方法可能只能调整下线,调整上线会由于牵涉到内存DMC的设置,所以需要使用下面的命令设置最大值:此处UUID为VM uuid
xe vm-memory-limits-set uuid=<uuid> static-min=<value> dynamic-min=<value> dynamic-max=<value> static-max=<value>
该命令中,后三个参数需要满足以下条件static-min≤dynamic-min=dynamic-max=static-max
设置内存为32G
  1. # xe vm-memory-limits-set uuid=111c20d1-5df4-5162-7517-0ef42f7e6c2d  static-min=536870912 dynamic-min=536870912 dynamic-max=34359738368 static-max=34359738368




以下是Xenserver 6的DMC资料。




转载请标明出处【Xenserver5.6修改虚拟机16GB最大内存限制】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论