Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not attaching the correct quantity of subscription entitlements because facts are not available #69

Open
DoGab opened this issue Oct 4, 2019 · 0 comments · May be fixed by #70
Open

Comments

@DoGab
Copy link

DoGab commented Oct 4, 2019

Problem

KAS is not able to assign the correct quantity of subscription entitlements. For example if a host has 4 CPU Sockets it would require 2 subscription entitlements to be full entitled and perform correctly.

Cause

It does not work correctly because the hosts facts are not exported when performing this api call.

sys = @api.resource(:hosts).call(:show, {:id => system['id'], :fields => 'full'})
...

# if the number of socket is setted, we can find the value from cpu::cpu_socket(s)
if sys.has_key?("facts") and sys["facts"].is_a?(Hash) and sys["facts"].has_key?("cpu::cpu_socket(s)")
  # if the field is present check if it's a valid entry or not, if not exit with error
  if sys["facts"]["cpu::cpu_socket(s)"].to_i > 0
    # set sys_socket to the value of cpu::cpu_socket(s)
    sys_socket = sys["facts"]["cpu::cpu_socket(s)"].to_i
    if @options[:debug]
      puts "   DEBUG: Setting sys_socket to #{sys_socket} for #{sys["name"]}"
    end
  else
    puts "   FATAL ERROR: The number of socket for #{sys["name"]} it's equal or lower then 0."
    exit 5
  end
else
  sys_socket = 1
  if @options[:debug]
    puts "   DEBUG: No cpu sockets entry found for #{sys['name']}, assigned 1 by default"
  end
end

Because KAS does only search for facts in the sys variable the quantity of needed subscription entitlement, which is based on how many CPU sockets a host has, can't be correctly calculated and attached.

@DoGab DoGab linked a pull request Oct 4, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant