Merge "Fix overcloud_health_checks on OSP17"
This commit is contained in:
commit
15c76bf3af
@ -15,6 +15,7 @@ from __future__ import absolute_import
|
||||
|
||||
import collections
|
||||
from collections import abc
|
||||
import functools
|
||||
import re
|
||||
import typing
|
||||
from urllib import parse
|
||||
@ -648,6 +649,9 @@ def get_nova_version_from_container():
|
||||
pass
|
||||
|
||||
|
||||
# During a execution of tobiko, openstack version does not change, so let's
|
||||
# cache the output of this function
|
||||
@functools.lru_cache()
|
||||
def get_openstack_version():
|
||||
try:
|
||||
return get_rhosp_version()
|
||||
|
@ -263,10 +263,18 @@ def assert_containers_running(group, expected_containers, full_name=True,
|
||||
return True
|
||||
|
||||
|
||||
def get_libvirt_container_name():
|
||||
if topology.verify_osp_version('17.0', lower=True):
|
||||
return 'nova_libvirt'
|
||||
else:
|
||||
return 'nova_virtqemud'
|
||||
|
||||
|
||||
def assert_all_tripleo_containers_running():
|
||||
"""check that all common tripleo containers are running
|
||||
param: group controller or compute , check containers
|
||||
sets in computes or controllers"""
|
||||
nova_libvirt = get_libvirt_container_name()
|
||||
|
||||
common_controller_tripleo_containers = ['cinder_api', 'cinder_api_cron',
|
||||
'cinder_scheduler',
|
||||
@ -313,7 +321,7 @@ def assert_all_tripleo_containers_running():
|
||||
'nova_vnc_proxy']
|
||||
|
||||
common_compute_tripleo_containers = ['iscsid', 'logrotate_crond',
|
||||
'nova_compute', 'nova_libvirt',
|
||||
'nova_compute', nova_libvirt,
|
||||
'nova_migration_target',
|
||||
'nova_virtlogd']
|
||||
|
||||
@ -391,9 +399,6 @@ def run_container_config_validations():
|
||||
{'section': 'ml2',
|
||||
'param': 'type_drivers',
|
||||
'expected_value': 'geneve'},
|
||||
{'section': 'ovn',
|
||||
'param': 'ovn_l3_mode',
|
||||
'expected_value': 'True'},
|
||||
{'section': 'ovn',
|
||||
'param': 'ovn_metadata_enabled',
|
||||
'expected_value': 'True'}]}]
|
||||
|
@ -199,7 +199,8 @@ def check_vm_running_via_virsh(topology_compute, vm_id):
|
||||
def get_vm_uuid_list_running_via_virsh(topology_compute):
|
||||
if overcloud.has_overcloud():
|
||||
container_runtime = containers.get_container_runtime_name()
|
||||
command = f"sudo {container_runtime} exec nova_libvirt " \
|
||||
nova_libvirt = containers.get_libvirt_container_name()
|
||||
command = f"sudo {container_runtime} exec {nova_libvirt} " \
|
||||
f"sh -c 'for i in `virsh list --name --state-running` " \
|
||||
f";do virsh domuuid $i;done'"
|
||||
else:
|
||||
|
@ -78,20 +78,27 @@ def get_pcs_resources_table(timeout=720, interval=2) -> pandas.DataFrame:
|
||||
return table
|
||||
|
||||
|
||||
def get_pcs_prefix_and_status_values():
|
||||
if topology.verify_osp_version('17.0', lower=True):
|
||||
ocf_prefix = "ocf::"
|
||||
promoted_status_str = "Master"
|
||||
unpromoted_status_str = "Slave"
|
||||
else:
|
||||
ocf_prefix = "ocf:"
|
||||
promoted_status_str = "Promoted"
|
||||
unpromoted_status_str = "Unpromoted"
|
||||
return ocf_prefix, promoted_status_str, unpromoted_status_str
|
||||
|
||||
|
||||
class PacemakerResourcesStatus(object):
|
||||
"""
|
||||
class to handle pcs resources checks
|
||||
"""
|
||||
def __init__(self):
|
||||
self.pcs_df = get_pcs_resources_table()
|
||||
if topology.verify_osp_version('17.0', lower=True):
|
||||
self.ocf_prefix = "ocf::"
|
||||
self.promoted_status_str = "Master"
|
||||
self.unpromoted_status_str = "Slave"
|
||||
else:
|
||||
self.ocf_prefix = "ocf:"
|
||||
self.promoted_status_str = "Promoted"
|
||||
self.unpromoted_status_str = "Unpromoted"
|
||||
(self.ocf_prefix,
|
||||
self.promoted_status_str,
|
||||
self.unpromoted_status_str) = get_pcs_prefix_and_status_values()
|
||||
|
||||
def container_runtime(self):
|
||||
|
||||
@ -280,8 +287,10 @@ def get_resource_master_node(resource_type=None):
|
||||
|
||||
|
||||
def get_ovn_db_master_node():
|
||||
ocf_prefix, promoted_status_str, _ = get_pcs_prefix_and_status_values()
|
||||
return get_overcloud_nodes_running_pcs_resource(
|
||||
resource_type='(ocf::ovn:ovndb-servers):', resource_state='Master')
|
||||
resource_type=f'({ocf_prefix}ovn:ovndb-servers):',
|
||||
resource_state=promoted_status_str)
|
||||
|
||||
|
||||
def get_overcloud_resource(resource_type=None,
|
||||
|
Loading…
Reference in New Issue
Block a user