I tried a few things but I can't get code to wait for the Guest OS to shutdown. Any ideas?
That should do it:
do{ my $temp_vms = Vim::find_entity_view(view_type => 'VirtualMachine', filter => {'name' => 'servername' }); if($temp_vms->runtime->powerState->val ne 'poweredOff'){ sleep 5; }else{ $sd=1; } }while($sd != 1);
-Stefan
I put that in a while loop and it still doesn't work....
Sorry was a bit fast with the code, I updated it to include a loop.
If you still aren't getting any right state, you can try to do some output with each loop:
print $temp_vms->runtime->powerState."\n";
Are you sure there isn't any question pending?