|   |   | 
| Line 118: | Line 118: | 
|  | See |  | See | 
|  | * http://docs.vmd.citrix.com/XenServer/5.5.0/1.0/en_gb/installation.html |  | * http://docs.vmd.citrix.com/XenServer/5.5.0/1.0/en_gb/installation.html | 
| − | 
 |  | 
| − | ==== How NOT to do it ====
 |  | 
| − | 
 |  | 
| − | The default image format in an SR is based on "VHD" disk images, that are distributable across VMs and contain some (compressable) meta-data about sparseness. Overwriting an LVM which was ''supposed to contain'' an VHD image with a raw disk image will make the SR corrupt. So '''if''' you do:
 |  | 
| − | * create a virtual disk with the default (XenCenter) tools in a SR
 |  | 
| − | * then active the LV on an XCP server, e.g. with <tt>lvchange -a y /dev/VG_XenStorage-e5d0e83a-7e70-3d28-31ab-ed98bfb68368/VHD-74e94bbc-b0e5-4e76-b507-12897b9b2625</tt>
 |  | 
| − | * copy the data from remove into this activates LV, and wait for it to complete (you '''cannot''' use the LV in a distributed setup as long as it is active on a single XCP host): <tt>dd if=/vm/mach/images/rooier.img bs=64M | ssh -A davidg@salado "ssh -A root@vms-piet-16.inst.ipmi.nikhef.nl 'dd of=/dev/VG_XenStorage-e5d0e83a-7e70-3d28-31ab-ed98bfb68368/VHD-74e94bbc-b0e5-4e76-b507-12897b9b2625 bs=64M'"</tt>
 |  | 
| − | * de-activate the LV on the import host <tt>lvchange -a n /dev/VG_XenStorage-e5d0e83a-7e70-3d28-31ab-ed98bfb68368/VHD-74e94bbc-b0e5-4e76-b507-12897b9b2625</tt>
 |  | 
| − | * create a new VM (typo "Other" seems to be needed) and use the newly-populated disk image as the disk for the VM
 |  | 
| − | * try it out ...
 |  | 
| − | '''it will break the SR''' and you loose all images on it (since the MGT data is support. 
 |  | 
| − | Recover using http://support.citrix.com/article/CTX122001:
 |  | 
| − | # open a console on the master XCP server
 |  | 
| − | # Back up LVM metadata
 |  | 
| − |  vgcfgbackup
 |  | 
| − | # Run the following command to see the LV which is causing trouble and that is causing the SR not to be scanned.
 |  | 
| − |  lvscan
 |  | 
| − | # Remove the clone logical volume. Note: Make sure the correct Logical Volume is deleted.
 |  | 
| − |  lvremove /dev/VG_ XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e/VDI_8e4b4263-f9af-45f3-b97e-afa5481ea2a1
 |  | 
| − | #.Run the following command to scan the SR, or use XenCenter
 |  | 
| − | xe sr-scan uuid=<UUID of SR for the VM>.
 |  | 
| − | 
 |  | 
| − | You may need to forget about the SR first and then re-attach it (but DO NOT FORMAT the SR on attaching ;-)
 |  | 
|  |  |  |  | 
|  | == Connecting with FC == |  | == Connecting with FC == |