Clone Virtual Machine

For Clone a Virtual Machine with proxmox the command to use is

qm clone <vmid> <newid> [OPTIONS]

Create a copy of virtual machine/template.

<vmid>: <integer> (100 - 999999999)
The (unique) ID of the VM.

<newid>: <integer> (100 - 999999999)
VMID for the clone.

--bwlimit <integer> (0 - N) (default = clone limit from datacenter or storage config)
Override I/O bandwidth limit (in KiB/s).

--description <string>
Description for the new VM.

--format <qcow2 | raw | vmdk>
Target format for file storage. Only valid for full clone.

--full <boolean>
Create a full copy of all disks. This is always done when you clone a normal VM. For VM templates, we try to create a linked clone by default.

--name <string>
Set a name for the new VM.

--pool <string>
Add the new VM to the specified pool.

--snapname <string>
The name of the snapshot.

--storage <string>
Target storage for full clone.

--target <string>
Target node. Only allowed if the original VM is on shared storage.
See the configuration of a previos create machine
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
ambagasdowa@Kalacmul:~$ sudo qm config 9007
agent: 1
bios: seabios
boot: order=virtio0;ide2
cores: 2
cpu: host
ide2: st-1001:iso/debian-12.1.0-amd64-netinst.iso,media=cdrom,size=627M
machine: q35
memory: 2048
meta: creation-qemu=7.2.0,ctime=1691201310
name: Debian12
net0: virtio=EE:33:7B:39:EF:FE,bridge=vmbr0
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=000cb0e8-7725-4588-a975-33d35777d68a
sockets: 1
vga: virtio-gl,memory=128
virtio0: st-1001:9007/vm-9007-disk-0.qcow2,cache=writethrough,iothread=1,size=32G
vmgenid: 8cc458a6-0f37-488b-b25a-de3b8894c43e

For list the current storages in the Hypervisor

List current available Storage Pools
ambagasdowa@Kalacmul:~$ sudo pvesm status
Name           Type     Status           Total            Used       Available        %
local           dir   disabled               0               0               0      N/A
st-1001         dir     active      1952559676       753599868      1198959808   38.60%
st-1002         dir     active       976283900         6839904       969443996    0.70%
VM Clone command example
sudo qm clone 9007 9008 --description "Mkforms lab machine" --name "College" --storage st-1001

cloneA
Clone proccess

cloneB
End Clone proccess

cloneC
List the Virtual Machines

Check the VM storage

ambagasdowa@Kalacmul:~$ sudo pvesm list st-1001 --vmid 9008
Volid                             Format  Type             Size VMID
st-1001:9008/vm-9008-disk-0.qcow2 qcow2   images    34359738368 9008

Update CD-ROM

sudo qm set 9011 --cdrom st-1001:iso/W_7_GLOBALTOP_x32x64.iso

Last update: Nov 20, 2024