RecoverySoftware

Recovering data from XenServer virtual machines

How to recover data from XenServer virtual machines? As a result of our actions or a hypervisor failure, we may lose a virtual machine. It may fail to start, become corrupted, or its virtual disk may disappear. The XenServer Xen Storage may also become corrupted. What can be done in such a situation?

Recovering data from XenServer virtual machines

Contents

  1. Virtual machine does not start on XenServer
  2. Where does XenServer store virtual machine files
  3. Recreating a XenServer virtual machine
  4. Transferring a XenServer virtual machine to VirtualBox
  5. Recovering data from XenServer virtual machines using data recovery software
  6. Recovering deleted data from XenServer virtual machines

Virtual machine does not start on XenServer

A XenServer virtual machine may fail to start for various reasons.

Most often, this is due to incorrect settings: incorrect resource allocation, incorrect BIOS type, incorrect disk controller, disabled virtualization features in the server’s BIOS, etc. Incorrect settings can be corrected if possible, or you can search the internet for information on the correct settings.

The logs of the virtual machine can provide information about what is configured incorrectly. In XenCenter – the program for managing XenServer virtual machines – each machine has a “Logs” tab. It displays the startup errors.

These errors often have a general formulation about the inability to start the machine, but sometimes they indicate specific problems that prevent startup. These formulations can be copied using the context menu for searching for information.

If the machine was previously working and snapshots were created for it, you can roll back to one of these snapshots.

XenServer virtual machines may fail to start due to issues with their guest operating systems. In such cases, the machine needs to be booted from a LiveDisk and an attempt should be made to restore the functionality of the guest operating system. If recovery is not possible, at least valuable data stored inside the machine can be extracted in the LiveDisk environment.

XenServer virtual machines may fail to start due to damage or deletion of files that are necessary for their operation. This damage or deletion of files can occur as a result of:

In all of these cases, you can try to roll back to the machine’s snapshots. If that doesn’t help, you can resort to more radical measures – recreate the machine based on its virtual disk or export and import it into another hypervisor.

If these radical measures do not help, the only option left is to recover data from XenServer virtual machines. Data can be extracted from a non-starting machine using data recovery software.

XenServer machines may also fail to start due to problems with Xen Storage storage. In this case, you can try to restore the storage. And, again, if that doesn’t work, you can at least extract the necessary data from it, including the files of the virtual machine’s virtual disks.

We will discuss all of these solutions in detail below.

Where does XenServer store virtual machine files

In order to recover a virtual machine or at least its data, we need to know where XenServer stores machine data. XenCenter allows us to see only the files of virtual hard disks of machines and work with them.

Machine disks are displayed in the Xen Storage storage sections. We select the desired storage and in its “Storage” tab, we see all the disks and snapshots of machines stored in this storage. The specific feature of XenServer is that it stores snapshots as separate disks. The size of the disks is specified.

We can view the virtual disks belonging to a specific XenServer machine in its section, in the “Storage” tab. Here, all the machine’s disks are listed, along with the storage where they are located and their size.

In some cases, to recover XenServer machine data, we will also need to know the disk identifiers. But we will discuss this further when we consider this question directly.

Recreating a XenServer virtual machine

You can attempt to recover a XenServer virtual machine by recreating it based on its existing virtual disk. However, the disk must not be damaged.

Delete the problematic XenServer machine. In XenCenter, on its section, click the context menu and select “Delete VM”.

Then uncheck the virtual disks of the machine so that they are not deleted. Click “Delete”.

Next, on the XenCenter toolbar, click “New VM”.

Select the guest operating system.

Specify the name of the old machine.

Skip the boot media stage.

Select the XenServer storage.

Specify the CPU and memory resources allocated to the machine.

Skip the creation of a new virtual disk, as we will delete it later.

If necessary, configure the network.

And click “Create Now”.

In the newly created machine’s section, go to the “Storage” tab. Click the new disk of the machine and delete it with the “Delete” button.

Then click “Attach Disk”.

Specify the virtual disk from the old machine. Click “Attach”.

That’s it, now we have a new machine based on the old virtual disk. Try to start it.

Transferring a XenServer virtual machine to VirtualBox

If the virtual disk file of a XenServer machine is intact, you can try to recover the machine by transferring it to another hypervisor. This solution is also applicable in case of problems with the XenServer hypervisor itself.

If the machine starts on another hypervisor, you can back up its guest operating system and then deploy this backup on a XenServer machine. This way, you can recover it on the original XenServer hypervisor.

XenServer has the ability to export virtual machines in OVF/OVA format, which is supported by many hypervisors, including those running inside desktop operating systems such as VirtualBox and VMWare (Workstation, Player, Fusion). In these hypervisors, XenServer machines can be imported from OVF/OVA.

But there’s more. The OVF/OVA export format allows for extracting virtual machine disk files. By default, these files are in VHD format, which can be used to recreate virtual machines in the same VirtualBox or VMWare programs, as well as in the native Windows Hyper-V hypervisor.

To export a XenServer virtual machine in XenCenter, click the context menu on this machine and select “Export”.

Specify the path to save the export files on the management computer. Specify the OVF/OVA format.

If necessary, you can select multiple machines for export.

Click “Finish”.

Wait for the export of the machine files to complete.

Next, start working with the hypervisor on the management computer. How to create a virtual machine based on an existing VHD file in the free VMware Workstation Player program is described in detail here. Below, we will look at how to do this in the free VirtualBox program.

