So you blew up your CloudStack installation and all you have is a chain of XenServer VHD files on your primary storage.
The recovery process would involve creating a coalesced volume from the available VHD chain files. The steps outlined in CloudStack’s CreateVolumeFromSnapshotCommand API says…
* Given the UUID of a backed up snapshot VHD file on the secondary storage, the execute of this command does * 1) Get the parent chain of this VHD all the way up to the root, say VHDList * 2) Copy all the files in the VHDlist to some temp location * 3) Coalesce all the VHDs to one VHD which contains all the data of the volume. This invokes the DeletePreviousBackupCommand for each VHD * 4) Rename the UUID of this VHD * 5) Move this VHD to primary storage
Comment numbered (1), (2) and (3) are what we are interested in. So using vhd-util, you can coalesce the chain VHDs as below:
# vhd-util scan -f -m’*.vhd’ -p
vhd=c15d6628-0109-4e7a-9b45-28ed4e2fbbed.vhd capacity=21474836480 size=1155727872 hidden=1 parent=none
vhd=c32d7e83-6c1e-4609-8ff3-a44ff50e1af3.vhd capacity=21474836480 size=1529294848 hidden=0 parent=c15d6628-0109-4e7a-9b45-28ed4e2fbbed.vhd
# vhd-util coalesce -n c32d7e83-6c1e-4609-8ff3-a44ff50e1af3.vhd
This would be a manual step for each VHD chain you have. Once the VHD is coalesced, import the parent as a regular XenServer VHD template and manually set the OS Type. Some trial and error might be required to get the OS type right.
Finally, launch a new instance from the imported template.