Discussion:
[pve-devel] [PATCH qemu-server] clone_disk : cloudinit drive: don't clone snapname
Alexandre Derumier
2018-12-07 06:45:55 UTC
Permalink
we don't snapshot cloudinit drive,

this fix "qm clone <vmid> <targetvmid> --snapname mysnap" when a cloudinit drive exist
---
PVE/QemuServer.pm | 1 +
1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a162db9..1e9dec6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6655,6 +6655,7 @@ sub clone_disk {
my $name = undef;
if (drive_is_cloudinit($drive)) {
$name = "vm-$newvmid-cloudinit";
+ $snapname = undef;
# cloudinit only supports raw and qcow2 atm:
if ($dst_format eq 'qcow2') {
$name .= '.qcow2';
--
2.11.0
Wolfgang Bumiller
2018-12-11 08:56:09 UTC
Permalink
applied

Interestingly we check whether to do a full or linked clone for
cloudinit drives in the clone_vm api code. I wonder if we should move
that into this function as well (or move this out to clone_vm - but that
would probably be less convenient?)
Post by Alexandre Derumier
we don't snapshot cloudinit drive,
this fix "qm clone <vmid> <targetvmid> --snapname mysnap" when a cloudinit drive exist
---
PVE/QemuServer.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a162db9..1e9dec6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6655,6 +6655,7 @@ sub clone_disk {
my $name = undef;
if (drive_is_cloudinit($drive)) {
$name = "vm-$newvmid-cloudinit";
+ $snapname = undef;
if ($dst_format eq 'qcow2') {
$name .= '.qcow2';
--
2.11.0
Loading...