VM Templates and Clones: Difference between revisions
(page created) |
m (→Deploy a VM from a Template: fix some bad grammar and spelling) |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
= Introduction | == Introduction == | ||
A template is a fully pre-configured operating system image that can used to deploy KVM virtual machines. | A template is a fully pre-configured operating system image that can used to deploy KVM virtual machines. Creating a special template is usually preferred over [[Duplicate Virtual Machines|cloning an existing VM]]. | ||
Deploying virtual machines from templates is blazing fast, very comfortable and if you use linked clones you can optimize your storage by using base images and thin-provisioning. | Deploying virtual machines from templates is blazing fast, very comfortable and if you use linked clones you can optimize your storage by using base images and thin-provisioning. | ||
Line 6: | Line 6: | ||
Proxmox VE includes container based templates since 2008 and beginning with the V3.x series, additionally KVM templates can be created and deployed. | Proxmox VE includes container based templates since 2008 and beginning with the V3.x series, additionally KVM templates can be created and deployed. | ||
= Definitions | == Definitions == | ||
*'''VM '''- KVM based virtual machine | *'''VM '''- KVM based virtual machine | ||
Line 13: | Line 13: | ||
*'''Full Clone''' - A full clone VM is a complete copy and is fully independant to the original VM or VM Template, but requires the same disk space as the original. | *'''Full Clone''' - A full clone VM is a complete copy and is fully independant to the original VM or VM Template, but requires the same disk space as the original. | ||
= Create VM Template | == Create VM Template == | ||
Templates are created by converting a VM to a template. | Templates are created by converting a VM to a template. | ||
Line 25: | Line 25: | ||
As soon as the VM is converted, it cannot be started anymore and the icon changes. If you want to modify an existing template, you need to deploy a full clone from this template and do the steps above again. | As soon as the VM is converted, it cannot be started anymore and the icon changes. If you want to modify an existing template, you need to deploy a full clone from this template and do the steps above again. | ||
== OS specific notes for Templates | === OS specific notes for Templates === | ||
For productive usage it is highly recommended that a template does not include any data, user accounts or SSH keys so you should remove all before you convert the VM to a template. On Linux systems you should remove SSH host keys, persistent network MAC configuration and user accounts and user data. Windows offers a bunch of tools for this, e.g. sysprep. | |||
=== Linux | For testing purposes it may be useful to use a fully installed OS as a template. | ||
==== GNU/Linux ==== | |||
*Ubuntu: e.g. install with 'OEM mode' (press F4) | *Ubuntu: e.g. install with 'OEM mode' (press F4) | ||
=== Windows 7 | *CentOS7: Most steps in this [https://github.com/rharmonson/richtech/wiki/CentOS-7-1511-Minimal-oVirt-Template guide] are valid for PVE too. | ||
==== Windows 7 ==== | |||
*[http://technet.microsoft.com/en-us/library/ee523217(v=ws.10).aspx Building a Standard Image of Windows 7: Step-by-Step Guide] | *[http://technet.microsoft.com/en-us/library/ee523217(v=ws.10).aspx Building a Standard Image of Windows 7: Step-by-Step Guide] | ||
== | == Deploy a VM from a Template == | ||
Right-click the template, and select "Clone". | |||
= | === Full Clone === | ||
A full clone VM is a complete copy and is fully independent from the original VM or VM Template, but it requires the same disk space as the original. | |||
=== Linked Clone === | |||
A linked clone VM requires less disk space but cannot run without access to the base VM Template. | |||
Linked Clones works for theses storages: files in raw, qcow2, vmdk format (either on local storage or nfs); LVM-thin, ZFS, rbd, sheepdog, nexenta. | |||
It's not supported with LVM & ISCSI storage. | |||
= Video Tutorials | == Video Tutorials == | ||
tbd: [http://www.youtube.com/user/ProxmoxVE Proxmox VE Youtube channel] | tbd: [http://www.youtube.com/user/ProxmoxVE Proxmox VE Youtube channel] | ||
= Troubleshooting | == Troubleshooting == | ||
[[Category:HOWTO | [[Category:HOWTO]] |
Latest revision as of 14:40, 31 January 2018
Introduction
A template is a fully pre-configured operating system image that can used to deploy KVM virtual machines. Creating a special template is usually preferred over cloning an existing VM.
Deploying virtual machines from templates is blazing fast, very comfortable and if you use linked clones you can optimize your storage by using base images and thin-provisioning.
Proxmox VE includes container based templates since 2008 and beginning with the V3.x series, additionally KVM templates can be created and deployed.
Definitions
- VM - KVM based virtual machine
- Templates - Templates are pre-configured operating system environments that deploy in a couple of clicks
- Linked Clone - A linked clone VM requires less disk space but cannot run without access to the base VM Template
- Full Clone - A full clone VM is a complete copy and is fully independant to the original VM or VM Template, but requires the same disk space as the original.
Create VM Template
Templates are created by converting a VM to a template.
- Install your VM with all drivers and needed software packages
- Remove all user data, passwords and keys - In order to do this run sysprep on Windows or similar tools or scripts on Linux and just power-off the VM.
- Right-click the VM and select "Convert to template"
Note
As soon as the VM is converted, it cannot be started anymore and the icon changes. If you want to modify an existing template, you need to deploy a full clone from this template and do the steps above again.
OS specific notes for Templates
For productive usage it is highly recommended that a template does not include any data, user accounts or SSH keys so you should remove all before you convert the VM to a template. On Linux systems you should remove SSH host keys, persistent network MAC configuration and user accounts and user data. Windows offers a bunch of tools for this, e.g. sysprep.
For testing purposes it may be useful to use a fully installed OS as a template.
GNU/Linux
- Ubuntu: e.g. install with 'OEM mode' (press F4)
- CentOS7: Most steps in this guide are valid for PVE too.
Windows 7
Deploy a VM from a Template
Right-click the template, and select "Clone".
Full Clone
A full clone VM is a complete copy and is fully independent from the original VM or VM Template, but it requires the same disk space as the original.
Linked Clone
A linked clone VM requires less disk space but cannot run without access to the base VM Template.
Linked Clones works for theses storages: files in raw, qcow2, vmdk format (either on local storage or nfs); LVM-thin, ZFS, rbd, sheepdog, nexenta.
It's not supported with LVM & ISCSI storage.
Video Tutorials
tbd: Proxmox VE Youtube channel