How to create a custom Windows SolusVM KVM template?
Prepare a source VPS from which template will be created.
SVM_WARN: The size of VPS has to be as small as possible as template size as well as the minimum disk size of future VPS created from this template depends on it.
As the final step in VPS preparation - execute in Windows command line:
C:\> chkdsk /f
and reboot VPS twice.
Shutdown the server in SolusVM > Virtual Servers > the necessary VPS (note its VMID, for example, kvm123):How to shutdown VPS and find its VMID:
Check partition table in the source VPS kvm123 to determine which partition should be resizable in the future - the necessary partition contains OS of the VPS/template:
# /scripts/kvmtemplate --mode=prescan --vmid=kvm123 --generation=2
Name Type VFS Label MBR Size Parent UUID
/dev/sda1 filesystem ntfs System Reserved - 350M - FABAA192BAA14BC7
/dev/sda2 filesystem ntfs - - 9.7G - 840AA3460AA33458
/dev/sda1 partition - - 07 350M /dev/sda -
/dev/sda2 partition - - 07 9.7G /dev/sda -
/dev/sda device - - - 10G - -
In most cases, the partition to resize is the biggest partition. In the example above the biggest partition is
/dev/sda2, so the partition to resize will be 2.
Note: Most versions of Windows Server require an administrator password to be set on the first login. This can make the creation of a template containing a datacenter license key difficult because of the necessity of the first login. Set a default administrator password and specify it in the Default root/admin password box when adding the template to SolusVM.
There are also other tools described on the Internet to prepare a Windows installation for cloning. For more information, you can search for "Windows sysprep"
SVM_WARN: SWAP is NOT used in Windows VPS.
Create the template:
# /scripts/kvmtemplate --mode=package --vmid=kvm123 --generation=2
the output of the command will contain the location of the created template:
# Template: /home/solusvm/kvm/template/template-149fee41d5801f96368c959a00dd6092a56ba031.gz
Rename the template:
# mv /home/solusvm/kvm/template/template-149fee41d5801f96368c959a00dd6092a56ba031.gz windows-2012-server-x86_64-custom.gz
SVM_WARN: template name has to start with "windows", as in the example - "windows-2012-server-x86_64-custom.gz".
Upload the created template to the Master server into the same template location:
SVM_WARN: Set the partition to resize from step 4.
Please sign in to leave a comment.