Support new max_ram_per_tenant quota option

Change-Id: If77f2123174f7d55530c181350c5517dcf084b9b
This commit is contained in:
Sam Morrison 2020-12-07 16:17:52 +11:00
parent 2bbf23cbf6
commit 67d06ede87
3 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,10 @@
# (optional) Default maximum number of instances per tenant.
# Defaults to 5.
#
# [*max_ram_per_tenant*]
# (optional) Default maximum amount of RAM (in MB) per tenant.
# Defaults to -1.
#
# [*max_accepted_volume_size*]
# (optional) Default maximum volume size (in GB) for an instance.
# Defaults to 5.
@ -27,6 +31,7 @@
#
class trove::quota (
$max_instances_per_tenant = 5,
$max_ram_per_tenant = -1,
$max_accepted_volume_size = 5,
$max_volumes_per_tenant = 20,
$max_backups_per_tenant = 50,
@ -37,6 +42,7 @@ class trove::quota (
trove_config {
'DEFAULT/max_instances_per_tenant': value => $max_instances_per_tenant;
'DEFAULT/max_ram_per_tenant': value => $max_ram_per_tenant;
'DEFAULT/max_accepted_volume_size': value => $max_accepted_volume_size;
'DEFAULT/max_volumes_per_tenant': value => $max_volumes_per_tenant;
'DEFAULT/max_backups_per_tenant': value => $max_backups_per_tenant;

View File

@ -0,0 +1,5 @@
---
features:
- |
Support new `max_ram_per_tenant` quota option. Specified in MB, the default
is -1 (unlimited)

View File

@ -7,6 +7,8 @@ describe 'trove::quota' do
it 'contains default values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with(
:value => -1)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
@ -21,6 +23,7 @@ describe 'trove::quota' do
context 'with overridden parameters' do
let :params do
{ :max_instances_per_tenant => 10,
:max_ram_per_tenant => 10,
:max_accepted_volume_size => 10,
:max_volumes_per_tenant => 100,
:max_backups_per_tenant => 100,
@ -29,6 +32,8 @@ describe 'trove::quota' do
it 'contains overrided values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(