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:
parent
2aa4710713
commit
fb11877d18
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user