1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B OpenNebula/one#3134 Fix check poweroff status (#3262)

This commit is contained in:
Angel Luis Moya Gonzalez 2019-04-25 11:08:30 +02:00 committed by Tino Vázquez
parent 2aa4710713
commit fb11877d18

View File

@ -2526,17 +2526,19 @@ class VirtualMachine < VCenterDriver::Template
############################################################################
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