Xen-Mapping OS image names with VHD files

This applies to Citrix XenServer 4.1, 4.01 and other Xen variants. Consider we have 3 images in the storage namely Redhat, Win2k3 and Win2k and you want to know the name of the VHD files in the storage.

Xen has a convoluted way of relating to operating system files. This is how the naming goes – Every VM has name and unique VM-UUID. Then there is another data structure called VBD (virtual block device). VBD links the VM-UUID and VDI (virtual disk image). VDI is another data structure which contains all the physical characteristics. VDI is linked to VHD files which reside in the respective storage repository. So the way to get to the individual VHD file from an OS image name can be to link VM-UUID with the corresponding VDI-UUID and then to the VHD.

VM-name -> VM-UUID-> VBD -> VDI-UUID-> VHD

Procedure

  1. Note the name of the operating system image.
  2. on the Xen console, type xe vm-list.
  3. Note the VM-UUID of the machine template.
  4. on the Xen console, type xe vbd-list.
  5. Note the VDI-UUID of the machine template.
  6. on the Xen console, type xe sr-list.
  7. Note the name of the storage and SR-UUID
  8. move /var/run/sr-mount/ on the Xen console.
  9. You will find all the mounted drives. Change the directory to the required storage by referring to the SR-UUID.
  10. you will find all the VHD files.
  11. Match the VDI-UUID got from step-5 to the VHD file names there.

You may now, identify the VHD image.

Surely, there should be some other way to do this(maybe through the XenCenter UI?). If so, let me know about it.

Thanks,

Arun.P.C

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: