xenserver 添加本地硬盘

系统:XenServer7.4

安装XenSserver7.4后,Local Storage,挂载的盘过小,需要增加一块硬盘进行扩容。

操作如下:

首先获取 host-uuid

[root@xenserver-mpfstcla ~]# xe host-list
uuid ( RO)                : e60429a3-b459-4e56-9df5-df6c311f6dac

一、删除旧的Local Storage,找到对应的 sr-uuid(可选)
1、找对对应的sr-uuid

[root@xenserver-mpfstcla ~]# xe sr-list

uuid ( RO)                : ad19e235-5fed-4286-c7ef-7cf0f5c0e4e7
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver-10.192.48.138
                type ( RO): ext
        content-type ( RO): user

2、删除sr-uuid,提示被占用

[root@xenserver-mpfstcla ~]# xe sr-forget uuid=4b124ec4-6c66-c66b-d62d-38f5a1917841
The SR is still connected to a host via a PBD. It cannot be destroyed or forgotten.
sr: 4b124ec4-6c66-c66b-d62d-38f5a1917841 (Removable storage)

# 查看被占用的信息
#xe pbd-list sr-uuid=4b124ec4-6c66-c66b-d62d-38f5a1917841
[root@xenserver-mpfstcla ~]# xe pbd-list sr-uuid=4b124ec4-6c66-c66b-d62d-38f5a1917841
uuid ( RO)                  : 233c2541-0c66-3a11-7ac7-d2014821634e
             host-uuid ( RO): e60429a3-b459-4e56-9df5-df6c311f6dac
               sr-uuid ( RO): 4b124ec4-6c66-c66b-d62d-38f5a1917841
         device-config (MRO): location: /dev/xapi/block
    currently-attached ( RO): true
#解除占用
#  xe pbd-unplug uuid=233c2541-0c66-3a11-7ac7-d2014821634e
# xe sr-forget uuid=4b124ec4-6c66-c66b-d62d-38f5a1917841

二、重启后。添加新磁盘

#1、列出设备,发现Sda设备是正在使用的设备,sdb需要添加
[root@xenserver-mpfstcla ~]# ll /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 May 25 15:33 scsi-3600605b00b7451d01ea17e7a03a7f512 -> ../../sda
lrwxrwxrwx 1 root root 10 May 25 15:33 scsi-3600605b00b7451d01ea17e7a03a7f512-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 25 15:33 scsi-3600605b00b7451d01ea17e7a03a7f512-part2 -> ../../sda2
lrwxrwxrwx 1 root root  9 May 25 15:33 scsi-3600605b00b7451d01ea3cf250c51c1bd -> ../../sdb
lrwxrwxrwx 1 root root  9 May 25 15:33 wwn-0x600605b00b7451d01ea17e7a03a7f512 -> ../../sda
lrwxrwxrwx 1 root root 10 May 25 15:33 wwn-0x600605b00b7451d01ea17e7a03a7f512-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 25 15:33 wwn-0x600605b00b7451d01ea17e7a03a7f512-part2 -> ../../sda2
lrwxrwxrwx 1 root root  9 May 25 15:33 wwn-0x600605b00b7451d01ea3cf250c51c1bd -> ../../sdb

/2、添加硬盘,device以及host-id更改
#xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-3600605b00b7451d01ea3cf250c51c1bd  host-uuid=e60429a3-b459-4e56-9df5-df6c311f6dac  name-label="Local Storage"  shared=false type=lvm
2e6224ff-8573-807c-c414-e4b670f5f971

xenserver 能查看到 Local Storage。

你可能感兴趣的:(xenserver 添加本地硬盘)