From 7e8b47b4ebc7cecead3bb91a2788218a7e9a4145 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 10 Jan 2022 10:48:28 +0100 Subject: [PATCH] Error logging fixes --- debian/changelog | 2 +- vn-vmware.pl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8a527ae..568e677 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -vn-vmware (1.1.30) stable; urgency=low +vn-vmware (1.1.31) stable; urgency=low * Initial Release. diff --git a/vn-vmware.pl b/vn-vmware.pl index 888eb4b..0879e7c 100755 --- a/vn-vmware.pl +++ b/vn-vmware.pl @@ -1026,6 +1026,10 @@ sub clone_machine { view_type => 'HostSystem', filter => {'name' => $dst_host} ); + + unless ($host_view) { + die "Host '$dst_host' not found in cluster."; + } } my $comp_res_view = Vim::get_view(mo_ref => $host_view->parent); @@ -1036,6 +1040,11 @@ sub clone_machine { filter => {'name' => $dst_datastore}, properties => ['name'] ); + + unless ($ds_new) { + die "Datastore '$dst_datastore' not found."; + } + $relocate_spec = VirtualMachineRelocateSpec->new( pool => $comp_res_view->resourcePool, host => $host_view,