From 3b6f39ffbddd66d86e9cb125c35dcff95201022f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 27 Sep 2024 18:12:55 +0200 Subject: [PATCH] Ensure quota is set for BFV amphoras At the moment role does not increase volumes quota for the project when BFV is enabled for Octavia. This might lead to Amphora failures to spawn-up once default quota (of 10 volumes) is reached. With that we also calculate amout of diskspace required based on the instance limit. It also changes flavor to contain 0 disk if BFV is enabled to ensure that ephemeral is not gonna be used. Change-Id: Ia35948cd2381b13d3792fc0029d93a9e176c884c --- defaults/main.yml | 6 ++++-- .../amphora_bfv_quota-8adc0a3c886921ba.yaml | 17 +++++++++++++++++ tasks/octavia_resources.yml | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/amphora_bfv_quota-8adc0a3c886921ba.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 28fff0b1..c8db55e3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -72,7 +72,7 @@ octavia_barbican_enabled: false ## Cinder Volume octavia_cinder_enabled: False cinder_default_availability_zone: "{{ octavia_amp_availability_zone }}" -octavia_cinder_volume_size: 16 +octavia_cinder_volume_size: 20 octavia_cinder_volume_type: "volumes-hdd" ## Database info @@ -365,7 +365,7 @@ octavia_health_manager_port: 5555 octavia_amp_flavor_name: "m1.amphora" octavia_amp_ram: 1024 octavia_amp_vcpu: 1 -octavia_amp_disk: 20 +octavia_amp_disk: "{{ octavia_cinder_enabled | ternary(0, 20) }}" # octavia_amp_extra_specs: # only increase when it's a really busy system since this is by deployed host, @@ -715,12 +715,14 @@ octavia_ca_private_key_passphrase: "{{ octavia_cert_client_password }}" # Quotas for the Octavia user - assuming active/passive topology octavia_num_instances: 10000 # 5000 LB in active/passive octavia_ram: "{{ (octavia_num_instances | int) * 1024 }}" +octavia_gigabytes: "{{ (octavia_num_volumes | int) * (octavia_cinder_volume_size | int) }}" octavia_num_server_groups: "{{ ((octavia_num_instances | int) * 0.5) | int | abs }}" octavia_num_server_group_members: 50 octavia_num_cores: "{{ octavia_num_instances }}" octavia_num_secgroups: "{{ (octavia_num_instances | int) * 1.5 | int | abs }}" # average 3 listener per lb octavia_num_ports: "{{ (octavia_num_instances | int) * 10 }}" # at least instances * 10 octavia_num_security_group_rules: "{{ (octavia_num_secgroups | int) * 100 }}" +octavia_num_volumes: "{{ octavia_num_instances }}" ## Tunable overrides octavia_octavia_conf_overrides: {} diff --git a/releasenotes/notes/amphora_bfv_quota-8adc0a3c886921ba.yaml b/releasenotes/notes/amphora_bfv_quota-8adc0a3c886921ba.yaml new file mode 100644 index 00000000..ac1fd837 --- /dev/null +++ b/releasenotes/notes/amphora_bfv_quota-8adc0a3c886921ba.yaml @@ -0,0 +1,17 @@ +--- +features: + - | + Added variables ``octavia_gigabytes`` and ``octavia_num_volumes`` to + control quota defenitions for the project where Octavia Amphorae is + being spawned. +fixes: + - | + Octavia role now handles quota defenition properly when BFV is set for + Amphorae by defining ``octavia_cinder_enabled: True`` +upgrade: + - | + Changed default for ``octavia_cinder_volume_size`` to 20gb in order + to align with value of ``octavia_amp_disk`` + - | + Amphorae flavor will have 0 disk set (through variable + ``octavia_amp_disk``), when ``octavia_cinder_enabled: True``. diff --git a/tasks/octavia_resources.yml b/tasks/octavia_resources.yml index 0db0680d..856dbefa 100644 --- a/tasks/octavia_resources.yml +++ b/tasks/octavia_resources.yml @@ -36,6 +36,7 @@ quotas: - name: "{{ octavia_service_project_name }}" cores: "{{ octavia_num_cores }}" + gigabytes: "{{ octavia_cinder_enabled | ternary(octavia_gigabytes, omit) }}" instances: "{{ octavia_num_instances }}" ram: "{{ octavia_ram }}" server_groups: "{{ octavia_num_server_groups }}" @@ -43,6 +44,7 @@ security_group: "{{ octavia_num_secgroups }}" security_group_rule: "{{ octavia_num_security_group_rules }}" port: "{{ octavia_num_ports }}" + volumes: "{{ octavia_cinder_enabled | ternary(octavia_num_volumes, omit) }}" # Network Resources _octavia_networks: networks: