3
ܓi @ s, d dl Z d dlmZ dZG dd deZdS ) N)Clusterz9/var/lib/mistral/overcloud/tripleo-ansible-inventory.yamlc @ s. e Zd ZdZdZdddgZdd Zd
d ZdS )rhospa
This cluster profile is for use with Red Hat OpenStack Platform
environments.
Different types of nodes may be enumerated by toggling the various profile
options such as Controllers and Compute nodes. By default, only Controller
nodes are enumerated.
Node enumeration is done by inspecting the ansible inventory file used for
deployment of the environment. This is canonically located at
/var/lib/mistral/overcloud/tripleo-ansible-inventory.yaml. Similarly, the
presence of this file on the primary node is what triggers the automatic
enablement of this profile.
Special consideration should be taken for where `sos collect` is being run
from, in that the hostnames of the enumerated nodes must be resolveable
from that system - not just from the primary node from which those nodes
are discovered. If this is not possible, consider enabling the `use-ip`
cluster option to instead have this profile source the IP addresses of the
nodes in question.
zRed Hat OpenStack Platformuse-ipF0use IP addresses instead of hostnames to connect
controllerT%collect reports from controller nodescompute"collect reports from compute nodesc C s | j jtddS )NT)Z need_root)primaryZfile_exists INVENTORY)self r
/usr/lib/python3.6/openstack.py
check_enabled0 s zrhosp.check_enabledc C s g }| j drdnd}ytj| jjt}W n< tk
rh } z | jd| td|W Y d d }~X nX yTxNdD ]F}| j |j rrx2|| d j D ]}|j
|| d | | qW qrW W n8 tk
r } z| jd | d
| W Y d d }~X nX |S )Nzuse-ipZexternal_ipZctlplane_hostnamezError parsing yaml: z'Could not parse yaml for node addresses
ControllerComputeZhostszError getting z host addresses: )r r )Z
get_optionyamlZ safe_loadr
Z read_filer ExceptionZlog_infolowerkeysappendZ log_error)r Z_nodesZ_addr_fieldZ_inverrZ_thostr
r
r get_nodes3 s
&(zrhosp.get_nodesN)r Fr )r Tr )r Fr )__name__
__module____qualname____doc__Zcluster_nameZoption_listr r r
r
r
r r s r )r Zsos.collector.clustersr r r r
r
r
r