Skip to content

Commit

Permalink
Override number_of_cpus_for_request
Browse files Browse the repository at this point in the history
PowerVS uses the more typical Flavor style of cpu allocation for SAP
profiles. For non SAP profiles, the Flavor only set the host type and
the user is allowed to request any number of cpus using the
entitled_processors form option.
  • Loading branch information
jaywcarman committed Aug 24, 2023
1 parent 77654e7 commit f50c21b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ def raw_delete_image
_log.error("image=[#{name}], error: #{e}")
end

def number_of_cpus_for_request(request)
flavor_obj = Flavor.find(request.get_option(:instance_type))
if flavor_obj <= SAPProfile
flavor_obj.try(:cpus)
else
request.options[:entitled_processors].to_f.ceil
end
end

def self.raw_import_image(ext_management_system, options = {})
session_id = SecureRandom.uuid
wrkfl_timeout = options['timeout'].to_i.hours
Expand Down

0 comments on commit f50c21b

Please sign in to comment.