fix #1749: do not copy pending changes when cloning a vm

cloning a vm means copying the current state, not the
state of 'some time in the future, when the vm is started again'
we should not copy the pending changes, which also fixes the
issue that we got a wrong pending change on the disks,net,smbios,etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-05-02 11:23:59 +02:00 committed by Thomas Lamprecht
parent d705271e3a
commit 68e46b8452

View File

@ -2723,6 +2723,13 @@ __PACKAGE__->register_method({
}
delete $newconf->{lock};
# do not write pending changes
if ($newconf->{pending}) {
warn "found pending changes, discarding for clone\n";
delete $newconf->{pending};
}
PVE::QemuConfig->write_config($newid, $newconf);
if ($target) {