Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1848183

Summary: openstack overcloud generate fencing with redfish adds invalid param
Product: Red Hat OpenStack Reporter: Tom Bonds <tbonds>
Component: openstack-tripleo-commonAssignee: Luca Miccini <lmiccini>
Status: CLOSED ERRATA QA Contact: pkomarov
Severity: high Docs Contact:
Priority: high    
Version: 16.0 (Train)CC: hbrock, jslagle, lmiccini, mburns, slinaber
Target Milestone: z2Keywords: Triaged
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.20200626053414.4460e68.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-28 15:37:36 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 Tom Bonds 2020-06-17 21:00:46 UTC
Description of problem: openstack overcloud generate fencing nodes.json when pm_type is redfish outputs "lanplus: true" in params


Version-Release number of selected component (if applicable): python3-tripleoclient-12.3.2-0.20200405044622


How reproducible: always


Steps to Reproduce:
1. create nodes.json with "pm_type": "redfish"
2. openstack overcloud generate fencing nodes.json
3. 

Actual results: invalid fencing config


Expected results: valid fencing config


Additional info: adding --ipmi-no-lanplus to the command results in valid output, however it is not obvious that this option could be used


nodes.json:
(undercloud) [stack@undercloud ~]$ cat /tmp/nodes.json
{
  "nodes": [
    {
      "mac": [
        "00:D7:8F:30:95:20"
      ],
      "capabilities": "node:controller-0,boot_option:local",
      "pm_type": "redfish",
      "pm_user": "admin",
      "pm_password": "password",
      "pm_addr": "10.10.10.243",
      "pm_system_id": "/redfish/v1/Systems/XXXXXXXV1TB",
      "redfish_auth_type": "basic",
      "redfish_verify_ca": "false",
      "name": "controller-0"
    },
    {
      "mac": [
        "00:A2:EE:E9:75:E8"
      ],
      "capabilities": "node:controller-1,boot_option:local",
      "pm_type": "redfish",
      "pm_user": "admin",
      "pm_password": "password",
      "pm_addr": "10.10.10.244",
      "pm_system_id": "/redfish/v1/Systems/XXXXXXXV0GT",
      "redfish_verify_ca": "false",
      "name": "controller-1"
    },
    {
      "mac": [
        "00:A2:EE:E8:F9:98"
      ],
      "capabilities": "node:controller-2,boot_option:local",
      "pm_type": "redfish",
      "pm_user": "admin",
      "pm_password": "password",
      "pm_addr": "10.10.10.245",
      "pm_system_id": "/redfish/v1/Systems/XXXXXXXV0FS",
      "redfish_auth_type": "basic",
      "redfish_verify_ca": "false",
      "name": "controller-2"
    }
  ]
}

output fencing config:

(undercloud) [stack@undercloud ~]$ openstack overcloud generate fencing /tmp/nodes.json
parameter_defaults:
  EnableFencing: true
  FencingConfig:
    devices:
    - agent: fence_redfish
      host_mac: 00:d7:8f:30:95:20
      params:
        ipaddr: 10.10.10.243
        lanplus: true
        login: admin
        passwd: password
        pcmk_host_list: osp16-ctrl-0
        ssl_insecure: 'true'
        systems_uri: /redfish/v1/Systems/XXXXXXXV1TB
    - agent: fence_redfish
      host_mac: 00:a2:ee:e9:75:e8
      params:
        ipaddr: 10.10.10.244
        lanplus: true
        login: admin
        passwd: password
        pcmk_host_list: osp16-ctrl-1
        ssl_insecure: 'true'
        systems_uri: /redfish/v1/Systems/XXXXXXXV0GT
    - agent: fence_redfish
      host_mac: 00:a2:ee:e8:f9:98
      params:
        ipaddr: 10.10.10.245
        lanplus: true
        login: admin
        passwd: password
        pcmk_host_list: osp16-ctrl-2
        ssl_insecure: 'true'
        systems_uri: /redfish/v1/Systems/XXXXXXXV0FS

Comment 1 Luca Miccini 2020-06-18 08:46:18 UTC
Thanks for reporting this.

lanplus:true is the default (historically) - see tripleoclient/v1/overcloud_parameters.py

class GenerateFencingParameters(command.Command):
    """Generate fencing parameters"""

    log = logging.getLogger(__name__ + ".GenerateFencing")

    def get_parser(self, prog_name):
        parser = super(GenerateFencingParameters, self).get_parser(prog_name)
        parser.add_argument('-a', '--action', dest='fence_action',
                            help=_('DEPRECATED: This option is ignored.'))
        parser.add_argument('--delay', type=int,
                            help=_('Wait DELAY seconds before fencing is '
                                   'started'))
        parser.add_argument('--ipmi-lanplus',
                            dest='ipmi_lanplus',
                            default=True,
                            action='store_true',
                            help=_('DEPRECATED: This is the default.'))
        parser.add_argument('--ipmi-no-lanplus',
                            dest='ipmi_lanplus',
                            action='store_false',
                            help=_('Do not use Lanplus. Defaults to: false'))


so you would need to pass the --ipmi-no-lanplus option as you already noticed. the code is not smart enough (currently) to figure this out automatically.

imho we can either document this or I can try to fix it (wip @ https://review.opendev.org/736504).

Comment 7 pkomarov 2020-08-10 09:18:14 UTC
Verified , 

[stack@undercloud-0 ~]$ rpm -q openstack-tripleo-common ;grep -C 2 'ipmi_lanplus' /usr/lib/python3.6/site-packages/tripleo_common/actions/parameters.py 
openstack-tripleo-common-11.4.1-0.20200626053414.4460e68.el8ost.noarch
    :param ipmi_level: IPMI user level to use
    :param ipmi_cipher: IPMI cipher suite to use
    :param ipmi_lanplus: whether to use IPMIv2.0
    """

    def __init__(self, nodes_json, delay,
                 ipmi_level, ipmi_cipher, ipmi_lanplus):
        super(GenerateFencingParametersAction, self).__init__()
        self.nodes_json = nodes.convert_nodes_json_mac_to_ports(nodes_json)
--
        self.ipmi_level = ipmi_level
        self.ipmi_cipher = ipmi_cipher
        self.ipmi_lanplus = ipmi_lanplus

    def run(self, context):
--
                else:
                    node_data["agent"] = "fence_ipmilan"
                    if self.ipmi_lanplus:
                        params["lanplus"] = self.ipmi_lanplus
                params["ipaddr"] = node["pm_addr"]
                params["passwd"] = node["pm_password"]

Comment 14 errata-xmlrpc 2020-10-28 15:37:36 UTC
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