LinuxCommandLibrary

qm-template

Manage Proxmox VE VM/CT templates

TLDR

Create a template out of a specific virtual machine

$ qm [[tem|template]] [vm_id]
copy

SYNOPSIS

qm template <VMID>

PARAMETERS

<VMID>
    The numeric ID of the virtual machine or container that you wish to convert into a template. This ID must correspond to an existing, non-running VM or container.

DESCRIPTION

The qm template command, a subcommand of qm (Proxmox Virtual Machine command), is used to transform an existing virtual machine (VM) or container into a template. A template is a read-only, non-bootable snapshot of a VM or container, designed to serve as a base for creating new, identical instances quickly and efficiently. By converting a well-configured VM into a template, administrators can streamline the deployment process, ensuring consistency across new deployments and saving significant time compared to installing and configuring each new VM from scratch. Once converted, the original VMID is marked as a template and cannot be started directly; it must be cloned to create a runnable VM.

CAVEATS

Once a VM is converted into a template using qm template, it becomes read-only and cannot be started directly. To use the template, it must be cloned into a new virtual machine. There is no direct command to 'un-template' a VM; to revert, one must clone the template back into a standard VM. Ensure the VM is shut down before converting it to a template to avoid data inconsistencies.

TYPICAL WORKFLOW

A common use case involves creating a new VM, installing an operating system, applying necessary updates and software, and configuring it to a desired state. Once this 'master' VM is ready, it is shut down, and then the qm template command is executed with its VMID to convert it into a reusable template for future deployments. This ensures that all new VMs based on this template will inherit the pre-configured environment.

GUI EQUIVALENT

The functionality of qm template is also accessible via the Proxmox VE web interface. Users can select a VM or container from the tree view, navigate to 'More' (or similar context menu), and choose the 'Convert to Template' option. This performs the same operation as the command-line utility.

HISTORY

The ability to manage templates has been a fundamental feature of Proxmox VE since its early versions, reflecting the critical need for rapid and consistent VM deployment in virtualized environments. The qm template command specifically provides a straightforward CLI method for this core functionality, complementing the graphical user interface options for template creation.

SEE ALSO

qm(1), pct(1), pve-manager(8), qemu-img(1)

Copied to clipboard