XenServer丢失存储库SR解决方法

共3101个字

 XenServer6.5

列出所有pbd信息

[root@xenserver log]# xe pbd-list

uuid ( RO)                  : 4a0625ac-8c60-e894-762f-42094308b088
             host-uuid ( RO): e6d4f304-3a2e-446e-9fd8-a585b36c08b9
               sr-uuid ( RO): c3fcb5cf-3cb4-5e09-2553-589644de07b7
         device-config (MRO): device: /dev/disk/by-id/scsi-3644a8420058cc100212d5f6f0ee3c7a9-part3
    currently-attached ( RO): false

记录下这个false的uuid,注意看device这栏的格式,不要删错了(删除也没事,根据下面的文档也可以还原)

删掉这个false的pbd
[root@xenserver ~]# xe pbd-destroy uuid=4a0625ac-8c60-e894-762f-42094308b088

1、使用pvscan列出卷

[root@xenserver ~]# pvscan
  PV /dev/sda3   VG XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7   lvm2 [3.63 TB / 0    free]
  Total: 1 [3.63 TB] / in use: 1 [3.63 TB] / in no VG: 0 [0   ]
 
记录下uuid=
c3fcb5cf-3cb4-5e09-2553-589644de07b7 type=lvm

2、创建出这个uuid的存储

[root@xenserver ~]# xe sr-introduce uuid=c3fcb5cf-3cb4-5e09-2553-589644de07b7 type=lvm name-label=”Local storage” content-type=user
The server failed to handle your request, due to an internal error.  The given message may give details useful for debugging the problem.
message: Db_exn.Uniqueness_constraint_violation("SR", "uuid", "c3fcb5cf-3cb4-5e09-2553-589644de07b7")


下面的error信息不用管,表示已经存在了这个uuid,不用重复创建

3、找到SR分区的SCSI ID

[root@xenserver ~]# ls -l /dev/disk/by-id/ 
总计 0
lrwxrwxrwx 1 root root  9 03-09 10:27 scsi-3644a8420058cc100212d5f6f0ee3c7a9 -> ../../sda
lrwxrwxrwx 1 root root 10 03-09 10:27 scsi-3644a8420058cc100212d5f6f0ee3c7a9-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 03-09 10:27 scsi-3644a8420058cc100212d5f6f0ee3c7a9-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 03-09 10:27 scsi-3644a8420058cc100212d5f6f0ee3c7a9-part3 -> ../../sda3

注意是sda3,通过最上面的pbd列表可知,注意看scsi-后面的字符

4、列出服务器的UUID

[root@xenserver ~]# xe host-list 
uuid ( RO)                : e6d4f304-3a2e-446e-9fd8-a585b36c08b9
          name-label ( RW): xenserver
    name-description ( RW): Default install of XenServer
5、通过设置scsi id、host id、sr uuid检测出pdb uuid
[root@xenserver ~]# xe pbd-create sr-uuid=c3fcb5cf-3cb4-5e09-2553-589644de07b7 device-config:device=/dev/disk/by-id/scsi-3644a8420058cc100212d5f6f0ee3c7a9-part3 host-uuid=e6d4f304-3a2e-446e-9fd8-a585b36c08b9

f1de0e17-dda0-abdd-1c5d-af02e91d2224
这里得到的pdb uuid=f1de0e17-dda0-abdd-1c5d-af02e91d2224

6、把存储还原

[root@xenserver ~]# xe pbd-plug uuid=f1de0e17-dda0-abdd-1c5d-af02e91d2224

如果还原时提示如下错误

[root@xenserver ~]# xe pbd-plug uuid=f1de0e17-dda0-abdd-1c5d-af02e91d2224
Error code: SR_BACKEND_FAILURE_52
Error parameters: , Logical Volume mount/activate error [opterr=FSCK failed on /dev/XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7/c3fcb5cf-3cb4-5e09-2553-589644de07b7. Errno is 8],
使用fsck修复(后面的/dev/xxx就是上面报错的信息,注意,ext3是根据/var/log/MSlog得到的,根据自己情况进行修改)
[root@xenserver log]# fsck.ext3 /dev/XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7/c3fcb5cf-3cb4-5e09-2553-5896
e2fsck 1.39 (29-May-2006)
/dev/XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7/c3fcb5cf-3cb4-5e09-2553-589644de07b7 is mounted.
WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Do you really want to continue (y/n)? yes
/dev/XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7/c3fcb5cf-3cb4-5e09-2553-589644de07b7: recovering journal
/dev/XSLocalEXT-c3fcb5cf-3cb4-5e09-2553-589644de07b7/c3fcb5cf-3cb4-5e09-2553-589644de07b7: clean, 78/487063552 files, 379062156/974124032 blocks

重新还原即可
[root@xenserver log]# xe pbd-plug uuid=f1de0e17-dda0-abdd-1c5d-af02e91d2224

❤ 喜欢 0

发表评论

电子邮件地址不会被公开。

归档于 Cent OS