xenserver6.0加电自动启动虚机

来源:互联网 发布:手机听书软件排行 编辑:程序博客网 时间:2024/05/01 13:45

 xenserver6.0加电自动启动虚机

一、需要实现的功能:
在xenserver6.0.0 下实现物理机加电自动启动所有虚机,省去手工开启虚机的麻烦。
xenserver6.0 的xencenter GUI 界面没有设置开机自动启动vm 的选项,此特性转移到付费版
本。
网友猜测:
Is it possible that this feature has become a part of the paid versions of XenServer?
In XenCenter 6 there is no check box "Auto-start on server boot" at the "Boot Options" tab of the
machines properties page of VMs running on the XenServer 6 Beta host.When opened on a
5.6FP1/SP2 host the appropriate checkbox is shown at the tab.
官方解释:
It's not a premium feature.
It was removed due to bad interactions with other features like High Availability, Rolling Pool
Upgrade, and integrated DR. Auto-start settings made VMs start up in an uncontrolled fashion, at
the wrong times or on the wrong hosts and basically broke these other features.
The script-based solution you pointed out is a good alternative.

二、通过CLI的方式实现过程如下:
1、在pool级别开启auto power on特性
1.1 查看pool 的UUID:
[root@ ~]# xe pool-list
uuid ( RO) : [uuid-pool]
name-label ( RW): [pool-name]
name-description ( RW): [pool-desc]
master ( RO): [uuid-xs]
default-SR ( RW): [uuid-sr]
返回参数解释:
uuid-pool: A unique identifier for the Pool.
pool-name: The name given to the Pool.
pool-desc: The description set for the Pool.
uuid-xs: The unique identifier of the XenServer that currently is the Pool Master.
uuid-sr: The unique identifier for the default Storage Repository configured for the Pool.
示例:
[root@xen210 ~]# xe pool-list
uuid ( RO) : a6431202-0897-f7e3-e722-378951f73e31
name-label ( RW):
name-description ( RW):
master ( RO): 5679900d-2519-45d4-9446-f37cb0575b3c
default-SR ( RW): 1dca5500-8833-0dba-c24b-0214864aeda7
1.2 在pool 级别开启auto power on
[root@ ~]# xe pool-param-set uuid=[uuid-pool] other-config:auto_poweron=true
示例:
[root@xen210 ~]#xe pool-param-set uuid=a6431202-0897-f7e3-e722-378951f73e31
other-config:auto_poweron=true

2、在vm级别开启auto power on特性
2.1 查看vm 的UUID
[root@ ~]# xe vm-list
uuid ( RO) : [uuid-vm]
name-label ( RW): [vm-name]
power-state ( RO): [vm-power]
示例:
[root@xen210 ~]# xe vm-list
uuid ( RO) : 5a21e477-43f4-370d-8255-9a38d8fa007e
name-label ( RW): vm212
power-state ( RO): halted
uuid ( RO) : 0d3c92e3-819f-4f70-b14c-a69d9cf39841
name-label ( RW): Control domain on host: xen210
power-state ( RO): running
返回参数解释:
uuid-vm: A unique identifier for the Virtual Machine.
vm-name: The name given to the Virtual Machine.
vm-power: Shows the power state the VM is currently in (running, halted).
2.2 在vm 级别对特定vm 实现auto power on
[root@ ~]# xe vm-param-set uuid=[uuid-vm] other-config:auto_poweron=true
示例:
xe vm-param-set uuid=b636fc7c-2d4d-9661-c849-681ceaaac37d other-config:auto_poweron=true

三、参考
http://forums.citrix.com/message.jspa?messageID=1558923#1558923
http://www.virtues.it/2011/10/xenserver6-vm-auto-start-feature/