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
hypervisor:toolstack:domu [2014/06/04 18:03]
admin [Creating a PV VM from Template]
hypervisor:toolstack:domu [2015/03/06 23:50] (current)
66.249.67.85 Links adapted because of a move operation
Line 2: Line 2:
  
 <WRAP center round info 90%> <WRAP center round info 90%>
-Note that prior to installing a Virtual Machine, you'll need to **[[storage-repository|setup your storage repositories]]**.+Note that prior to installing a Virtual Machine, you'll need to **[[hypervisor:​base:​storage|setup your storage repositories]]**.
 </​WRAP>​ </​WRAP>​
  
Line 42: Line 42:
 VDI stands for **Virtual Disk Image**, such an image is required by the VM that will use it as if it was a real hard drive. This VDI has to be stored somewhere, here we'll select an SR that was specifically created for the LMDE VM. VDI stands for **Virtual Disk Image**, such an image is required by the VM that will use it as if it was a real hard drive. This VDI has to be stored somewhere, here we'll select an SR that was specifically created for the LMDE VM.
  
-Refer to the [[storage-repository#Create a Storage Repository|Storage Repositories Creation]] chapter to remember how to do it, in case you often forget (like me).+Refer to the [[hypervisor:​base:​storage#​Create a Storage Repository|Storage Repositories Creation]] chapter to remember how to do it, in case you often forget (like me).
  
 Get the SR UUID: Get the SR UUID:
Line 164: Line 164:
  
 <WRAP center important 90%> <WRAP center important 90%>
-Once logged into the VM's console, you'll be "​trapped"​ inside this console. ​It won't be possible for you to come back to the host's console.+Once logged into the VM's console, you may get "​trapped"​ inside this console. ​In case there is no "​exit"​ possible, it won't be possible for you to come back to the host's console.
  
 This might be a problem when interacting from a plain terminal screen on the host itself, getting locked out of your host's console might force you to force a reboot in case you cannot access it via ssh from another machine to reboot it nicely!. This might be a problem when interacting from a plain terminal screen on the host itself, getting locked out of your host's console might force you to force a reboot in case you cannot access it via ssh from another machine to reboot it nicely!.
Line 237: Line 237:
 ==== Templated VM Specific Operations ==== ==== Templated VM Specific Operations ====
 ---- ----
-From: [[http://​wiki.xen.org/​wiki/​XCP_PV_templates_start]]+From: [[http://​wiki.xen.org/​wiki/​XCP_PV_templates_start]]:\\
 Eliloader is python script located in /​usr/​bin/​eliloader. It allows XCP to download network installation images (kernel and overgrown initrd) for specified operating system (actual network image is really differ in suse, centos and debian systems). For some legacy and antique systems (like RHEL 4) it to some patching of initrd. Exact path is constructed from type of template (install-distro in other-config) and url, provided by used in other-config:​ install-repository). After initrd and kernel is extracted they are used as kernel and initrd for virtual machine (and installation started). Eliloader is python script located in /​usr/​bin/​eliloader. It allows XCP to download network installation images (kernel and overgrown initrd) for specified operating system (actual network image is really differ in suse, centos and debian systems). For some legacy and antique systems (like RHEL 4) it to some patching of initrd. Exact path is constructed from type of template (install-distro in other-config) and url, provided by used in other-config:​ install-repository). After initrd and kernel is extracted they are used as kernel and initrd for virtual machine (and installation started).
  
-Right after successful VM start PV-bootloader is replaced from eliloader to pygrub (to boot to new VM native kernel). Of course, if user stops installation process, at next startup there will be no kernel and vm will not start again. ​+Right after successful VM start PV-bootloader is replaced from eliloader to pygrub (to boot to new VM native kernel). Of course, if user stops installation process, at next startup there will be no kernel and vm will not start again. 
 + 
 +<​code>​ 
 +> xe vm-param-set uuid=44c68930-1192-a196-b460-5f411a689c85 PV-bootloader= 
 +> xe vm-param-set uuid=44c68930-1192-a196-b460-5f411a689c85 PV-kernel=/​root/​PVs/​debian-wheezy/​vmlinuz 
 +> xe vm-param-set uuid=44c68930-1192-a196-b460-5f411a689c85 PV-ramdisk=/​root/​PVs/​debian-wheezy/​initrd.gz 
 +> xe vm-start uuid=44c68930-1192-a196-b460-5f411a689c85 
 +</​code>​ 
 + 
 +To follow the installation process: 
 +<​code>​ 
 +> xe vm-param-get uuid=44c68930-1192-a196-b460-5f411a689c85 param-name=dom-id 
 +
 +> screen -S Wheezy 
 +> /​usr/​lib/​xen-4.1/​bin/​xenconsole 4 
 +</​code>​ 
 + 
 +After initial installation:​ 
 +<​code>​ 
 +> xe vm-param-set uuid=... PV-bootloader=pygrub 
 +</​code>​ 
 + 
 +=== Add Xen Tools === 
 +<color coral>​**TBC**</​color>​ 
 +---- 
 +===== Create Template and Appliance ===== 
 +---- 
 +Reference: [[http://​www.jansipke.nl/​creating-backups-of-running-vms-in-xenserver/​]] 
 + 
 +It seems that this operation can be performed even on a running VM. 
 + 
 +Pick target VM uuid: 
 +<​code>​ 
 +> xe vm-list is-control-domain=false is-a-snapshot=false 
 +</​code>​ 
 + 
 +Create the snapshot: 
 +<​code>​ 
 +> xe vm-snapshot uuid=<​vm-uuid>​ new-name-label=<​snapshotname>​ 
 +<​snapshot-uuid>​ 
 +</​code>​ 
 + 
 +Transform the snapshot into a VM to be able to save it to a file: 
 +<​code>​ 
 +> xe template-param-set is-a-template=false ha-always-run=false uuid=<​snapshot-uuid>​ 
 +> xe vm-export vm=<​snapshot-uuid>​ filename=<​filename>​.xva 
 +Export succeeded 
 +</​code>​ 
 +The export operation can take a while... Be patient until you see the "​Export succeeded"​ message. 
 + 
 +Finally let's get rid of the snapshot: 
 +<​code>​ 
 +> xe vm-uninstall uuid=<​snapshot-uuid>​ force=true 
 +</​code>​ 
 + 
 +----
 ===== Using Xen Orchestra ===== ===== Using Xen Orchestra =====
 ---- ----