Xen HVM Templates

From SolusVM

Jump to: navigation, search

Contents

Overview

Version 1.2.11 and above now allows the use of Xen HVM templates.

Current list of supported templates:

  • Windows 7
  • Windows Server 2008 R2
  • Windows Server 2008
  • Windows Server 2003 R2
  • Windows Server 2003
  • Windows Vista
  • Windows 2000
  • Windows XP

Creating a template

To create a template you must first install a virtual server with any of the above supported operating systems from iso.

When installing, you must strictly stick to the following rules:

  • The operating system must only have 1 partition
  • Make the filesystem as small as possible
  • The operating system must be shutdown cleanly before creating the template
  • For windows 7 and Windows 2008 R2 please read this to remove the special reserved partition: http://l.soluslabs.co/1

A script has been supplied to aid in the creation of Xen HVM templates. The script location is /scripts/create-template

To create a template run the following:

/scripts/create-template

You will then be presented with a menu, Choose an option:

SolusVM HVM Template Creator v1      | ctrl+c to quit
=====================================================

Choose an operating system type/version:

  1) Windows 7              2) Windows Server 2008 R2
  3) Windows Server 2008    4) Windows Server 2003 R2
  5) Windows Server 2003    6) Windows Vista
  7) Windows 2000           8) Windows XP
Choice:

On the next screen you need to select the LV location of the virtual server that you want to create the template from:

SolusVM HVM Template Creator v1      | ctrl+c to quit
=====================================================
Template Type.........: Windows 7
=====================================================

Enter the path to the source logical volume

   Available paths:

      /dev/vps/vm117_img
      /dev/vps/vm118_img
      /dev/vps/vm119_img
      /dev/vps/vm120_img

Path:

Specify the path and press enter.

The next screen will ask you for a filename:

SolusVM HVM Template Creator v1      | ctrl+c to quit
=====================================================
Template Type.........: Windows 7
Template Source.......: /dev/vps/vm119_img
=====================================================

Enter a name for the template. Just press enter for defaults.

Filename: windows-7- 

The script will create the important part of the filename. An example filename would be:

windows-7-standard

On the next screen you will be presented with an overview of the settings:

SolusVM HVM Template Creator v1      | ctrl+c to quit
=====================================================
Template Type.........: Windows 7
Template Source.......: /dev/vps/vm119_img
Template Source LV....: vm119_img
Template Filename.....: windows-7-standard.tar.gz
Template Destination..: /home/solusvm/tmp/
=====================================================

All the information has been collected and we are ready to proceed.

All output from the creation process will be displayed below

 *Hit enter to start*

Just hit enter to start or ctrl+c to exit.

CREATING MBR IMAGE...

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000263 seconds, 1.9 MB/s

MAPPING PARTITIONS...


CREATING FILESYSTEM IMAGE...

ntfsclone v1.13.1 (libntfs 9:0:0)
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 5354622976 bytes (5355 MB)
Current device size: 10733958144 bytes (10734 MB)
Scanning volume ...
100.00 percent completed
Accounting clusters ...
Space in use       : 2932 MB (54.8%)
Saving NTFS to image ...
100.00 percent completed
Syncing ...

UNMAPPING PARTITIONS...


CREATING ARCHIVE...

windows-7-standard/
windows-7-standard/windows-7-standard.img
windows-7-standard/windows-7-standard.mbr

CLEANING UP...


COMPLETE...


Template location: /home/solusvm/tmp/windows-7-standard.tar.gz

Once the template has been create it can be sent to the master to be used within the iso sync function or it can be maually added to the slave.

To manually add the template (example for the template we just created):

On the slave:

tar xzf /home/solusvm/tmp/windows-7-standard.tar.gz -C /home/solusvm/xen/hvmtemplate/

On the master:

touch /home/solusvm/xen/hvmtemplate/windows-7-standard.tar.gz

Debugging

A log will be written on each build/rebuild of a template based virtual server. The log location is: /usr/local/solusvm/log/vm<ID>/build.log

Know Bugs

  • Windows 7, Server 2008 r2 and Server 2008 filesystem won't resize properly.
  • DeFragging the VPS has been known to cause issues with the MBR and thus the VPS will NOT template correctly.
Personal tools
Installation/Upgrading
Customization