Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
hypervisor:base:xcp-xapi [2015/03/29 03:04]
admin [Create a VBD for the VDI and plug it]
hypervisor:base:xcp-xapi [2015/03/29 04:46]
admin [kpartx for Mapping Partition Tables]
Line 174: Line 174:
 It is often interesting to setup at least one VM to autostart at boot time. It is often interesting to setup at least one VM to autostart at boot time.
  
-Do do so you can follow this next procedure:+Do do so you can follow this next procedure, that is also described [[http://​sysadmin.compxtreme.ro/​autostart-vm-in-free-version-of-xenserver-6-x/​|on this post]]:
  
 === Gather the UUIDs of the pools you wish to auto-start === === Gather the UUIDs of the pools you wish to auto-start ===
Line 255: Line 255:
  
 ---- ----
-===== Create and Access ​VDI from Dom0 =====+===== Create and Access ​File Based VDI from Dom0 ===== 
 +---- 
 + 
 +The following procedure is based on the one described [[http://​discussions.citrix.com/​topic/​334905-mount-vm-disk-image-as-file-system-in-xenserver-6/​|in this post]]. 
 ---- ----
 ==== Create the Virtual Hard Disk (VDI) ==== ==== Create the Virtual Hard Disk (VDI) ====
Line 277: Line 281:
 </​code>​ </​code>​
  
 +We'll now have a new vhd file at:\\
 +//​**/​run/​sr-mount/<​sr-uuid>/<​vdi-uuid>​.vhd**//​
 +
 +Which, in our example, translates to:\\
 +/​run/​sr-mount/​26b9d87b-f344-1c8d-c5c5-a155d4e4e2e0/​72e00fc6-98bb-48fe-ab4d-b52d1ef721b5.vhd
 ---- ----
 ==== Create a VBD for the VDI and plug it ==== ==== Create a VBD for the VDI and plug it ====
Line 303: Line 312:
 </​code>​ </​code>​
  
-At this stage, a new device will get listed under //​**/​dev/​sm/​backend/**//<​sr-uuid>/<​vdi-uuid>​ like:+At this stage, a new device will get listed under //​**/​dev/​sm/​backend/<​sr-uuid>/<​vdi-uuid>​**// like:
  
 Before vdb-plug instruction:​ Before vdb-plug instruction:​
Line 319: Line 328:
 brw------- 1 root root 253, 1 Mar 29 01:59 72e00fc6-98bb-48fe-ab4d-b52d1ef721b5 brw------- 1 root root 253, 1 Mar 29 01:59 72e00fc6-98bb-48fe-ab4d-b52d1ef721b5
 </​code>​ </​code>​
 +
 ---- ----
 +==== kpartx for Mapping Partition Tables ====
 +----
 +The kpartx command creates device maps from partition tables. Each guest storage image has a partition table embedded in the file.
  
 +We'll first need to install the package if it is not already available.
 +<​code>​
 +> apt-get install kpartx
 +</​code>​
  
 +=== Inspect an .img file ===
 +kpartx lets you inspect an img file, showing its contained partitions using the -l command:
 +<​code>​
 +> kpartx -l /​opt/​xen/​X-Local-ISO/<​image_file_name>​.img
 +loop0p1 : 0 122880 /dev/loop0 8192
 +loop0p3 : 0 1536000 /dev/loop0 131072
 +loop deleted : /dev/loop0
 +</​code>​
 +----
 +
 +=== Add the partition mappings to the recognized devices in /​dev/​mapper/​ ===
 +<​code>​
 +> kpartx -av /​run/​sr-mount/​26b9d87b-f344-1c8d-c5c5-a155d4e4e2e0/​72e00fc6-98bb-48fe-ab4d-b52d1ef721b5.vhd
 +</​code>​
 +==== END ====
 +----
  
 ++++ X11 & VNC viewer | ++++ X11 & VNC viewer |