diff --git a/docs_user/modules/openstack-autoscaling_adoption.adoc b/docs_user/modules/openstack-autoscaling_adoption.adoc index 3dde0c659..9ab02cd5a 100644 --- a/docs_user/modules/openstack-autoscaling_adoption.adoc +++ b/docs_user/modules/openstack-autoscaling_adoption.adoc @@ -20,62 +20,71 @@ should be already adopted. == Procedure - Autoscaling adoption -Patch OpenStackControlPlane to deploy autoscaling services: +=== Patch OpenStackControlPlane to deploy autoscaling services: ---- -cat << EOF > aodh_patch.yaml +oc patch openstackcontrolplane openstack --type=merge --patch ' spec: - autoscaling: + telemetry: enabled: true - prometheus: - deployPrometheus: false - aodh: - customServiceConfig: | - [DEFAULT] - debug=true - secret: osp-secret -ifeval::["{build}" == "upstream"] - apiImage: "quay.io/podified-antelope-centos9/openstack-aodh-api:current-podified" - evaluatorImage: "quay.io/podified-antelope-centos9/openstack-aodh-evaluator:current-podified" - notifierImage: "quay.io/podified-antelope-centos9/openstack-aodh-notifier:current-podified" - listenerImage: "quay.io/podified-antelope-centos9/openstack-aodh-listener:current-podified" -endif::[] -ifeval::["{build}" == "downstream"] - apiImage: "registry.redhat.io/rhosp-dev-preview/openstack-aodh-api-rhel9:18.0" - evaluatorImage: "registry.redhat.io/rhosp-dev-preview/openstack-aodh-evaluator-rhel9:18.0" - notifierImage: "registry.redhat.io/rhosp-dev-preview/openstack-aodh-notifier-rhel9:18.0" - listenerImage: "registry.redhat.io/rhosp-dev-preview/openstack-aodh-listener-rhel9:18.0" -endif::[] - passwordSelectors: - databaseUser: aodh - databaseInstance: openstack - memcachedInstance: memcached -EOF + template: + autoscaling: + enabled: true + heatInstance: heat + aodh: + customServiceConfig: | + [DEFAULT] + debug=true + passwordSelector: + aodhService: AodhPassword + database: AodhDatabasePassword + service: CeilometerPassword + secret: osp-secret + databaseInstance: openstack + memcachedInstance: memcached + databaseUser: aodh +' ---- - -____ -If you have previously backed up your OpenStack services configuration file from the old environment, you can use os-diff to compare and make sure the configuration is correct. For more information, see xref:pulling-the-openstack-configuration_{context}[Pulling the OpenStack configuration]. -____ +=== Install cluster-observability-operator ---- -pushd os-diff -./os-diff cdiff --service aodh -c /tmp/collect_tripleo_configs/aodh/etc/aodh/aodh.conf -o aodh_patch.yaml +oc create -f - < ceilometer_patch.yaml +oc patch openstackcontrolplane openstack --type=merge --patch ' spec: - ceilometer: + telemetry: enabled: true template: -ifeval::["{build}" == "upstream"] - centralImage: quay.io/podified-antelope-centos9/openstack-ceilometer-central:current-podified - computeImage: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified - customServiceConfig: | - [DEFAULT] - debug=true - ipmiImage: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified - nodeExporterImage: quay.io/prometheus/node-exporter:v1.5.0 - notificationImage: quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified - secret: osp-secret - sgCoreImage: quay.io/infrawatch/sg-core:v5.1.1 -endif::[] -ifeval::["{build}" == "downstream"] - centralImage: registry.redhat.io/rhosp-dev-preview/openstack-ceilometer-central-rhel9:18.0 - computeImage: registry.redhat.io/rhosp-dev-preview/openstack-ceilometer-compute-rhel9:18.0 - customServiceConfig: | - [DEFAULT] - debug=true - ipmiImage: registry.redhat.io/rhosp-dev-preview/openstack-ceilometer-ipmi-rhel9:18.0 - nodeExporterImage: quay.io/prometheus/node-exporter:v1.5.0 - notificationImage: registry.redhat.io/rhosp-dev-preview/openstack-ceilometer-notification-rhel9:18.0 - secret: osp-secret - sgCoreImage: quay.io/infrawatch/sg-core:v5.1.1 -endif::[] -EOF + ceilometer: + enabled: true + customServiceConfig: | + [DEFAULT] + debug=true + secret: osp-secret +' ---- -____ -If you have previously backed up your OpenStack services configuration file from the old environment, you can use os-diff to compare and make sure the configuration is correct. For more information, see xref:pulling-the-openstack-configuration_{context}[Pulling the OpenStack configuration]. -____ - ----- -pushd os-diff -./os-diff cdiff --service ceilometer -c /tmp/collect_tripleo_configs/ceilometer/etc/ceilometer/ceilometer.conf -o ceilometer_patch.yaml ----- -____ -This will produce the difference between both ini configuration files. -____ - -Patch OpenStackControlPlane to deploy Ceilometer services: +Enable Logging ---- -oc patch openstackcontrolplane openstack --type=merge --patch-file ceilometer_patch.yaml +oc patch openstackcontrolplane openstack --type=merge --patch ' +spec: + telemetry: + enabled: true + template: + logging: + enabled: true +' ---- == Post-checks @@ -84,19 +61,13 @@ CEILOMETETR_POD=`oc get pods -l service=ceilometer | tail -n 1 | cut -f 1 -d' '` oc exec -t $CEILOMETETR_POD -c ceilometer-central-agent -- cat /etc/ceilometer/ceilometer.conf ---- -=== Inspect the resulting Ceilometer IPMI agent pod on Data Plane nodes - ----- -podman ps | grep ceilometer-ipmi ----- - === Inspecting enabled pollsters ---- oc get secret ceilometer-config-data -o jsonpath="{.data['polling\.yaml']}" | base64 -d ---- -=== Enabling pollsters according to requirements +=== Create polling.yaml with required pollsters ---- cat << EOF > polling.yaml @@ -110,6 +81,9 @@ sources: - cpu - memory EOF +---- +=== Update ceilometer configuration with new pollsters +---- oc patch secret ceilometer-config-data --patch="{\"data\": { \"polling.yaml\": \"$(base64 -w0 polling.yaml)\"}}" ---- diff --git a/tests/roles/autoscaling_adoption/meta/main.yaml b/tests/roles/autoscaling_adoption/meta/main.yaml new file mode 100644 index 000000000..610f184fb --- /dev/null +++ b/tests/roles/autoscaling_adoption/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - role: common_defaults diff --git a/tests/roles/autoscaling_adoption/tasks/main.yaml b/tests/roles/autoscaling_adoption/tasks/main.yaml new file mode 100644 index 000000000..5a5c9ae32 --- /dev/null +++ b/tests/roles/autoscaling_adoption/tasks/main.yaml @@ -0,0 +1,81 @@ +- name: deploy podified Aodh + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + telemetry: + enabled: true + template: + autoscaling: + enabled: true + heatInstance: heat + aodh: + customServiceConfig: | + [DEFAULT] + debug=true + passwordSelector: + aodhService: AodhPassword + database: AodhDatabasePassword + service: CeilometerPassword + secret: osp-secret + databaseInstance: openstack + memcachedInstance: memcached + databaseUser: aodh + ' + +- name: wait for Aodh to start up + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc get pod --selector=service=aodh -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running + register: aodh_running_result + until: aodh_running_result is success + retries: 60 + delay: 2 + +- name: check that Aodh is reachable and its endpoints are defined + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + + alias openstack="oc exec -t openstackclient -- openstack" + + ${BASH_ALIASES[openstack]} endpoint list | grep aodh + register: aodh_responding_result + until: aodh_responding_result is success + retries: 60 + delay: 2 + +- name: deploy metric storage + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + telemetry: + enabled: true + template: + metricStorage: + enabled: true + ' + +- name: wait for alertmanager metric storage to start up + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc get pod --selector=alertmanager=metric-storage -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running + register: alertmanager_running_result + until: alertmanager_running_result is success + retries: 60 + delay: 2 + +- name: wait for prometheus metric storage to start up + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc get pod --selector=prometheus=metric-storage -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running + register: prometheus_running_result + until: prometheus_running_result is success + retries: 60 + delay: 2 diff --git a/tests/roles/backend_services/defaults/main.yaml b/tests/roles/backend_services/defaults/main.yaml index e85bdc952..72ed3b3aa 100644 --- a/tests/roles/backend_services/defaults/main.yaml +++ b/tests/roles/backend_services/defaults/main.yaml @@ -1,5 +1,8 @@ # Service account passwords (not service DB passwords) from the # original deployment. +aodh_password: '' +ceilometer_metering_secret: '' +ceilometer_password: '' cinder_password: '' manila_password: '' glance_password: '' diff --git a/tests/roles/backend_services/tasks/main.yaml b/tests/roles/backend_services/tasks/main.yaml index 73a01dac3..6d8773002 100644 --- a/tests/roles/backend_services/tasks/main.yaml +++ b/tests/roles/backend_services/tasks/main.yaml @@ -16,6 +16,15 @@ ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} + {% if aodh_password %} + oc set data secret/osp-secret "AodhPassword={{ aodh_password }}" + {% endif %} + {% if ceilometer_metering_secret %} + oc set data secret/osp-secret "CeilometerMeteringSecret={{ ceilometer_metering_secret }}" + {% endif %} + {% if ceilometer_password %} + oc set data secret/osp-secret "CEILOMETER_PASSWORD={{ ceilometer_password }}" + {% endif %} {% if cinder_password %} oc set data secret/osp-secret "CinderPassword={{ cinder_password }}" {% endif %} diff --git a/tests/roles/heat_adoption/tasks/main.yaml b/tests/roles/heat_adoption/tasks/main.yaml index fc34eae63..22503be93 100644 --- a/tests/roles/heat_adoption/tasks/main.yaml +++ b/tests/roles/heat_adoption/tasks/main.yaml @@ -28,6 +28,8 @@ authEncryptionKey: HeatAuthEncryptionKey database: HeatDatabasePassword service: HeatPassword + rabbitMqClusterName: rabbitmq + serviceUser: heat ' - name: wait for Heat to start up diff --git a/tests/roles/keystone_adoption/tasks/main.yaml b/tests/roles/keystone_adoption/tasks/main.yaml index a7d7eca68..279688a98 100644 --- a/tests/roles/keystone_adoption/tasks/main.yaml +++ b/tests/roles/keystone_adoption/tasks/main.yaml @@ -84,6 +84,6 @@ ${BASH_ALIASES[openstack]} endpoint list | grep keystone | awk '/admin/{ print $2; }' | xargs ${BASH_ALIASES[openstack]} endpoint delete || true - for service in cinderv3 glance neutron nova placement swift; do + for service in aodh cinderv3 glance gnocchi neutron nova placement swift; do ${BASH_ALIASES[openstack]} service list | awk "/ $service /{ print \$2; }" | xargs ${BASH_ALIASES[openstack]} service delete || true done diff --git a/tests/roles/stop_openstack_services/tasks/main.yaml b/tests/roles/stop_openstack_services/tasks/main.yaml index 2f70c4d92..21f469920 100644 --- a/tests/roles/stop_openstack_services/tasks/main.yaml +++ b/tests/roles/stop_openstack_services/tasks/main.yaml @@ -13,14 +13,25 @@ {{ oc_header }} {{ stop_openstack_services_shell_vars }} - ServicesToStop=("tripleo_horizon.service" + ServicesToStop=("tripleo_aodh_api.service" + "tripleo_aodh_api_cron.service" + "tripleo_aodh_evaluator.service" + "tripleo_aodh_listener.service" + "tripleo_aodh_notifier.service" + "tripleo_ceilometer_agent_central.service" + "tripleo_ceilometer_agent_notification.service" + "tripleo_horizon.service" "tripleo_keystone.service" "tripleo_cinder_api.service" "tripleo_cinder_api_cron.service" "tripleo_cinder_scheduler.service" "tripleo_cinder_volume.service" "tripleo_cinder_backup.service" + "tripleo_collectd.service" "tripleo_glance_api.service" + "tripleo_gnocchi_api.service" + "tripleo_gnocchi_metricd.service" + "tripleo_gnocchi_statsd.service" "tripleo_manila_api.service" "tripleo_manila_api_cron.service" "tripleo_manila_scheduler.service" diff --git a/tests/roles/telemetry_adoption/meta/main.yaml b/tests/roles/telemetry_adoption/meta/main.yaml new file mode 100644 index 000000000..610f184fb --- /dev/null +++ b/tests/roles/telemetry_adoption/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - role: common_defaults diff --git a/tests/roles/telemetry_adoption/tasks/main.yaml b/tests/roles/telemetry_adoption/tasks/main.yaml new file mode 100644 index 000000000..696ef7b46 --- /dev/null +++ b/tests/roles/telemetry_adoption/tasks/main.yaml @@ -0,0 +1,40 @@ +- name: deploy podified Ceilometer + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + telemetry: + enabled: true + template: + ceilometer: + enabled: true + customServiceConfig: | + [DEFAULT] + debug=true + secret: osp-secret + ' + +- name: wait for Keystone to start up + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc get pod --selector=service=ceilometer -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running + register: ceilometer_running_result + until: ceilometer_running_result is success + retries: 60 + delay: 2 + + +- name: Enable logging + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + telemetry: + enabled: true + template: + logging: + enabled: true + ' diff --git a/tests/secrets.sample.yaml b/tests/secrets.sample.yaml index d8473148f..7e07c1b58 100644 --- a/tests/secrets.sample.yaml +++ b/tests/secrets.sample.yaml @@ -15,6 +15,9 @@ source_db_root_password: "{{ lookup('file', tripleo_passwords) | from_yaml | com podified_db_root_password: 12345678 # Service account passwords (not DB passwords). +aodh_password: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.AodhPassword') | first }}" +ceilometer_metering_secret: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.CeilometerMeteringSecret') | first }}" +ceilometer_password: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.CeilometerPassword') | first }}" cinder_password: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.CinderPassword') | first }}" glance_password: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.GlancePassword') | first }}" ironic_password: "{{ lookup('file', tripleo_passwords) | from_yaml | community.general.json_query('*.IronicPassword') | first }}"