mirror of
https://github.com/puppetlabs/vmpooler-provider-ec2.git
synced 2026-01-26 02:28:40 -05:00
(POD-10) Log reason for failed VM checks.
This commit is contained in:
parent
99c288db9c
commit
58a06bfbfa
1 changed files with 3 additions and 2 deletions
|
|
@ -406,7 +406,7 @@ module Vmpooler
|
||||||
# check if a vm is ready by opening a socket on port 22
|
# check if a vm is ready by opening a socket on port 22
|
||||||
# if a domain is set, it will use vn_name.domain,
|
# if a domain is set, it will use vn_name.domain,
|
||||||
# if not then it will use the private dns name directly (AWS workaround)
|
# if not then it will use the private dns name directly (AWS workaround)
|
||||||
def vm_ready?(pool_name, vm_name)
|
def vm_ready?(pool_name, vm_name, redis)
|
||||||
begin
|
begin
|
||||||
domain_set = domain
|
domain_set = domain
|
||||||
if domain_set.nil?
|
if domain_set.nil?
|
||||||
|
|
@ -415,9 +415,10 @@ module Vmpooler
|
||||||
end
|
end
|
||||||
open_socket(vm_name, domain_set)
|
open_socket(vm_name, domain_set)
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
@logger.log('s', "[!] [#{pool_name}] '#{vm_name}' instance cannot be reached by vmpooler on tcp port 22; #{e}")
|
redis.hset("vmpooler__vm__#{vm_name}", 'open_socket_error', e.to_s)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
redis.hdel("vmpooler__vm__#{vm_name}", 'open_socket_error')
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue