mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Resolved bug vm state
This commit is contained in:
parent
a3f8a05228
commit
32c7df8d03
@ -66,6 +66,9 @@ begin
|
||||
|
||||
vm.reconfigure
|
||||
vm.poweron
|
||||
|
||||
wait_deploy_timeout(vm)
|
||||
|
||||
vm.set_running(true)
|
||||
|
||||
vm.one_item.update("VCENTER_ESX_HOST = #{vm['runtime.host.name']}", true)
|
||||
|
@ -93,3 +93,15 @@ def check_item(item, target_class)
|
||||
raise "Reference \"#{item._ref}\" error. The reference does not exist"
|
||||
end
|
||||
end
|
||||
|
||||
def wait_deploy_timeout(vm, timeout_deploy = 300)
|
||||
time_start = Time.now
|
||||
begin
|
||||
time_running = Time.now - time_start
|
||||
if time_running.to_i >= timeout_deploy
|
||||
raise "reached deploy timeout"
|
||||
end
|
||||
sleep(2)
|
||||
state = vm.item.summary.runtime.powerState
|
||||
end until(state == "poweredOn")
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user