Clone bugs fixed

This commit is contained in:
Juan 2018-11-12 23:14:04 +01:00
parent 36c574b549
commit 0d046306c0
2 changed files with 9 additions and 9 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
vn-vmware (1.0.35) stable; urgency=low
vn-vmware (1.0.36) stable; urgency=low
* Initial Release.

View File

@ -741,6 +741,14 @@ sub clone_machine {
spec => $clone_spec
);
my $vm_clone = Vim::get_view(mo_ref => $vm_clone_ref);
if ($original_vm && $overwrite) {
log_message "Deleting machine '$dst_name'.";
$original_vm->Destroy();
log_message "Renaming '$dst_tmp_name' to '$dst_name'.";
$vm_clone->Rename(newName => $dst_name);
}
my $change_spec = VirtualMachineConfigSpec->new(
memoryMB => $memory,
@ -750,14 +758,6 @@ sub clone_machine {
extraConfig => [$extra_conf]
);
$vm_clone->ReconfigVM(spec => $change_spec);
if ($original_vm && $overwrite) {
log_message "Deleting machine '$dst_name'.";
$original_vm->Destroy();
log_message "Renaming '$dst_tmp_name' to '$dst_name'.";
$vm_clone->Rename(newName => $dst_name);
}
if ($poweron) {
log_message "Powering on '$dst_name'.";