cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Peterson <>
Subject RE: Corrupted HDD
Date Mon, 25 Sep 2017 16:55:15 GMT
[root@Flex-Xen5 VG_XenStorage-469b6dcd-8466-3d03-de0e-cc3983e1b6e2]# xe vdi-list | grep -A
5 12eb0cdaba30
[root@Flex-Xen5 VG_XenStorage-469b6dcd-8466-3d03-de0e-cc3983e1b6e2]# xe vdi-list | grep -A
5 d750a907a699

You can see above that both uuid's I pulled one from the uuid not found command from cloudstack
and also from the sql query both are not showing anything when I do a xe vdi-list.  This tells
me that xenserver cannot find the vdi's  leaving me with only my block device.

[root@Flex-Xen5 mapper]# ls -lh | grep 699
brw-rw---- 1 root disk 253,   9 Sep 23 11:34 VG_XenStorage--469b6dcd--8466--3d03--de0e--cc3983e1b6e2-VHD--f5aabea5--2a18--4f24--9f8d--d750a907a699

Sorry I am responding so many times I'm just going through this one by one trying to figure
anything out to recover this data.  


-----Original Message-----
From: Jeremy Peterson [] 
Sent: Monday, September 25, 2017 11:44 AM
Subject: RE: Corrupted HDD

Now if I look at my starting error from cloudstack I see the following for when it calls the
ROOT disk.


