Skip to content

Commit

Permalink
Merge pull request #147 from jaywcarman/add_cpu_cores_columns_to_reso…
Browse files Browse the repository at this point in the history
…urce_pools

Use new resource pool cpu_core_* columns
  • Loading branch information
agrare committed Oct 25, 2023
2 parents 8713488 + abe0ab7 commit b5bf4c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,17 +648,17 @@ def parse_cpu_resource_pools
:type => ManageIQ::Providers::IbmPowerHmc::InfraManager::ProcessorResourcePool.name
}
if pool.name == "DefaultPool"
params[:cpu_shares] = 0
params[:cpu_reserve] = 0
params[:cpu_reserve_expand] = false
params[:cpu_limit] = -1
params[:is_default] = true
params[:cpu_cores_reserve] = 0
params[:cpu_reserve_expand] = false
params[:cpu_cores_limit] = -1
params[:cpu_cores_available] = nil
params[:is_default] = true
else
params[:cpu_shares] = pool.max.to_f - pool.available.to_f
params[:cpu_reserve] = pool.available
params[:cpu_reserve_expand] = true
params[:cpu_limit] = pool.max
params[:is_default] = false
params[:cpu_cores_reserve] = pool.reserved
params[:cpu_reserve_expand] = true
params[:cpu_cores_limit] = pool.max
params[:cpu_cores_available] = pool.available
params[:is_default] = false
end

persister.resource_pools.build(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,16 @@ def assert_specific_template
def assert_specific_resource_pool_cpu
cpu_pool = ems.resource_pools.find_by(:ems_ref => respool_cpu_uuid)
expect(cpu_pool).to have_attributes(
:type => "ManageIQ::Providers::IbmPowerHmc::InfraManager::ProcessorResourcePool"
:type => "ManageIQ::Providers::IbmPowerHmc::InfraManager::ProcessorResourcePool",
:name => "sloane",
:cpu_shares => nil,
:cpu_reserve => nil,
:cpu_limit => nil,
:cpu_reserve_expand => true,
:is_default => false,
:cpu_cores_available => 2.0,
:cpu_cores_reserve => 0,
:cpu_cores_limit => 2.0
)
end

Expand Down

0 comments on commit b5bf4c1

Please sign in to comment.