Fails to discover IPv6 address on iDRAC

Bug #1998221 reported by martheeswaran
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Medium
Unassigned
3.4
Won't Fix
Medium
Unassigned

Bug Description

Hi,
We deployed maas 2.3.6 version in ipv6 machine.

When we enlist the node the script 30-maas-01-bmc-config runs and it is not able to find bmc ip.

After our investigation, we found the get_bmc_ip is getting None because our idrac did not return required key.

Below code it maas actual code had only these keys IPv6_Static_Addresses and IPv6_Dynamic_Addresses but
our idrac did not return those keys and it has some other keys IPv6_Static_Address and IPv6_Dynamic_Address.

So we added those keys like below and that worked
for section_name, key in [
            ("Lan_Conf", "IP_Address"),
            ("Lan6_Conf", "IPv6_Static_Address"),
            ("Lan6_Conf", "IPv6_Dynamic_Address"),
            ("Lan6_Conf", "IPv6_Static_Addresses"),
            ("Lan6_Conf", "IPv6_Dynamic_Addresses"),
        ]:

 and also the for ipv6, maas did not require brackets
so we fixed that too
if section_name.startswith("Lan6_"):
                    return "%s" % ip, mac_address

IDRAC version details:
============================
 Firmware version: 6.00.02.00
 BIOS version: 2.15.1

===================================
Please find code snippet which we modified here:

    def _get_bmc_ip(self, invalidate_cache=False):
        """Return the current IP of the BMC, returns none if unavailable."""
        show_re = re.compile(
            r"((?:[0-9]{1,3}\.){3}[0-9]{1,3}|[0-9a-fA-F]*:[0-9a-fA-F:.]+)"
        )
        # The MAC Address may only appear in Lan_Conf(IPv4) even when IPv6
        # is in use.
        mac_address = None
        for section_name, key in [
            ("Lan_Conf", "IP_Address"),
            ("Lan6_Conf", "IPv6_Static_Address"),
            ("Lan6_Conf", "IPv6_Dynamic_Address"),
            ("Lan6_Conf", "IPv6_Static_Addresses"),
            ("Lan6_Conf", "IPv6_Dynamic_Addresses"),
        ]:
            if invalidate_cache:
                self._bmc_get_config(section_name)
            try:
                section = self._bmc_config[section_name]
                mac_address = section.get("MAC_Address", mac_address)
                value = section[key]
            except KeyError:
                continue
            # Loop through the addreses by preference: IPv4, static IPv6, dynamic
            # IPv6. Return the first valid, non-link-local address we find.
            # While we could conceivably allow link-local addresses, we would need
            # to devine which of our interfaces is the correct link, and then we
            # would need support for link-local addresses in freeipmi-tools.
            res = show_re.findall(value)
            for ip in res:
                if ip.lower().startswith("fe80::") or ip == "0.0.0.0":
                    time.sleep(2)
                    continue
                if section_name.startswith("Lan6_"):
                    return "%s" % ip, mac_address
                return ip, mac_address
            # No valid IP address was found.
        return None, mac_address

Revision history for this message
Diego Mascialino (dmascialino) wrote :

Hi, thanks for opening this Issue and sharing your fix.

MAAS 2.3.6 is too old nowadays, could you confirm you which version of MAAS are using and how did you installed it (sanp or deb package)?

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 3.3.0
summary: - Bug found in maas 2.3.6 version
+ Fails to discover IPv6 address on iDRAC
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

MAAS 2.3.x is no longer supported, is this still a problem on MAAS 3.3.x?

Changed in maas:
milestone: 3.3.0 → none
status: Triaged → Incomplete
Revision history for this message
martheeswaran (marthees) wrote :

hi team,

This is my bad. The version which we use is 3.2.6

Changed in maas:
status: Incomplete → Triaged
Revision history for this message
Igor Brovtsin (igor-brovtsin) wrote :

martheeswaran, thank you for the report and the patch you provided! However, could you please also attach the output of `bmc-config --checkout -S "Lan6_Conf"` command from that machine?

Changed in maas:
status: Triaged → Incomplete
Revision history for this message
martheeswaran (marthees) wrote :

ubuntu@ran-ipv6-cluster-1-2517:~$ sudo bmc-config --checkout -S "Lan6_Conf"
#
# Section Lan6_Conf Comments
#
# In the Lan6_Conf section, typical networking configuration is setup. Most
# users will choose to set an address in "IPv6_Static_Address" and set the
# appropriate routing for the machine. Note that multiple IPv6 addresses can be
# configured, enable verbose output to view them.
#
Section Lan6_Conf
        ## READ-ONLY
        ## Supports_IPv6_Only Yes
        ## READ-ONLY
        ## Supports_IPv6_And_IPv4_Simultaneously Yes
        ## Possible values: IPv4-Only/IPv6-Only/IPv4-and-IPv6
        IPv6_IPv4_Addressing_Enables IPv6_Only
        ## Possible values: Static
        IPv6_Static_Address_Source Static
        ## Possible values: Yes/No
        IPv6_Static_Address_Enable Yes
        ## Give valid IPv6 address
        IPv6_Static_Address fcff:69:25::17
        ## Give valid prefix length
        IPv6_Static_Address_Prefix_Length 64
        ## READ-ONLY
        ## IPv6_Static_Address_Status Active
        ## READ-ONLY
        ## IPv6_Dynamic_Address_Source_Type
        ## READ-ONLY
        ## IPv6_Dynamic_Address fcff:69:25:0:2b64:cd13:d91 0:a2bc
        ## READ-ONLY
        ## IPv6_Dynamic_Address_Prefix_Length 64
        ## READ-ONLY
        ## IPv6_Dynamic_Address_Status Active
        ## Possible values: Yes/No
        IPv6_Static_Router_Address_Enable No
        ## Give valid IPv6 address
        IPv6_Static_Router_Address_1 ::
        ## Give valid IPv6 mac address
        IPv6_Static_Router_Mac_Address_1 00:00:00:00:00:00
        ## Give valid IPv6 prefix length
        IPv6_Static_Router_Prefix_Length_1 64
        ## Give valid IPv6 prefix value
        IPv6_Static_Router_Prefix_Value_1 ::
        ## Give valid IPv6 address
        IPv6_Static_Router_Address_2 ::
        ## Give valid IPv6 mac address
        IPv6_Static_Router_Mac_Address_2 00:00:00:00:00:00
        ## Give valid IPv6 prefix length
        IPv6_Static_Router_Prefix_Length_2 64
        ## Give valid IPv6 prefix value
        IPv6_Static_Router_Prefix_Value_2 ::
EndSection

Alberto Donato (ack)
Changed in maas:
status: Incomplete → Triaged
Revision history for this message
martheeswaran (marthees) wrote :

Hi team,

Are you going to fix this issue

Alberto Donato (ack)
Changed in maas:
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
Changed in maas:
milestone: 3.4.x → 3.5.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.