2017-09-25 11:20:16,555 DEBUG [c.c.a.t.Request] (Work-Job-Executor-57:ctx-dcbad35d job-261776/job-261778
ctx-f1843e45) Seq 19-8416664753602063711: Executing:  { Cmd , MgmtId:                    
          345050411715, via: 19(Flex-Xen1.flexhost.local), Ver: v1, Flags: 100011, [{"":{"vm":{"id":223,"name":"i-23-223-VM","bootloader":"PyGrub","typ
Server 2012 R2 (64-bit)","platformEmulator":"Windows S                              erver
2012 R2 (64-bit)","bootArgs":"","enableHA":true,"limitCpuUse":true,"enableDynamicallyScaleVm":true,"vncPassword":"P2LDsJVeaBNz2+W4OB93ZA==","params":{"memoryOvercommitR
2017-09-25 11:20:16,555 DEBUG [c.c.a.m.DirectAgentAttache] (DirectAgent-378:ctx-d30ac189)
Seq 19-8416664753602063711: Executing request
2017-09-25 11:20:16,560 DEBUG [c.c.h.x.r.CitrixResourceBase] (DirectAgent-378:ctx-d30ac189)
1. The VM i-23-223-VM is in Starting state.
2017-09-25 11:20:16,579 DEBUG [c.c.h.x.r.CitrixResourceBase] (DirectAgent-378:ctx-d30ac189)
Created VM a6739bcc-968f-abe6-d85c-a016de8b0b9f for i-23-223-VM
2017-09-25 11:20:16,585 WARN  [c.c.h.x.r.CitrixResourceBase] (DirectAgent-378:ctx-d30ac189)
Catch Exception: class com.xensource.xenapi.Types$UuidInvalid due to The uuid you        
                      supplied was invalid.
The uuid you supplied was invalid.

So in my mind I should see that uuid in /dev/mapper/ but I do not.

So I looked at Dag's post and wanted to pull down some info from sql.

| vmid  | vmname                                  | vminstname     | vmdispname          
| vmacctid | vmacctname       | vmdomainid | vmdomname          | vmofferingid | vmspeed |
vmmem | volid | volname        | volsize      | volpath                              | voltype
 | volstate |
|   223 | DC2FCE                                  | i-23-223-VM    | DC2FCE              
|       23 | admin            |         18 |           |           29 |    2000 |
 4096 |   275 | ROOT-223       | 171798691840 | f5aabea5-2a18-4f24-9f8d-d750a907a699 | ROOT
    | Ready    |

This shows me that the volpath is *699

Now that matches up with the only VHD symbolic link I can find back to /dev/mapper/VG_XenStorage--

VG_XenStorage-469b6dcd-8466-3d03-de0e-cc3983e1b6e2]# ls *699

I think the parent volume got deleted and I'm left with only the 699 volume seen above.

Do you have any suggestions on recovering from this?


-----Original Message-----
From: Jeremy Peterson [] 
Sent: Monday, September 25, 2017 10:15 AM
Subject: RE: Corrupted HDD

Ok so I will be going through both of the items listed.

But my problem is our xenserver is with iSCSI SAN's so we do not have any VHD files.

# ls VG_XenStorage--469b6dcd--8466--3d03--de0e--cc3983e1b6e2-VHD--f5aabea5--2a18--4f24--9f8d--d750a907a699

Now I've tried to run a dd on that file to export and try to recover from that its corrupted.

I'm grasping here and will be looking at more information.  I need to recover data from this
VG_XenStorage file.

Thank you in advance.  Just wanted to let you know where I am sitting.


-----Original Message-----
From: Dag Sonstebo [] 
Sent: Monday, September 25, 2017 3:16 AM
Subject: Re: Corrupted HDD

Hi Jeremy,

In addition to Adrian’s walk-through – take a look at the following blog article from
last year – it should give you some more options to try -

Dag Sonstebo
Cloud Architect

On 25/09/2017, 03:49, "Adrian Sender" <> wrote:

    Hi Jeremy,
    Some time ago I worked with Citrix in creating a article to mount and recover
    How to Mount Linux LVM Partition in a XenServer Host
    The above CTX article only applies to raw LVM LV. In our case the VDIs are LVs
    with VHD headers in it. We'll have to use blktap to create tapdisks to open
    the VHD LV before we can create device maps for the partitions / LVs within
    the VDI.
    Up to activating the VG, the article still applies. After activating the
    VG/LVs, we'll need to manually create tapdisk to open the VHD LV before using
    kpartx to create maps from partition tables.
    NOTE: I've included output from my test environment for your reference
    1. Create tapdisk
    # tap-ctl allocate /dev/xen/blktap-2/tapdev0
    2. Spawn a new process
    # tap-ctl spawn
    tapdisk spawned with pid 30383
    # tap-ctl list
    30383 - - - -
    - 0 - - -
    4. Attach the tapdisk to the process
    tap-ctl attach -p PID -m minor
    # tap-ctl attach -p 30383 -m 0
    # tap-ctl list
    30383 0 0 - -
    5. Open the VHD LV
    Note you may need to activate the LVM first with lvchange -ay
    # tap-ctl open -p 30383 -m 0 -a
    6. Verify
    # tap-ctl list 
    30383 0 0 vhd
    7. Create device maps from partition tables using kpartx
    kpartx -av /dev/xen/blktap-2/tapdev0
    # kpartx -av /dev/xen/blktap-2/tapdev0
    add map tapdev0p1 (252:5): 0 1024000 linear /dev/xen/blktap-2/tapdev0 2048
    add map tapdev0p2 (252:6): 0 32872448 linear /dev/xen/blktap-2/tapdev0 1026048
    NOTE: in this case, it is a CentOS 7 VDI, contains a /boot partition and VG -
    linux and 2 LVs (root, home).
    Device maps were created in
    8. Mount 1st partition
    # mount /dev/mapper/tapdev0p1 /mnt/boot
    9. Activate VG
    # vgchange -a y
    2 logical volume(s) in volume group "linux" now active
    # lvscan
    ACTIVE '/dev/linux/root' [13.67 GB] inherit
    ACTIVE '/dev/linux/home' [2.00 GB] inherit
    10. Mount root and home LVs
    mount -t xfs /dev/linux/root /mnt/root
    NOTE: XenServer 6.2 kernel does NOT support XFS
    mount -t ext4 /dev/linux/home /mnt/home
    11. After backing up data, reverse the procedure to release resources
    List partition mappings
    # kpartx -lv /dev/xen/blktap-2/tapdev0
    tapdev0p1 : 0 1024000 /dev/xen/blktap-2/tapdev0 2048
    tapdev0p2 : 0 32872448 /dev/xen/blktap-2/tapdev0 1026048
    De-active the VG (all LVs)
    # vgchange -an linux
    0 logical volume(s) in volume group "linux" now active
    Delete partition mappings
    # kpartx -dv /dev/xen/blktap-2/tapdev0
    del devmap : tapdev0p2
    del devmap : tapdev0p1
    12. Release the blktap resources
    # tap-ctl list
    30383 0 0 vhd
    # tap-ctl close -p 30383 -m 0
    [root@xenserver-zilblqhl /]# tap-ctl list
    30383 0 0x2 - -
    # tap-ctl destroy -p 30383 -m 0
    [root@xenserver-zilblqhl /]# tap-ctl list
    Adrian Sender
53 Chandos Place, Covent Garden, London  WC2N 4HSUK @shapeblue

----- Original Message -----------
    From: Jeremy Peterson <>
    To: "" <>
    Sent: Sun, 24 Sep 2017 22:38:29 +0000
    Subject: Corrupted HDD
    > So I need to know if anyone can drop a hint on this.
    > How can i recover data from cloudstack with xenserver.  One of the 
    > storage LUN's got 100% full.  I was carefully deleting un-associated 
    > disks from the LUN.  A disk that had no VM attached.  Then when one 
    > of the VM's rebooted it came online with no bootable disk found.
    > Now I'm thinking this over that one of those disks were the a master 
    > UUID and thats why my VM's wont boot.  Can that been fixed?
    > I look in primary storage and can find the UUID of a disk matches a 
    > volume in /dev/mapper/VG.....
    > Can I pull that disk down and create a VHD to deploy a template and 
    > deploy a new vm from that vhd file?
    > Can I dd that disk to export to anything to try and recover data?  
    > Office files or PDF's are critical.
    > Does anyone know if there are any good consulting companies with 
    > Citrix or if Citrix can help with this?
    > Jeremy
    ------- End of Original Message -------

View raw message