From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 1B70A1FF187 for ; Mon, 14 Jul 2025 14:41:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6F61C17401; Mon, 14 Jul 2025 14:42:01 +0200 (CEST) From: Alexander Abraham To: pve-devel@lists.proxmox.com Date: Mon, 14 Jul 2025 14:41:51 +0200 Message-Id: <20250714124151.32786-1-a.abraham@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.803 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_ASCII_DIVIDERS 0.8 Email that uses ascii formatting dividers and possible spam tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URI_TRY_3LD 1 "Try it" URI, suspicious hostname Subject: [pve-devel] [PATCH pve-docs] fix #4717: Expanded the section on VM templates X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The documentation on VM templates has been expanded and explanations added about advantages/disadvantages, how they can be worked with and how to create them. Signed-off-by: Alexander Abraham --- qm.adoc | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/qm.adoc b/qm.adoc index 8b9e096..557cb1f 100644 --- a/qm.adoc +++ b/qm.adoc @@ -1749,8 +1749,83 @@ setting. Virtual Machine Templates ------------------------- -One can convert a VM into a Template. Such templates are read-only, -and you can use them to create linked clones. +Virtual machine templates are fully pre-configured operating +system images that can be used to deploy KVM-based virtual +machines. In some cases creating a special template is +preferrable over cloning another virtual machine. PVE streamlines +the process of using templates for deployment of a virtual machine +to such a degree that this process is very fast, easy, and if used +with linked clones, optimizes your storage by using base images +and thin-provisioning. Proxmox VE supported this functionality +since 2008 in the 3.x series. Additionally, templates for KVM-based +virtual machines can be created and deployed. + +Advantages and Disadvantages +---------------------------- + +Using virtual machine templates for deploying virtual machines makes it +possible to quickly deploy reproducible environments. The downside to +this is that if something has to be changed in the template, +re-deploying all virtual machines using this template may be a lengthy +process. + +Creating Virtual Machine Templates +---------------------------------- + +Proxmox VE's web-based UI offers an option inside the context +menu of a virtual machine to convert that virtual machine +into a template. The following steps outline measures to +be taken to create a template. + +- 1.) Create a VM with all drivers and install a system with all needed + software packages. +- 2.) Remove all user data and passwords. To do this on Windows, run + `sysprep`. To achieve the same result on Linux, run any tools that + do something similar. +- 3.) Right-click the VM and select "Convert to template". + +Once the virtual machine has been converted, it cannot be started +anymore. The icon in the web-based UI changes to symbolize this change. +To modify an existing template, the template will have to be deployed +and the steps outlined above must be repeated. + +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. You should remove all of +these pieces of data before you convert a virtual machine into a +template. On Linux systems you should remove SSH host keys, persistent +network MAC configuration, and user accounts and data. On Windows there +exist many tools to achieve this task, most notably `sysprep`. In a +testing environment it may be useful to use a fully-installed system as +a template. Listed below are some ways to achieve this on different +platforms. + +- GNU/Linux: + - Ubuntu: Install Ubuntu in OEM mode (F4 must be pressed). + - CentOS7: Most steps outlined here will also work for Proxmox VE. + +- Windows: Please follow Microsoft's full guide + https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/ee523217(v=ws.10)?redirectedfrom=MSDN[here]. + +Deploy a Virtual Machine from a Template +---------------------------------------- + +To deploy a virtual machine from a template, right-click the template +and select "Clone". This will deploy a virtual machine with the chosen +template. There are two types of deployments from a virtual machine +template: A full clone and a linked clone. + +A full-clone virtual machine is a complete copy and is fully independent +from the original virtual machine or resulting template, but it requires +the same disk space as the original. + +A linked-clone virtual machine requires less disk space but cannot run +without access to the base virtual machine template. Linked clones work +well with the following storage formats: Raw files, qcow2, vmdk (local +or on a network share), LVM-thin, ZFS, rbd, sheepdog, and nexenta. LVM +and ISCSI are not supported. NOTE: It is not possible to start templates, because this would modify the disk images. If you want to change the template, create a linked -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel