KB2009120701: Citrix XenServer: how to access VServer images directly
In some situations it might be necessary to access the data or disk images of a Citrix XenServer VServer directly or to perform a manual file system check on a VServer partition. This document describes how to gain access via the xe tools supplied by Citrix:
An short overview of the xe commands and io layers and interfaces
xe pbd-|sr-|vdi-|vbd-|vm- (auto complete with TAB TAB) with
vm = virtual machine
vbd = virtual block device
vdi = virtual disk image
sr = storage repository
pbd = physical block device
After the object we specify the action as you can see in the following commands.
Step 1
Shut down the VM you want wo work on using XenCenter or xsconsole on the command line, otherwise the access will be not allowed.
Step 2
xe vm-list
Get the VM-UUID of the control domain labeled "Control domain on host: HOSTNAME".
Step 3
xe vbd-list vm-name-label=HOSTNAME
Get the VDI-UUID of the VDI on which you want to access directly. We recommend to assign names like HOSTNAME-system and HOSTNAME-backup to the VDIs in XenCenter. The devices you can see in the listing is the VDI name in the VM.
Step 4
xe vbd-create vm-uuid=VM-UUID vdi-uuid=VDI-UUID device=autodetect
This creates a VBD which allows the control domain to access the VDI of the VM. The command will return the VBD-UUID which we will need again.
Step 5
xe vbd-plug uuid=VBD-UUID
This command enables the VBD in the control domain. You should now see an additional disk and partitions in /proc/partitions, for example /dev/xvda1 and /dev/xvda2.
Step 6
That partitions can now
be accessed via mount or be checked via fsck the same way as regular partitions are.
Step 7
xe vbd-unplug uuid=VBD-UUID
If the partition is not mounted or accessed any more this command disables the VBD in the control domain again.
Step 8
xe vbd-destroy uuid=VBD-UUID
This command finally removes the temporary VBD created in the control domain to access the VDI of the VM.
Last change: 2009-12-10
Linux ist ein eingetragenes Warenzeichen von Linus Torvalds.
Xen ist ein eingetragenes Warenzeichen von Citrix Systems, Inc. und allen Tochterunternehmen.
Alle anderen Warenzeichen und eingetragenen Warenzeichen sind Eigentum der jeweiligen Inhaber.
