Bug 1851507
Summary: | "openstack overcloud generate fencing [...]" fails with 404 Not Found if overcloud node is error state (nova) and not yet deployed with ironic | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Matt Flusche <mflusche> |
Component: | openstack-tripleo-common | Assignee: | Luca Miccini <lmiccini> |
Status: | CLOSED ERRATA | QA Contact: | pkomarov |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 16.0 (Train) | CC: | aschultz, dabarzil, lmiccini, mburns, slinaber |
Target Milestone: | z2 | Keywords: | Triaged, ZStream |
Target Release: | 16.1 (Train on RHEL 8.2) | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | openstack-tripleo-common-11.4.1-0.20200708213416.da384ef.el8ost | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-10-28 15:38:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Matt Flusche
2020-06-26 18:11:49 UTC
I think the exception should be handled in the generate_hostmap function: class GenerateFencingParametersAction(base.TripleOAction): """Generates fencing configuration for a deployment. ... def run(self, context): """Returns the parameters for fencing controller nodes""" hostmap = nodes.generate_hostmap(self.get_baremetal_client(context), self.get_compute_client(context)) fence_params = {"EnableFencing": True, "FencingConfig": {}} devices = [] ... def generate_hostmap(baremetal_client, compute_client): """Create a map between Compute nodes and Baremetal nodes""" hostmap = {} for node in compute_client.servers.list(): bm_node = baremetal_client.node.get_by_instance_uuid(node.id) for port in baremetal_client.port.list(node=bm_node.uuid): hostmap[port.address] = {"compute_name": node.name, "baremetal_name": bm_node.name} if hostmap == {}: return None else: return hostmap something like: def generate_hostmap(baremetal_client, compute_client): """Create a map between Compute nodes and Baremetal nodes""" hostmap = {} for node in compute_client.servers.list(): try: bm_node = baremetal_client.node.get_by_instance_uuid(node.id) for port in baremetal_client.port.list(node=bm_node.uuid): hostmap[port.address] = {"compute_name": node.name, "baremetal_name": bm_node.name} except: # we didn't find a bm_node corresponding to the instance # probably server is in error state with no corresponding # ironic node assigned. return can you maybe give https://review.opendev.org/#/c/738768/ a try? Hi Luca, Thanks for looking at this. Your fix seems to work for me. (undercloud) [stack@undercloud13 ~]$ rm fencing.yaml (undercloud) [stack@undercloud13 ~]$ nova list +--------------------------------------+-------------------------+--------+------------+-------------+-----------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+-------------------------+--------+------------+-------------+-----------------------+ | 099a1f89-0130-4174-9252-db6b7e748948 | overcloud-cephstorage-0 | ACTIVE | - | Running | ctlplane=172.16.6.110 | | 2255e1b9-407a-4bdc-8edc-56c072763c49 | overcloud-compute-0 | ACTIVE | - | Running | ctlplane=172.16.6.101 | | 10c1d7c1-416f-4a0f-b076-f15fc2376d60 | overcloud-compute-1 | ACTIVE | - | Running | ctlplane=172.16.6.102 | | cc1f99cc-ee9f-4240-8053-b7e134a059c8 | overcloud-compute-2 | ERROR | - | NOSTATE | | | 7824d837-b932-4e33-904c-54925b00d3d4 | overcloud-controller-0 | ACTIVE | - | Running | ctlplane=172.16.6.103 | +--------------------------------------+-------------------------+--------+------------+-------------+-----------------------+ (undercloud) [stack@undercloud13 ~]$ openstack overcloud generate fencing --ipmi-lanplus --ipmi-level administrator --output fencing.yaml instack.json (nil) (undercloud) [stack@undercloud13 ~]$ cat fencing.yaml parameter_defaults: EnableFencing: true FencingConfig: devices: - agent: fence_ipmilan host_mac: 52:54:00:a5:a6:e0 params: ipaddr: 192.168.122.1 ipport: '634' lanplus: true login: admin passwd: redhat privlvl: administrator [...] will fix this in train/osp16. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat OpenStack Platform 16.1 bug fix and enhancement advisory), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2020:4284 |