Jump to content
Welcome to our new Citrix community!
  • 0

XenServer Local storage recovery


Richard Hughes1709160089

Question

Hello,

 

I'm not sure if this is even possible but many years ago, I went to move a VM that had a 2TB disk attached. The storage that held this disk was mapped into Xen via iSCSI. Long story short, the VM failed to move and the 2TB disk vanished into thin air with no reference to its existence. The iSCSI volume was also showing as having free space, so the virtual disk had been deleted when the VM failed to move.

 

I deliberately held onto the iSCSI volume that used to hold this 2TB virtual disk on the hopes that I could one day, recover it. I have managed to recover a volume from this storage and it's called "VG_XenStorage-b7af9c07-6f37-91f3-72cd-3e23ddd3bb78-VHD-baf05bc9-236e-4923-89e7-aec4f28f407d.dsk". I was wondering if anybody would know if it is possible to recover the contents of this image file?

 

Cheers,

Richard

Link to comment

7 answers to this question

Recommended Posts

  • 0

You may have to try to reactivate this via LVM commands, which can be a tricky process. If you can list the VM volumes and it shows up, you can try reactivating with commands like "vgchange -ay". If under the LVM subdirectory you see a recent database file under the backup or archive areas, you could try restoring the database to see if that helps.

For some documentation about volume recovery, see for example: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/4/html/cluster_logical_volume_manager/mdatarecover

 

Link to comment
  • 0

Hi Tobias,

 

Thank you for your response to my question, I really appreciate it. Unfortunately, when this happened (approx. 2 years from now), the LUN that held this virtual storage became wiped, so the virtual disk was deleted when the VM move operation failed. I used some recovery software on the LUN and managed to recover the virtual disk as a "DSK" file. I have made several copies of this file on several disks. I have managed to convert this DSK file to VHD and I can view the VHD using 7-Zip. In 7-Zip, the archive shows an "IMG" file inside the VHD. I can't however, mount this VHD inside Windows Disk Management, it says it's corrupt. I've also tried copying this VHD to an NFS volume that I use for XenServer and did a rescan of the storage... but the virtual disk doesn't get detected. I have also tried manually importing the VHD but I get "The selected file is not a valid virtual hard disk image file". If I copy a working VHD from the same NFS volume to somewhere else then try to import that, I get the same message.

 

Cheers,

Richard

Link to comment
  • 0

Assuming this was an LVM, do you happen to have a save database of it under the /etc/lvm/backup or /etc/lvm/archive subdirectories (I think that's the path to them)? If your volume is corrupted, it may not be functional to that degree. Have you tried importing the VHD file to a different DR? it may be that the VHD file itself is corrupted.

Alas, with XS/CH, disk issues can be terribly difficult and convoluted.

 

-=Tobias

Link to comment
  • 0
3 hours ago, Tobias Kreidl said:

Assuming this was an LVM, do you happen to have a save database of it under the /etc/lvm/backup or /etc/lvm/archive subdirectories (I think that's the path to them)? If your volume is corrupted, it may not be functional to that degree. Have you tried importing the VHD file to a different DR? it may be that the VHD file itself is corrupted.

Alas, with XS/CH, disk issues can be terribly difficult and convoluted.

 

-=Tobias

 

Thank you again for your response. I've just checked the two directories, /etc/lvm/backup has three items but none of them match the UUID of the lost LVM. /etc/lvm/archive is also unfortunately empty. I think the VHD file is good though as I can view the file structure using a piece of commercial software, but the file system had dedup enabled so it would cost a lot of money to recover the files using this software. I can't seem to find any alternative utilities that support recovery from dedup enabled volumes sadly.

 

Without the meta data, I don't think there is any way of me getting this VHD back into Xen. I tried importing the VHD into a newly created NFS SR but XenCenter keeps telling me that every VHD that I try to import, is not a valid disk image? I noticed that the storage repository for the iSCSI mapping on XenServer is still there, but this is marked as unplugged as the LUN for this was deleted.

 

Cheers,

Richard

Link to comment
  • 0
On 1/31/2022 at 1:46 PM, Tobias Kreidl said:

Doesn't sound good, Richard. Good backups are always desirable but too late for all that. I'm surprised LVM databases are not backed up automatically, and I'm frankly not sure what triggers a backup (major change to the volumes?).

 

-=Tobias

 

Hello Tobias, thank you again for your responses, really appreciate it. I ended up going with the costly option by going with the 3rd party tool to recover the lost data. I agree with you 100% on backups, this volume was backed up on another box with an extended volume (no support for drive failure on the backup)... but 3 days before I lost the virtual disk on Xen, one of the drives in the backup box failed, meaning that the backup was now non-existent.

 

Cheers,

Richard

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...