cpu_allocation_ratio / ram_allocation_ratio options

The cpu_allocation_ratio option allows specifying what the ratio of virtual
CPUs to physical CPUs should be on a compute node.

The ram_allocation_ratio option allows specifying what the ratio of virtual ram
to to physical ram should be on a compute node.

Change-Id: I13e0015589c4435cf34ec57c0bfad38cddc41e44
This commit is contained in:
Marcus Furlong
2016-03-10 01:18:27 +11:00
parent 765111faaf
commit e4c3b0ff1c
2 changed files with 20 additions and 0 deletions

View File

@@ -113,6 +113,16 @@
# for virtual machine processes
# Defaults to $::os_service_default
#
# [*cpu_allocation_ratio*]
# (optional) Virtual CPU to physical CPU allocation ratio which
# affects all CPU filters.
# Defaults to $::os_service_default
#
# [*ram_allocation_ratio*]
# (optional) Virtual ram to physical ram allocation ratio which
# affects all ram filters.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*default_availability_zone*]
@@ -153,6 +163,8 @@ class nova::compute (
$config_drive_format = undef,
$allow_resize_to_same_host = false,
$vcpu_pin_set = $::os_service_default,
$cpu_allocation_ratio = $::os_service_default,
$ram_allocation_ratio = $::os_service_default,
# DEPRECATED PARAMETERS
$default_availability_zone = undef,
$default_schedule_zone = undef,
@@ -182,6 +194,8 @@ class nova::compute (
'DEFAULT/heal_instance_info_cache_interval': value => $heal_instance_info_cache_interval;
'DEFAULT/allow_resize_to_same_host': value => $allow_resize_to_same_host;
'DEFAULT/vcpu_pin_set': value => join(any2array($vcpu_pin_set), ',');
'DEFAULT/cpu_allocation_ratio': value => $cpu_allocation_ratio;
'DEFAULT/ram_allocation_ratio': value => $ram_allocation_ratio;
}
if ($vnc_enabled) {

View File

@@ -61,6 +61,8 @@ describe 'nova::compute' do
:pci_passthrough => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]",
:config_drive_format => 'vfat',
:vcpu_pin_set => ['4-12','^8','15'],
:cpu_allocation_ratio => '32.0',
:ram_allocation_ratio => '2.0',
}
end
@@ -109,6 +111,10 @@ describe 'nova::compute' do
it { is_expected.to contain_nova_config('DEFAULT/vcpu_pin_set').with(:value => '4-12,^8,15') }
it { is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with(:value => '32.0') }
it { is_expected.to contain_nova_config('DEFAULT/ram_allocation_ratio').with(:value => '2.0') }
it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_nova_config('DEFAULT/pci_passthrough_whitelist').with(
'value' => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]"