Testing VM Updates Before Deploying

ericz

New Member
Mar 21, 2024
12
1
3
I have a couple of VMs with a few terabytes of data on them. I'd like to test out updates to those VMs before deploying them on the live VM. Before today I thought I could use linked-clones. However, I've learned that Proxmox can only create a linked clone of a VM template. I realized that I could clone the entire VM, however, I'd like to avoid the time and space needed to copy all of the data.

What work flow do you use to test out VM updates before deploying them?
 
Hi @ericz , I believe the linked clone functionality is only available via Proxmox interface in conjunction with with Template.

The other workflow is to create a snapshot, deploy the update and rollback if things go bad. Not ideal.

You may be able to create a "manual" linked clone if your storage allows you to do so. I.e. may be you can create a thin clone, name it appropriately and attach to a test VM?


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Hello @bbgeek17, I agree with you that snapshots are a possible work around. However, we risk having to dump real live user data if we have to revert to the snapshot. As you said, not ideal.

We are using Ceph for our storage. I'll investigate your suggestion.
 
@ericz the workflow will be similar to below, adjusted for Ceph of course:

Create a snapshot of a VM:
Code:
qm snapshot 3001 snap1
snapshotting 'drive-scsi0' (bb-iscsi:vm-3001-disk-0)

Get a list of Snapshots on your backend storage:
Code:
bbpve bb-iscsi snapshot list -d bb-iscsi:vm-3001-disk-0/base
label [2]  serial               vss                                            disk [1]                    status
---------  -------------------  ---------------------------------------------  --------------------------  ------
snap1      SNP3D6D194C40626F18  bb-iscsi:vm-3001-disk-0 (VSS186D194C406FE4B9)  base (DSK196D194C402C62E4)  online

Perform preparatory steps required for disk creation on your storage:
Code:
bbpve bb-iscsi vss provision  -l bb-iscsi:vm-3005-disk-0 -c 32GiB
== Created vss: bb-iscsi:vm-3005-disk-0 (VSS186D194C406C6D55)

== VSS: bb-iscsi:vm-3005-disk-0 (VSS186D194C406C6D55)
label                 bb-iscsi:vm-3005-disk-0
serial                VSS186D194C406C6D55
uuid                  a2715dd3-9f8a-410c-9b94-73d3edc78389
created               2024-08-15 20:00:46 +0000
status                online
current time          2024-08-15T20:00+00:00

Create direct/manual thin clone on your storage:
Code:
bbpve bb-iscsi disk create clone -v bb-iscsi:vm-3005-disk-0 -l base --snapshot SNP3D6D194C40626F18
== Created clone base (DSK196D194C4033E9BF) from snapshot SNP3D6D194C40626F18 of base (DSK196D194C402C62E4)

== Virtual disk: base (DSK196D194C4033E9BF)
label                 base
serial                DSK196D194C4033E9BF
uuid                  c1ca67c6-a816-46eb-bc8c-471d2aa8c103
created               2024-08-15 20:03:16 +0000
status                pending (retrieving status; please wait)
vss                   bb-iscsi:vm-3005-disk-0 (VSS186D194C406C6D55)
protocol              iscsi
capacity              64.0GiB
encryption            aes128-xts
vault                 unlocked
tags                  -none-

== Basis
source                snap1 (SNP3D6D194C40626F18)
source vss            bb-iscsi:vm-3001-disk-0 (VSS186D194C406FE4B9)
protocol              block
locality              remote
mode                  read-copy


Finally, create a VM and import the disk:
Code:
 qm create 3005
 qm disk rescan --vmid 3005
rescan volumes...
VM 3005 add unreferenced volume 'bb-iscsi:vm-3005-disk-0' as 'unused0' to config


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
It looks like the process worked. I'm experimenting on a throwaway VM (140). I already had a snapshot that I made through the PVE web UI. I also had a new VM that was created but never started (VM 139). With that In place I needed to:

1) Protect the snapshot.
Code:
rbd snap protect  cephData1/vm-140-disk-0@v1

2) Create the clone
Code:
rbd clone cephData1/vm-140-disk-0@v1 cephData1/vm-139-disk-1

3) Add it to the new VM.
Code:
qm disk rescan --vmid 139

I attached the disk and adjusted the boot order in the web UI.

Thanks again @bbgeek17.
 
  • Like
Reactions: bbgeek17

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!