Skip to content

Commit

Permalink
B #3134 Fix check poweroff status (#3262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel Luis Moya Gonzalez authored and Tino Vázquez committed Apr 25, 2019
1 parent 2aa4710 commit fb11877
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2526,17 +2526,19 @@ def migrate(config = {})
############################################################################

def shutdown
begin
if vm_tools?
@item.ShutdownGuest
else
poweroff_hard
if !is_powered_off?
begin
if vm_tools?
@item.ShutdownGuest
else
poweroff_hard
end
rescue RbVmomi::Fault => e
error = e.message.split(':').first
raise e.message if error != 'InvalidPowerState'
end
rescue RbVmomi::Fault => e
error = e.message.split(':').first
raise e.message if error != 'InvalidPowerState'
wait_timeout(:is_powered_off?)
end
wait_timeout(:is_powered_off?)
end

def destroy
Expand Down

0 comments on commit fb11877

Please sign in to comment.