As mentioned earlier, VirtualBox can import OVF/OVA export files. You can try to import the machine using the “File → Import Appliance” menu. However, when importing machines from other hypervisors, conflicts in hardware settings often occur in any hypervisor.

A reliable way to transfer a machine from another hypervisor is to create it from scratch based on its virtual disk file, which is included in the export files. In VirtualBox, this is done as follows. Click “Create”.

Specify the name of the machine and its guest operating system type.

Specify the amount of memory for the machine.

When creating the hard disk, select “Use an existing virtual hard disk”. Click the browse button.

Click “Add”.

Specify the path to the VHD file from the exported XenServer files.

And select this disk.

Click the button to create the virtual machine.

By default, VirtualBox assigns the legacy BIOS type to all machines. If the XenServer machine used UEFI BIOS, click the machine settings button in VirtualBox.

In the “System” section, on the “Motherboard” tab, check the box to enable EFI.

And try to start the VirtualBox machine.

Recovering data from XenServer virtual machines using data recovery software

If it is not possible to recover a virtual machine, you can at least extract the data from it. How to recover data from XenServer virtual machines? This can be done using data recovery software with special functionality.

One such program is RS Partition Recovery. It supports a wide range of file systems and can mount and extract data from virtual disks of various formats, including those used by XenServer – VHD, QCOW.

When directly connecting physical XenServer hard disks, the RS Partition Recovery program detects LVM systems used by the hypervisor to store virtual machines. And it can extract data from them.

The specialization of RS Partition Recovery is data recovery, and the program supports both healthy and damaged storage media. The same applies to virtual disks. In case of damage to a virtual disk file, RS Partition Recovery provides better chances of data recovery compared to other tools.

The program provides access to the contents of not only virtual hard disks of XenServer machines but also their snapshots. If some data cannot be found on the disk itself, it may be found in one of the snapshots.

Download RS Partition Recovery.

RS Partition Recovery

All-in-one data recovery software

Let’s see how to use it to recover data from VHD or other virtual disk formats, as well as from physical disks of XenServer storage using RS Partition Recovery (or RS RAID Retrieve in the case of a RAID array).

Recovering data from a XenServer virtual disk

To recover XenServer data from VHD or other virtual disk formats, transfer their files to a computer with a desktop operating system. You can use the export method described in the section on transferring a machine.

When RS Partition Recovery starts, cancel the recovery wizard that starts by default. In the “Service” menu, click “Mount Disk”.

Select the virtual disk format. If it is VHD, click “Hyper-V (*.vhd, *.vhdx)”. If it is QCOW, click “QEMU (*.qcow, *.qcow2, *.img, *.cow, *.qed)”.

Specify the folder with the virtual disk file.

Select the disks and snapshots you need.

All of them will then be displayed in the RS Partition Recovery window as computer disks. Click each one in turn and search for the desired data.

Leave the default data search type “Quick Scan”.

After it completes, look for the desired data. Click with the mouse to select the data you want to recover. Click the “Recover” button.

Select the preferred method for recovering the data.

Then specify the path to save the data. And finally, retrieve the data in the specified location.

Recovering data from Xen Storage XenServer storage disks

If the virtual machine’s virtual disks of XenServer have large sizes, you can connect the disks of the Xen Storage storage to a computer with a desktop operating system. Alternatively, you can start the server from a disk with a desktop operating system or, for example, from a USB flash drive Windows To Go. And perform data recovery directly from the storage disks of Xen Storage.

Important: if a RAID array is used as the Xen Storage storage, you need to connect all the disks of the array to the computer with the desktop operating system. And use an alternative program to RS Partition Recovery with RAID support – RS RAID Retrieve.

Launch RS Partition Recovery. Follow the automatically started data recovery wizard.

Look at the block of physical disks. Based on the identifier obtained in the console, select the disk of the virtual machine.

You can also determine which disks belong to the machine from which you need to extract data by the size of the XenServer machine disks. This is applicable if the desired disk differs in size from other disks. In this case, cancel the data recovery wizard. In the RS Partition Recovery window, select the desired disk in the block of physical disks, based on the UUID or its size.

Then perform the search and recovery of data in the same way as described in the previous section of the article.

If the desired XenServer machine data is not found, it is possible that they were accidentally deleted as a result of a machine failure. In this case, the data can be searched for as deleted data.

Recovering deleted data from XenServer virtual machines

How to recover a virtual machine or at least its data if it cannot be recovered? Or if its virtual disks have disappeared from the Xen Storage storage? Or if the Xen Storage storage itself is inaccessible to us, damaged, or deleted and cannot be recovered using hypervisor tools?

Note: the Xen Storage storage may be inaccessible to us due to it being detached. In this case, it is necessary to reattach it using the “Reattach” operation in the “Storage” menu of XenCenter.

In all of these cases, the methods described above for recovering data from the virtual machine disk or directly from the physical disk of the storage using RS Partition Recovery (or RS RAID Retrieve in the case of a RAID array) are applicable. However, there is one small distinguishing feature.

When recovering regular data, we used the “Quick Scan” search type. It is used to search for existing data and recently deleted data.

If the data was deleted a long time ago, deleted accidentally, deleted as a result of partition formatting, disk re-partitioning, file system damage (RAW), or Xen Storage damage, you need to use the “Full Analysis” search type. It takes longer, but it searches for data more efficiently.

If the “Quick Scan” search type does not find the desired data, you can rerun the search using the “Full Analysis” search type.

In the search results, the deleted data will be located in a special folder. They will be marked with a cross. To recover them, click the “Recover” button.

And perform the recovery as described above.

Exit mobile version