diff --git a/debian/changelog b/debian/changelog index f0761fa..7b91afb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -vn-vmware (1.0.35) stable; urgency=low +vn-vmware (1.0.36) stable; urgency=low * Initial Release. diff --git a/vn-vmware.pl b/vn-vmware.pl index d332204..27bc1d9 100755 --- a/vn-vmware.pl +++ b/vn-vmware.pl @@ -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'.";