xen server 系统添加硬盘不是使用平常的挂载硬盘方式,使用平常的挂载方式在xencenter 里面是看不到的。
添加硬盘的命令是
- xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:02:00.0-scsi-0:2:1:0 name-label="diskb"
- 80b60c6a-ed1d-ed41-4505-cd6810123137
1,我们要添加的是第2块硬盘sdb,所以先查看磁盘的id
[root@xenserver-vm1 ~]# ls -l /dev//disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Jan 29 12:44 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 29 12:44 pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 29 12:44 pci-0000:00:1f.2-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 29 12:44 pci-0000:00:1f.2-scsi-0:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Jan 29 12:44 pci-0000:00:1f.2-scsi-0:0:1:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 29 13:46 pci-0000:00:1f.2-scsi-0:0:1:0-part1 -> ../../sdb1
2,查看host-uuid
[root@xenserver-vm1 ~]# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jan 29 12:44 35104c04-e8f2-45c6-9cca-c4cb7c43b6dd -> ../../sda1
lrwxrwxrwx 1 root root 9 Jan 29 12:44 7b81b242-e906-40d2-9d89-779c2578e6f5 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 29 13:46 9a1ebba6-5452-4e3e-9d86-99bdf1f75095 -> ../../sdb1
3,执行命令添加
[root@xenserver-vm1 ~]# xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:1:0 name-label="diskb" 7b81b242-e906-40d2-9d89-779c2578e6f5
6ca495d7-16cf-0f3a-9c2f-bd307a14759f
[root@xenserver-vm1 ~]#