From e27f07ac36f925c97623e09a1d368bde3ec7961e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 15 Apr 2025 14:25:03 -0400 Subject: [PATCH] Use IPv4 address for ikvm when fe80 is the local bmc The fe80:: is hopeless, try to send ipv4 just in case. Technically speaking, the user may be using a different address or real ipv6 and the ipv4 guess might fail, but it probably won't. --- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 3 +++ .../confluent/plugins/hardwaremanagement/redfish.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index ed4236c9..02e324bb 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1669,6 +1669,9 @@ class IpmiHandler(object): launchdata = self.ipmicmd.get_ikvm_launchdata() if 'url' in launchdata and not launchdata['url'].startswith('https://'): mybmc = self.ipmicmd.confluentbmcname + if mybmc.startswith('fe80::'): # link local, need to adjust + lancfg = self.ipmicmd.get_net_configuration() + mybmc = lancfg['ipv4_address'].split('/')[0] if ':' in mybmc and not '[' in mybmc: mybmc = '[{}]'.format(mybmc) launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url']) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index 0f2cd5ae..03edd4a6 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -1526,6 +1526,9 @@ class IpmiHandler(object): launchdata = self.ipmicmd.get_ikvm_launchdata() if 'url' in launchdata and not launchdata['url'].startswith('https://'): mybmc = self.ipmicmd.confluentbmcname + if mybmc.startswith('fe80::'): # link local, need to adjust + lancfg = self.ipmicmd.get_net_configuration() + mybmc = lancfg['ipv4_address'].split('/')[0] if ':' in mybmc and not '[' in mybmc: mybmc = '[{}]'.format(mybmc) launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url'])