Clone bugs fixed
This commit is contained in:
parent
36c574b549
commit
0d046306c0
|
@ -1,4 +1,4 @@
|
||||||
vn-vmware (1.0.35) stable; urgency=low
|
vn-vmware (1.0.36) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
16
vn-vmware.pl
16
vn-vmware.pl
|
@ -742,6 +742,14 @@ sub clone_machine {
|
||||||
);
|
);
|
||||||
my $vm_clone = Vim::get_view(mo_ref => $vm_clone_ref);
|
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(
|
my $change_spec = VirtualMachineConfigSpec->new(
|
||||||
memoryMB => $memory,
|
memoryMB => $memory,
|
||||||
numCPUs => $num_cpus,
|
numCPUs => $num_cpus,
|
||||||
|
@ -751,14 +759,6 @@ sub clone_machine {
|
||||||
);
|
);
|
||||||
$vm_clone->ReconfigVM(spec => $change_spec);
|
$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) {
|
if ($poweron) {
|
||||||
log_message "Powering on '$dst_name'.";
|
log_message "Powering on '$dst_name'.";
|
||||||
$vm_clone->PowerOnVM();
|
$vm_clone->PowerOnVM();
|
||||||
|
|
Reference in New Issue