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
- Note the name of the operating system image.
- on the Xen console, type xe vm-list.
- Note the VM-UUID of the machine template.
- on the Xen console, type xe vbd-list.
- Note the VDI-UUID of the machine template.
- on the Xen console, type xe sr-list.
- Note the name of the storage and SR-UUID
- move /var/run/sr-mount/ on the Xen console.
- You will find all the mounted drives. Change the directory to the required storage by referring to the SR-UUID.
- you will find all the VHD files.
- 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.