Add iops fact and add it to astute

Astute needs to know how many nodes can
be provisioned at a time, based on IOPS.

Change-Id: If2cf35ac8195baf37cda50564b70ba3db836ccea
Partial-Bug: #1355347
This commit is contained in:
Matthew Mosesohn 2014-08-13 19:04:14 +04:00
parent b0951014f4
commit 26b55bc341
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,15 @@
require 'facter'
# Requires sysstat package on Ubuntu and CentOS
# Fact iops totals tps values from iostat
Facter.add('iops') do
confine :kernel => :linux
str = Facter::Util::Resolution.exec("iostat | grep -v 'dm-'" \
" | awk '{print $2}'")
iops = 0
str.split("\n").each do |iops_val|
iops = iops + iops_val.to_f
end
setcode { iops }
end

View File

@ -5,5 +5,6 @@ broker_password: '<%= @rabbitmq_astute_password %>'
broker_queue: 'naily'
broker_publisher_queue: 'nailgun'
broker_exchange: 'nailgun'
iops: <%= @iops %>
#reboot_timeout: 120 # Wait for reboot request
#provisioning_timeout: 5400 # Timeout for target nodes to install OS