很多服務器都會多塊盤或者做了Raid的多個虛擬磁盤,而安裝xenserver後,他只會默認掛載第一快盤,也就是安裝xenServer系統的那塊。
那剩餘的其他盤,怎麼掛載上去做虛擬機的存儲用呢?或者後期新增一塊磁盤該如何操作呢?
1、用命令查看下自己的host-uuid
[root@xenserver-10 ~]# xe host-list
uuid ( RO) : dca60990-98c3-4f10-b05d-aee9138778f7
name-label ( RW): xenserver-8.239
name-description ( RW): Default install
2、查看所有硬盤了的id
[root@xenserver-10 ~]# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 10 Oct 24 12:52 dm-name-VG_XenStorage--1d5302ea--598a--8acd--5be5--b67e3a142160-MGT -> ../../dm-0
lrwxrwxrwx 1 root root 10 Oct 24 12:52 dm-uuid-LVM-67dHwk1JS4179AxhDbOKqkOue2zwvABRX6ilOR9xT2sUseuVJUfBXa36HKrO726G -> ../../dm-0
lrwxrwxrwx 1 root root 9 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part6 -> ../../sda6
lrwxrwxrwx 1 root root 9 Feb 6 10:51 scsi-364cd98f09abc4b002541c7ef0511f4de -> ../../sdb
lrwxrwxrwx 1 root root 9 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part6 -> ../../sda6
lrwxrwxrwx 1 root root 9 Feb 6 10:51 wwn-0x64cd98f09abc4b002541c7ef0511f4de -> ../../sdb
3、查看需要掛載的分區
[root@xenserver-10 ~]# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part6 -> ../../sda6
lrwxrwxrwx 1 root root 9 Feb 6 10:51 pci-0000:1a:00.0-scsi-0:2:1:0 -> ../../sdb
4、掛載第2塊硬盤到系統中,掛載成功會返回新存儲的UUID
[root@xenserver-10 ~]# xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:1:0 name-label="Disk 2"
40bf63b0-cb28-9a21-1395-99e3be77e353
ssh鏈接更改xenserver管理ip
[root@xenserver-233 ~]# xe pif-list
uuid ( RO) : 58f7110a-e5a9-1133-c11d-2d65a366f4f2
device ( RO): eth3
currently-attached ( RO): true
VLAN ( RO): -1
network-uuid ( RO): 64905b67-573e-0230-3082-fb35e1c969ee
uuid ( RO) : ab51b53f-f1ee-b723-d618-0557994c504a
device ( RO): eth2
currently-attached ( RO): true
VLAN ( RO): -1
network-uuid ( RO): 0ac12da2-b1b4-5c18-e286-11d20ebf397e
uuid ( RO) : 9f2234da-6a72-2df7-e11f-fbe61892d33e
device ( RO): eth1
currently-attached ( RO): true
VLAN ( RO): -1
network-uuid ( RO): 6c0357c1-fc3c-3b71-a9ed-605fe9fef855
uuid ( RO) : b8c518a6-89e2-3703-057c-c445950b2153
device ( RO): eth0
currently-attached ( RO): true
VLAN ( RO): -1
network-uuid ( RO): e05080dd-0c7b-d3e4-a019-c90d77856a9c
[root@xenserver-233 ~]# xe pif-param-list uuid=b8c518a6-89e2-3703-057c-c445950b2153
uuid ( RO) : b8c518a6-89e2-3703-057c-c445950b2153
device ( RO): eth0
MAC ( RO): e4:43:4b:0b:05:60
physical ( RO): true
managed ( RO): true
currently-attached ( RO): true
MTU ( RO): 1500
VLAN ( RO): -1
bond-master-of ( RO):
bond-slave-of ( RO): <not in database>
tunnel-access-PIF-of ( RO):
tunnel-transport-PIF-of ( RO):
management ( RO): true
network-uuid ( RO): e05080dd-0c7b-d3e4-a019-c90d77856a9c
network-name-label ( RO): Pool-wide network associated with eth0
host-uuid ( RO): 76df7020-a1bf-4f41-89bd-2711dd9a1d77
host-name-label ( RO): xenserver-233
IP-configuration-mode ( RO): Static
IP ( RO): 10.2.1.233
netmask ( RO): 255.255.254.0
gateway ( RO): 10.2.0.1
IPv6-configuration-mode ( RO): None
IPv6 ( RO):
IPv6-gateway ( RO):
primary-address-type ( RO): IPv4
DNS ( RO): 10.2.0.24,114.114.114.114
properties (MRO): gro: on
capabilities (SRO): fcoe
io_read_kbs ( RO): 0.486
io_write_kbs ( RO): 0.033
carrier ( RO): true
vendor-id ( RO): 8086
vendor-name ( RO): Intel Corporation
device-id ( RO): 10fb
device-name ( RO): 82599ES 10-Gigabit SFI/SFP+ Network Connection
speed ( RO): 10000 Mbit/s
duplex ( RO): full
disallow-unplug ( RW): false
pci-bus-path ( RO): 0000:01:00.0
other-config (MRW):
[root@xenserver-233 ~]# xe pif-reconfigure-ip uuid=b8c518a6-89e2-3703-057c-c445950b2153 mode=static IP=10.2.33.233 netmask=255.255.254.0 gateway=10.2.33.1 dns=10.2.0.24,114.114.114.114