TypechoJoeTheme

主机评测

主机评测

专注服务器评测和优惠码发布

XenServer删除储存仓库

2022-03-27
/
0 评论
/
914 阅读
/
正在检测是否收录...
03/27

1.查找要删除的SR的UUID

[root@xenserver-154-localnfs iso]# xe sr-list  name-label=local_vm
uuid ( RO)                : 8f61c204-2b65-fae4-d211-af47d7b44397
          name-label ( RW): local_vm
    name-description ( RW):
                host ( RO): xenserver-154-localnfs
                type ( RO): lvm
        content-type ( RO): user

2.通过SR的uuid,查找物理存储块PBD的UUID

[root@xenserver-154-localnfs iso]# xe pbd-list  sr-uuid=8f61c204-2b65-fae4-d211-af47d7b44397
uuid ( RO)                  : e4ce6fed-87b9-2a0d-e8d1-dddadec160e8
             host-uuid ( RO): fa80b448-4ac6-40ca-935f-7c9808d9ffad
               sr-uuid ( RO): 8f61c204-2b65-fae4-d211-af47d7b44397
         device-config (MRO): device: /dev/mapper/vm--VG-vm--LV
    currently-attached ( RO): true

3.断开PBD连接

xe  pbd-unplug uuid=e4ce6fed-87b9-2a0d-e8d1-dddadec160e8

4.最后删除记录

xe  sr-forget uuid=8f61c204-2b65-fae4-d211-af47d7b44397

5.错误过程形成脚本,脚本后期会添加内容

#!/bin/bash
read -p "please  input name-label  of  SR  that you  want  to  delete"  LABEL
SR-uuid=`xe sr-list  name-label=$LABEL | grep "uuid"  | awk -F :  '{print $NF}'`
PBD-uuid=`xe pbd-list  sr-uuid=${SR-uuid}`  | grep "uuid"  | awk -F :  '{print $NF}'`
xe  pbd-unplug uuid=${PBD-uuid}
xe  sr-forget uuid=${SR-uuid}
XenServer
朗读

赞 · 0
赞赏
感谢您的支持,我会继续努力哒!
打开手机扫一扫,即可进行打赏哦!
版权属于:

主机评测

本文链接:

https://zjpc.cc/1093.html(转载时请注明本文出处及文章链接)

评论 (0)