增加本地存储
创建目录 [root@xenserver /]# mkdir -p /myiso 设置为sr [root@xenserver /]# xe sr-create name-label=iso type=iso device-config:location=/myiso device-config:legacy_mode=true content-type=iso 通过FTP工具上传到该目录即可
挂载本地硬盘
查看所有硬盘了的id [root@xenserver-spd ~]# ls -l /dev/disk/by-id/ 记下硬盘的全称.接下来开始挂载 [root@xenserver-spd ~]# xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-id/wwn-0x600605b00338d8601fbe933b1838bbc6 name-label="Local storage 2" -config:device=/dev/disk/by-id/后面跟的是刚才记下的SCSI name-label="Local storage 2"是你需要创建的名字.可以任意更改
XenServer虚拟机自动启动设置
一、设置pool自动启动
1. 查看pool的uuid
[root@xenserver-200 ~]# xe pool-list uuid ( RO): 2b8555d7-2712-0125-36d5-c34958e2d75e name-label ( RW): name-description ( RW): master ( RO): 93e1b8ca-615d-4018-a6a0-28ac0e01b97e default-SR ( RW): <not in database>
2. 设置pool自启动
xe pool-param-set uuid=2b8555d7-2712-0125-36d5-c34958e2d75e other-config:auto_poweron=true
二、设置虚拟机(VM)自动启动
1. 查看vm的uuid
[root@xenserver-200 ~]# xe vm-list uuid ( RO) : c0372ee2-027e-890d-f016-2420eac7477a name-label ( RW): Windows Server 2008 R2 (64-bit) (1) power-state ( RO): running uuid ( RO) : 28c3c8c9-984f-4f82-9bab-b54563a01943 name-label ( RW): Control domain on host: xenserver-200 power-state ( RO): running
2. 设置vm自启动
xe vm-param-set uuid=c0372ee2-027e-890d-f016-2420eac7477a other-config:auto_poweron=true
可以重启xenserver查看效果了。