xenserver挂载本地存储库

方法一:

  1.1:查看磁盘列表

    fdisk -l

[root@xenserver ~]# fdisk -l

Disk /dev/sdb: 7999.4 GB, 7999376588800 bytes, 15623782400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1  4294967295  2147483647+  ee  GPT

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/VG_XenStorage--342bacfc--f135--104c--bd2b--9963ffa9b0bb-MGT: 4 MB, 4194304 bytes, 8192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

  df -h

[root@xenserver ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 2.0G     0  2.0G   0% /dev
tmpfs                    2.0G  120K  2.0G   1% /dev/shm
tmpfs                    2.0G  1.5M  2.0G   1% /run
tmpfs                    2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sdb1                 18G  2.1G   15G  13% /
xenstore                 2.0G     0  2.0G   0% /var/lib/xenstored
/dev/loop0                45M   45M     0 100% /var/xen/xc-install
/dev/sdb5                3.9G  247M  3.4G   7% /var/log
/dev/sda                 1.8T   77M  1.7T   1% /data
10.18.18.18:/nfs/iso   18G  8.9G  7.9G  53% /run/sr-mount/a3ab3cfb-645d-54a0-9c49-9462bd66a7c3
tmpfs                    393M     0  393M   0% /run/user/0

  1.2:主机列表

    xe host-list

[root@xenserver~]# xe host-list
uuid ( RO)                : 03c38c30-f4f7-4cb7-ad5f-963c9f604e23
          name-label ( RW): xenserver-hk-01
    name-description ( RW): Default install


uuid ( RO)                : 3befa5af-c1dd-4b94-b299-09c27458cd59
          name-label ( RW): xenserver-hk-02
    name-description ( RW): Default install

  1.3:新建本地存储仓库

    xe sr-create host-uuid=3befa5af-c1dd-4b94-b299-09e27458cd59 content-type=user type=lvm device-config:device=/dev/sda shared=false name-label="Local storage 2"

[root@xenserver ~]# xe sr-create host-uuid=3befa5af-c1dd-4b94-b299-09e27458cd59 content-type=user type=lvm device-config:device=/dev/sda shared=false name-label="Local storage 2"
-bash: $'xe\342\200\202sr-create\342\200\202host-uuid=3befa5af-c1dd-4b94-b299-09e27458cd59': command not found

方法二:

  2.1:查看磁盘路径:

    ls -l /dev/disk/by-path/

[root@xenserver ~]# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Feb 26 16:53 pci-0000:02:00.0-scsi-0:0:5:0 -> ../../sda
lrwxrwxrwx 1 root root  9 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part4 -> ../../sdb4
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Feb 26 16:23 pci-0000:02:00.0-scsi-0:2:0:0-part6 -> ../../sdb6

  2.2:创建本地存储仓库

xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:5:0 name-label="Local storage 2"

感谢:

https://wenku.baidu.com/view/c75c65f787c24028905fc3a2.html

https://blog.csdn.net/pclzr/article/details/44724353

https://blog.csdn.net/bishuixing/article/details/79823660

猜你喜欢

转载自www.cnblogs.com/jackyzm/p/10440209.html