diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 2f0b2e8e..25282b73 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3782,6 +3782,11 @@ sub config_to_command { print "activating and using '$vmstate' as vmstate\n"; } + if (PVE::QemuConfig->is_template($conf)) { + # needed to workaround base volumes being read-only + push @$cmd, '-snapshot'; + } + # add custom args if ($conf->{args}) { my $aa = PVE::Tools::split_args($conf->{args}); diff --git a/test/cfg2cmd/efi-raw-template.conf.cmd b/test/cfg2cmd/efi-raw-template.conf.cmd index 636f03ed..d99862b4 100644 --- a/test/cfg2cmd/efi-raw-template.conf.cmd +++ b/test/cfg2cmd/efi-raw-template.conf.cmd @@ -24,4 +24,5 @@ -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \ - -machine 'type=pc+pve0' + -machine 'type=pc+pve0' \ + -snapshot diff --git a/test/cfg2cmd/simple1-template.conf.cmd b/test/cfg2cmd/simple1-template.conf.cmd index 20a6dcf4..7fb6fd12 100644 --- a/test/cfg2cmd/simple1-template.conf.cmd +++ b/test/cfg2cmd/simple1-template.conf.cmd @@ -33,4 +33,5 @@ -device 'ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0' -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \ - -machine 'type=pc' + -machine 'type=pc' \ + -snapshot