mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
(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:
parent
0c1e89f047
commit
5b6985c3a7
1 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,14 @@ module Vmpooler
|
|||
host = $vsphere[pool].find_vm(vm)
|
||||
|
||||
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)
|
||||
else
|
||||
fail_pending_vm(vm, pool, timeout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue