diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 06add8995d..802079a649 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -597,7 +597,7 @@ enable_horizon_vitrage: "{{ enable_vitrage | bool }}" enable_horizon_watcher: "{{ enable_watcher | bool }}" enable_horizon_zun: "{{ enable_zun | bool }}" enable_hyperv: "no" -enable_influxdb: "{{ enable_monasca | bool or (cloudkitty_storage_backend is defined and cloudkitty_storage_backend == 'influxdb') }}" +enable_influxdb: "{{ enable_monasca | bool or (enable_cloudkitty | bool and cloudkitty_storage_backend == 'influxdb') }}" enable_ironic: "no" enable_ironic_ipxe: "no" enable_ironic_neutron_agent: "{{ enable_neutron | bool and enable_ironic | bool }}" @@ -861,6 +861,12 @@ cinder_backup_mount_options_nfs: "" ####################### # Valid option is gnocchi cloudkitty_collector_backend: "gnocchi" +# Valid options are 'sqlalchemy' or 'influxdb'. The default value is +# 'influxdb', which matches the default in Cloudkitty since the Stein release. +# When the backend is "influxdb", we also enable Influxdb. +# Also, when using 'influxdb' as the backend, we trigger the configuration/use +# of Cloudkitty storage backend version 2. +cloudkitty_storage_backend: "influxdb" ####################### # Designate options diff --git a/ansible/roles/cloudkitty/defaults/main.yml b/ansible/roles/cloudkitty/defaults/main.yml index 440a40a48c..0dc9830fd3 100644 --- a/ansible/roles/cloudkitty/defaults/main.yml +++ b/ansible/roles/cloudkitty/defaults/main.yml @@ -100,13 +100,12 @@ cloudkitty_custom_metrics_yaml_file: "metrics.yml" #################### # Storage backend #################### -# Valid options are 'sqlalchemy' or 'influxdb'. The default value in -# Kolla-ansible is 'sqlalchemy' (for backwards compatibility). -# When cloudkitty_storage_backend is define with "influxdb" as its value, -# we also trigger the deployment of Influxdb via Kolla-ansible. +# Valid options are 'sqlalchemy' or 'influxdb'. The default value is +# 'influxdb', which matches the default in Cloudkitty since the Stein release. +# When the backend is "influxdb", we also enable Influxdb. # Also, when using 'influxdb' as the backend, we trigger the configuration/use # of Cloudkitty storage backend version 2. -cloudkitty_storage_backend: "sqlalchemy" +cloudkitty_storage_backend: "influxdb" # InfluxDB retention policy to use (defaults to autogen). # cloudkitty_influxdb_retention_policy: "autogen" diff --git a/ansible/roles/cloudkitty/tasks/upgrade.yml b/ansible/roles/cloudkitty/tasks/upgrade.yml index 20ccddc8f1..9f3ca46e57 100644 --- a/ansible/roles/cloudkitty/tasks/upgrade.yml +++ b/ansible/roles/cloudkitty/tasks/upgrade.yml @@ -1,6 +1,19 @@ --- - include_tasks: config.yml +# NOTE(mgoddard): Transition support for upgrades from Rocky or Stein which may +# be using the SQLAlchemy storage backend. +# TODO(mgoddard): Remove in U cycle. +- name: Creating Cloudkitty influxdb database + become: true + kolla_toolbox: + module_name: influxdb_database + module_args: + hostname: "{{ influxdb_address }}" + port: "{{ influxdb_http_port }}" + database_name: "{{ cloudkitty_influxdb_name }}" + when: cloudkitty_storage_backend == 'influxdb' + - include_tasks: bootstrap_service.yml - name: Flush handlers diff --git a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 index b397a4a33e..c3dcf0aa6a 100644 --- a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 +++ b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 @@ -72,7 +72,7 @@ version = 1 {% endif %} {% if cloudkitty_storage_backend == 'influxdb' %} -[storage_influx] +[storage_influxdb] database = {{ cloudkitty_influxdb_name }} host = {{ influxdb_address }} port = {{ influxdb_http_port }} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 07c68061b6..1e36710178 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -268,7 +268,7 @@ #enable_horizon_watcher: "{{ enable_watcher | bool }}" #enable_horizon_zun: "{{ enable_zun | bool }}" #enable_hyperv: "no" -#enable_influxdb: "{{ enable_monasca | bool or (cloudkitty_storage_backend is defined and cloudkitty_storage_backend == 'influxdb') }}" +#enable_influxdb: "{{ enable_monasca | bool or (enable_cloudkitty | bool and cloudkitty_storage_backend == 'influxdb') }}" #enable_ironic: "no" #enable_ironic_ipxe: "no" #enable_ironic_neutron_agent: "{{ enable_neutron | bool and enable_ironic | bool }}" @@ -446,6 +446,17 @@ #cinder_backup_share: "" #cinder_backup_mount_options_nfs: "" +####################### +# Cloudkitty options +####################### +# Valid option is gnocchi +#cloudkitty_collector_backend: "gnocchi" +# Valid options are 'sqlalchemy' or 'influxdb'. The default value is +# 'influxdb', which matches the default in Cloudkitty since the Stein release. +# When the backend is "influxdb", we also enable Influxdb. +# Also, when using 'influxdb' as the backend, we trigger the configuration/use +# of Cloudkitty storage backend version 2. +#cloudkitty_storage_backend: "influxdb" ################### # Designate options diff --git a/releasenotes/notes/cloudkitty-default-influxdb-397d7441ad2576c5.yaml b/releasenotes/notes/cloudkitty-default-influxdb-397d7441ad2576c5.yaml new file mode 100644 index 0000000000..992aa6d127 --- /dev/null +++ b/releasenotes/notes/cloudkitty-default-influxdb-397d7441ad2576c5.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + Modifies the default storage backend for Cloudkitty to InfluxDB, to match + the default in Cloudkitty from Stein onwards. This is controlled via + ``cloudkitty_storage_backend``. To use the previous default, set + ``cloudkitty_storage_backend`` to ``sqlalchemy``. See `bug 1838641 + `__ for details.