mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
More pooler queue logic
This commit is contained in:
parent
4faabb9842
commit
4534310d94
1 changed files with 17 additions and 13 deletions
|
|
@ -69,13 +69,24 @@ loop do
|
|||
if (
|
||||
(vsphere_helper.find_vms(vm)[vm]) and
|
||||
(vsphere_helper.find_vms(vm)[vm].summary.guest.toolsRunningStatus == 'guestToolsRunning') and
|
||||
(vsphere_helper.find_vms(vm)[vm].summary.guest.hostName) and
|
||||
(vsphere_helper.find_vms(vm)[vm].summary.guest.hostName == vm) and
|
||||
(vsphere_helper.find_vms(vm)[vm].summary.guest.ipAddress != nil)
|
||||
)
|
||||
if (vsphere_helper.find_vms(vm)[vm].summary.guest.hostName)
|
||||
if (vsphere_helper.find_vms(vm)[vm].summary.guest.hostName == vm)
|
||||
begin
|
||||
Socket.getaddrinfo(vm, nil)
|
||||
rescue
|
||||
if (
|
||||
(vsphere_helper.find_vms(vm)[vm].runtime) and
|
||||
(vsphere_helper.find_vms(vm)[vm].runtime.bootTime) and
|
||||
(((( Time.now - vsphere_helper.find_mvs(vm)[vm].runtime.bootTime ) / 60 ) / 60 ) >= 1)
|
||||
)
|
||||
$redis.srem('vmware_host_pool__pending__'+pool['name'], vm)
|
||||
$redis.sadd('vmware_host_pool__failed__'+pool['name'], vm)
|
||||
|
||||
logger.log('s', "[<] '#{vm}' moved to 'failed' queue")
|
||||
end
|
||||
|
||||
next
|
||||
end
|
||||
|
||||
|
|
@ -83,13 +94,6 @@ loop do
|
|||
$redis.srem('vmware_host_pool__pending__'+pool['name'], vm)
|
||||
|
||||
logger.log('s', "[>] '#{vm}' moved to 'ready' queue")
|
||||
else
|
||||
$redis.srem('vmware_host_pool__pending__'+pool['name'], vm)
|
||||
$redis.sadd('vmware_host_pool__failed__'+pool['name'], vm)
|
||||
|
||||
logger.log('s', "[<] '#{vm}' moved to 'failed' queue")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue