XenServer中的虚拟机默认是不会自动启动的,所以每次XenServer主机开机或断电恢复启动后,都需要手动启动Xenserver上面的虚拟机。为了方便,我们可以设定指定的虚拟机随XenServer主机开机时自动启动。
工具/原料
XenServer控制端Citrix XenCenter或SSH命令工具
连接到XenServer并查看对应的pool资源信息
1、用Citrix XenCenter登录并切换到Console —— Local Command Shell,或SSH工具连接到XenServer服务器
2、查看XenServer中所有的pool资源,使用命令xe pool-list来查看所有的pool资源列表,如图;
3、执行命令xe pool-param-set uuid=8b8cc4ae-c11d-8944-4774-ea303a538d4d other-config:auto_poweron=true,注意将其中的uuid换成你的XenServer中pool对应的uuid
列出所有的虚拟机并设置自动启动
1、使用命令xe vm-list 列出所有的虚拟机,见下图;
2、执行命令xe vm-param-set uuid=0ae1b2ec-ee19-098b-492e-92f6b1aef021 other-config:auto_poweron=true,设置指定的虚拟机开机时自动启动,注意替换uuid为你要操作的虚拟机uuid
3、设定所有的虚拟机自启,依次输入以下指令:for i in `xe vm-list params=uuid --minimal|sed 's/,/ /g'`d泠贾高框oxe vm-param-set uuid=$i other-config:auto_poweron=truedone