I have a serious problem. I'm trying to recover a deleted lvm vdi on XenServer 5.5
After a lot of search work I found a way to create the backup file for the lvm metadata before the delete. Following this topic, I managed to restore the metadata correctly and lvm does see my missing LV:
http://support.citrix.com/article/CTX117508
Before vgcfgrestore, vgdisplay outputs 16 LV's, after the restore and vgchange -ay, it lists 17 LV's. So the last step would be to rescan the SR with 'xe sr-scan uuid'.
But after I ran this, Xen seems to change the lvm config back to the old one, and vgdisply outputs 16 LV's again !
Does anyone know why this happens and how I can reactivate this volume?
Problem with 'xe sr-scan' after vgcfgrestore
Started by Frans van Nispen , 02 January 2011 - 11:59 AM
Members
-
-
#1
Posted 02 January 2011 - 11:59 AM
Members
-
-
#2
Posted 02 January 2011 - 02:47 PM
Did you run sr-probe before the sr-scan? I'm just wondering if that would make a difference.
--Tobias
Members
-
-
#3
Posted 02 January 2011 - 05:16 PM
What should I need to use for 'type' on sr-probe with local lvm storage ?
Frans
Members
-
-
#5
Posted 02 January 2011 - 08:09 PM
Doesn't work :(
Old/current meta:
# vgdisplay
--- Volume group ---
VG Name VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 101
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 16
Open LV 9
Max PV 0
Cur PV 1
Act PV 1
VG Size 923.66 GB
PE Size 4.00 MB
Total PE 236458
Alloc PE / Size 77356 / 302.17 GB
Free PE / Size 159102 / 621.49 GB
VG UUID 0iy3T6-FPDg-csLx-4235-1yyg-sFIu-PnM2u8
Then I restore the lvm metadata, first with --test to make sure the backup is ok, then:
# vgcfgrestore VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2 -f VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2_003.vg
Restored volume group VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2
# vgchange -ay VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2 17 logical volume(s) in volume group "VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2" now active
# vgdisplay --- Volume group ---
VG Name VG_XenStorage-9e59c965-1368-5cd5-02c7-712559a9e8e2
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 100
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 17
Open LV 9
Max PV 0
Cur PV 1
Act PV 1
VG Size 923.66 GB
PE Size 4.00 MB
Total PE 236458
Alloc PE / Size 88379 / 345.23 GB
Free PE / Size 148079 / 578.43 GB
VG UUID 0iy3T6-FPDg-csLx-4235-1yyg-sFIu-PnM2u8
As you can see, the lvm is updated. Also 'lvm' shows the volume with the uuid correctly.
sr-probe with type=lvmoiscsi requires an iSCSI target, so I tried:
# xe sr-probe device-config:device=/dev/sda3 type=lvm
<?xml version="1.0" ?>
<SRlist>
<SR>
<UUID>
9e59c965-1368-5cd5-02c7-712559a9e8e2
</UUID>
<Devlist>
/dev/sda3
</Devlist>
</SR>
</SRlist>
But if I now run:
# xe sr-scan uuid=9e59c965-1368-5cd5-02c7-712559a9e8e2
I'm back to where I started, and vgdisplay shows 16 volumes again in stead of 17. And the volume is indeed missing.
Edited by: Frans van Nispen on 2-jan-2011 15:10
Members
-
-
#6
Posted 02 January 2011 - 08:35 PM
Very strange. Looks like something may have become corrupted at some point so that there's now this discrepancy.
Members
-
-
#7
Posted 21 February 2014 - 11:37 PM
I know this is an old thread, but we have exactly the same problem and really have to get these volumes back.
Two volumes where deleted from the volume group VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c.
After following the instructions from http://support.citrix.com/article/CTX117508 we managed to restore the meta data. According to lvscan we have all 7 (including the MGT volumes) volumes:
ACTIVE '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/MGT' [4.00 MB] inherit
inactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-130c6c15-5620-463a-af83-bd36335dfc0a' [20.05 GB] inheritinactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-18c526d2-f52b-4bae-b7a2-d297dad3e661' [20.05 GB] inheritinactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-88bd819b-3b8f-4e56-8202-446c58379c00' [80.16 GB] inheritinactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-16a4a31a-0306-4994-8cbc-7cea4bc884d1' [150.30 GB] inheritinactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-6cce7e42-7f2c-4765-ac4d-0dc2310b1f0b' [8.02 GB] inheritinactive '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-9948ecc3-85bd-4ff7-8424-412e14bef3fc' [20.05 GB] inherit
When we run "xe sr-scan uuid=732df7ea-3009-033b-13ce-6224dc68272c" the two deleted volumes are being removed. We looked at /var/log/SMlog and found out that these two volumes get deleted by SMGC (garbage collection??):
Feb 21 23:37:01 xenserver-ovamed SMGC: [8727] Found 2 VDIs for deletion:
Feb 21 23:37:01 xenserver-ovamed SMGC: [8727] *130c6c15[VHD](20.000G//20.047G|n)Feb 21 23:37:01 xenserver-ovamed SMGC: [8727] *88bd819b[VHD](80.000G//80.164G|n)Feb 21 23:37:01 xenserver-ovamed SMGC: [8727] Deleting unlinked VDI *130c6c15[VHD](20.000G//20.047G|n)Feb 21 23:37:01 xenserver-ovamed SM: [8727] lock: tried lock /var/lock/sm/732df7ea-3009-033b-13ce-6224dc68272c/sr, acquired: True (exists: True)Feb 21 23:37:01 xenserver-ovamed SM: [8727] ['/usr/sbin/lvremove', '-f', '/dev/VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c/VHD-130c6c15-5620-463a-af83-bd36335dfc0a']Feb 21 23:37:01 xenserver-ovamed SM: [8727] pread SUCCESSFeb 21 23:37:01 xenserver-ovamed SM: [8727] ['/sbin/dmsetup', 'status', 'VG_XenStorage--732df7ea--3009--033b--13ce--6224dc68272c-VHD--130c6c15--5620--463a--af83--bd36335dfc0a']Feb 21 23:37:01 xenserver-ovamed SM: [8727] pread SUCCESSFeb 21 23:37:01 xenserver-ovamed SM: [8727] Deleting vdi: 130c6c15-5620-463a-af83-bd36335dfc0a
vhd-util tells us, that BEFORE running xe sr-scan, these two partitions have a hidden flag:
# vhd-util scan -f -c -m VHD-* -l VG_XenStorage-732df7ea-3009-033b-13ce-6224dc68272c:
vhd=VHD-130c6c15-5620-463a-af83-bd36335dfc0a capacity=21474836480 size=21525168128 hidden=1 parent=none
vhd=VHD-18c526d2-f52b-4bae-b7a2-d297dad3e661 capacity=21474836480 size=21525168128 hidden=0 parent=nonevhd=VHD-88bd819b-3b8f-4e56-8202-446c58379c00 capacity=85899345920 size=86075506688 hidden=1 parent=nonevhd=VHD-16a4a31a-0306-4994-8cbc-7cea4bc884d1 capacity=161061273600 size=161384235008 hidden=0 parent=nonevhd=VHD-6cce7e42-7f2c-4765-ac4d-0dc2310b1f0b capacity=8589934592 size=8615100416 hidden=0 parent=nonevhd=VHD-9948ecc3-85bd-4ff7-8424-412e14bef3fc capacity=21474836480 size=21525168128 hidden=0 parent=none
Members
-
-
#8
Posted 22 February 2014 - 02:13 PM
