最近手贱买了台独立服务器,安装的XenServer6.5系统,我也开始折腾下
XenServer中默认虚拟机是不随宿主机开机而自动启动的;但有时可能需要重启宿主机,或遇到宿主机断电现象,起来之后还需要手动一一重启上面的虚拟机,这样就比较麻烦了,还是有必要让虚拟机自动启动。
1、首先用Citrix XenCenter登录xenserver并切换到Console选项界面,或SSH工具(如putty、SecureCRT)登录到XenServer
2、用xe pool-list命令查看所有pool的uuid
1 2 3 4 5 6 |
[root@xenserver /]# xe pool-list uuid ( RO) : f0171d28-44e7-4444-0777-06f3b3805714 name-label ( RW): name-description ( RW): master ( RO): dadd6817-897c-4f58-9133-6548484600b6 default-SR ( RW): 24f60589-07e5-d32b-ba16-0fca38539099 |
3、设置pool开机自启动:
1 |
[root@xenserver /]# xe pool-param-set uuid=f0171d28-44e7-4444-0777-06f3b3805714 other-config:auto_poweron=true |
注:要把上面f0171d28-44e7-4444-0777-06f3b3805714换成你自己pool的uuid
4、用命令xe vm-list 列出所有的虚拟机,记录虚拟机的uuid
1 2 3 4 5 6 7 8 |
[root@xenserver-corp /]# xe vm-list uuid ( RO) : af9e0b9b-b0e8-385c-eb8e-f9c2f3cbc5c5 name-label ( RW): mysql5.0 power-state ( RO): running uuid ( RO) : 64b0777a-9645-40e3-84ce-9bf47cee70f3 name-label ( RW): Control domain on host: xenserver-corp power-state ( RO): running |
5、设置某一台虚拟机开机自启动(这里设置mysql5.0这台虚拟机开机自启动)
1 |
[root@xenserver /]# xe vm-param-set uuid=af9e0b9b-b0e8-385c-eb8e-f9c2f3cbc5c5 other-config:auto_poweron=true |
注:要把上面af9e0b9b-b0e8-385c-eb8e-f9c2f3cbc5c5换成要设置开机自启动的虚拟机的uuid
6、还可设置所有虚拟机开机自启动
1 |
[root@xenserver /]# for i in `xe vm-list params=uuid --minimal|sed 's/,/ /g'`;do xe vm-param-set uuid=$i other-config:auto_poweron=true;done |
就此,折腾完毕