When you remove a host from a XenServer pool, the host gets reinitialized, so any VMs running locally get lost. Luckily, it’s not too hard to recover the vdis from lvm. Here’s an outline of the steps with some links that have more info / specific commands.
- If you can, join the host back to the pool and connect to your shared storage; this way you get the vms (that were moved to the pool when you added the host) and the vdis and only have to match the two together at the end
- Navigate to /etc/lvm/backup and find the file with the previous lvm data (the logical volumes should have all of your old vdis / snapshots, and it should have the relevant device path eg /dev/sda3)
- Find the current physical volume uuid
- Backup the /etc/lvm directory
- Modify the old volume group file and replace the old physical volume uuid with the current one
- Detach the local storage SR from the XenServer (see link below)
- Use vgcfgrestore to restore the old volume group file
- If you do vgscan you should see the newer volume group replaced with the old one (the name will be the same as the old one)
- Attach local storage SR to the XenServer with the current volume group name
- Create a new pbd with the SCSI ID and plug it in (see link below)
- Scan the new SR, it should pick up the old vdis but without any meta data. If you create a new VM and attach these one-by-one as secondary disks, mount them to the new VM and check what they are, then you can rename them and attach back to your vms (that should be sitting in your pool).
- Move all the vdis you need over to your new SR, then you can remove your host again
Getting physical volume uuid and finding and modifying the file: http://support.citrix.com/article/CTX128097
Removing SR: http://support.citrix.com/article/CTX131328
Adding back local storage as an SR: http://support.citrix.com/article/CTX121896