(QENG-2952) Check that SSH is available

SSH should be available before a VM is moved from the 'pending' queue to
'ready'.

`check_ssh` should probably be a function in the tradition of DRY; I'm
going to hopefully follow up this PR with a `Vmpooler::Utility` library.
This commit is contained in:
Scott Schneider 2015-09-17 11:11:12 -07:00
parent 0c1e89f047
commit 5b6985c3a7

View file

@ -31,6 +31,14 @@ module Vmpooler
host = $vsphere[pool].find_vm(vm) host = $vsphere[pool].find_vm(vm)
if host if host
begin
Timeout.timeout(5) do
TCPSocket.new vm, 22
end
rescue
fail_pending_vm(vm, pool, timeout)
end
move_pending_vm_to_ready(vm, pool, host) move_pending_vm_to_ready(vm, pool, host)
else else
fail_pending_vm(vm, pool, timeout) fail_pending_vm(vm, pool, timeout)