Add support for OSP resources plugin from nova_cell1 db.

Change-Id: I34bc2a6fd0340b7974e0d5743bf143121fb92986
This commit is contained in:
rajeshP524 2024-09-13 14:55:16 +05:30
parent 36165d5896
commit 7d2e5b7488
2 changed files with 18 additions and 4 deletions

View File

@ -4,6 +4,10 @@
command: oc get svc openstack -n openstack -o jsonpath='{.spec.clusterIP} {.spec.ports[0].port}'
register: openstack_svc
- name: Fetch Cluster IP and Ports for openstack cell1 service
command: oc get svc openstack-cell1 -n openstack -o jsonpath='{.spec.clusterIP} {.spec.ports[0].port}'
register: openstack_cell1_svc
- name: Fetch Cluster IP and Ports for ovsdbserver-nb-0 service
command: oc get svc ovsdbserver-nb-0 -n openstack -o jsonpath='{.spec.clusterIP} {.spec.ports[0].port}'
register: ovsdbserver_nb_0_svc
@ -32,6 +36,11 @@
openstack_svc_ip: "{{ openstack_svc.stdout.split(' ')[0] }}"
openstack_svc_port: "{{ openstack_svc.stdout.split(' ')[1] }}"
- name: Parse openstack service cell1 details
set_fact:
openstack_cell1_svc_ip: "{{ openstack_cell1_svc.stdout.split(' ')[0] }}"
openstack_cell1_svc_port: "{{ openstack_cell1_svc.stdout.split(' ')[1] }}"
- name: Parse ovsdbserver-nb-0 service details
set_fact:
ovsdbserver_nb_0_svc_ip: "{{ ovsdbserver_nb_0_svc.stdout.split(' ')[0] }}"
@ -57,6 +66,11 @@
mysql_host_ip: "{{ openstack_svc_ip }}"
mysql_port: "{{ openstack_svc_port }}"
- name: set fact for mysql cell1 host ip and port
set_fact:
mysql_cell1_host_ip: "{{ openstack_cell1_svc_ip }}"
mysql_cell1_port: "{{ openstack_cell1_svc_port }}"
- name: Create environment file with key-value pairs
copy:
dest: /tmp/env_file.env

View File

@ -160,11 +160,11 @@ LoadPlugin unixsock
ValuesFrom "instance_faults"
</Result>
</Query>
<Database "nova_cell0">
<Database "nova_cell1">
Driver "mysql"
DriverOption "host" "{{ mysql_host_ip }}"
DriverOption "port" "{{ mysql_port }}"
DriverOption "dbname" "nova_cell0"
DriverOption "host" "{{ mysql_cell1_host_ip }}"
DriverOption "port" "{{ mysql_cell1_port }}"
DriverOption "dbname" "nova_cell1"
DriverOption "username" "root"
DriverOption "password" "{{mysql_root_password}}"
Query host_vms_count