diff --git a/confluent_client/bin/nodeconfig b/confluent_client/bin/nodeconfig index 4d3d17f3..1033e72e 100755 --- a/confluent_client/bin/nodeconfig +++ b/confluent_client/bin/nodeconfig @@ -1,7 +1,7 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2017 Lenovo +# Copyright 2025 Lenovo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -96,6 +96,12 @@ cfgpaths = { 'bmc.static_ipv6_gateway': ( 'configuration/management_controller/net_interfaces/management', 'static_v6_gateway'), + 'bmc.vlan_id': ( + 'configuration/management_controller/net_interfaces/management', + 'vlan_id'), + 'bmc.mac_address': ( + 'configuration/management_controller/net_interfaces/management', + 'hw_addr'), 'bmc.hostname': ( 'configuration/management_controller/hostname', 'hostname'), } diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 04ca43f7..1df368ff 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -1148,6 +1148,9 @@ class InputNetworkConfiguration(ConfluentInputMessage): if 'ipv4_gateway' not in inputdata: inputdata['ipv4_gateway'] = None + if 'vlan_id' not in inputdata: + inputdata['vlan_id'] = None + if 'ipv4_configuration' in inputdata and inputdata['ipv4_configuration']: if inputdata['ipv4_configuration'].lower() not in ['dhcp','static']: raise exc.InvalidArgumentException( @@ -1736,8 +1739,8 @@ class NetworkConfiguration(ConfluentMessage): desc = 'Network configuration' def __init__(self, name=None, ipv4addr=None, ipv4gateway=None, - ipv4cfgmethod=None, hwaddr=None, staticv6addrs=(), staticv6gateway=None): - self.myargs = (name, ipv4addr, ipv4gateway, ipv4cfgmethod, hwaddr) + ipv4cfgmethod=None, hwaddr=None, staticv6addrs=(), staticv6gateway=None, vlan_id=None): + self.myargs = (name, ipv4addr, ipv4gateway, ipv4cfgmethod, hwaddr, staticv6addrs, staticv6gateway, vlan_id) self.notnode = name is None self.stripped = False v6addrs = ','.join(staticv6addrs) @@ -1748,7 +1751,8 @@ class NetworkConfiguration(ConfluentMessage): 'ipv4_configuration': {'value': ipv4cfgmethod}, 'hw_addr': {'value': hwaddr}, 'static_v6_addresses': {'value': v6addrs}, - 'static_v6_gateway': {'value': staticv6gateway} + 'static_v6_gateway': {'value': staticv6gateway}, + 'vlan_id': {'value': vlan_id} } if self.notnode: self.kvpairs = kvpairs diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 38119dd6..76fca095 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -773,6 +773,7 @@ class IpmiHandler(object): hwaddr=lancfg['mac_address'], staticv6addrs=v6cfg.get('static_addrs', ''), staticv6gateway=v6cfg.get('static_gateway', ''), + vlan_id=lancfg.get('vlan_id', None) )) elif self.op == 'update': config = self.inputdata.netconfig(self.node) @@ -780,7 +781,8 @@ class IpmiHandler(object): self.ipmicmd.set_net_configuration( ipv4_address=config['ipv4_address'], ipv4_configuration=config['ipv4_configuration'], - ipv4_gateway=config['ipv4_gateway']) + ipv4_gateway=config['ipv4_gateway'], + vlan_id=config.get('vlan_id', None)) v6addrs = config.get('static_v6_addresses', None) if v6addrs is not None: v6addrs = v6addrs.split(',') diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index bb709b40..0334696f 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -632,7 +632,8 @@ class IpmiHandler(object): ipv4cfgmethod=lancfg['ipv4_configuration'], hwaddr=lancfg['mac_address'], staticv6addrs=v6cfg['static_addrs'], - staticv6gateway=v6cfg['static_gateway'] + staticv6gateway=v6cfg['static_gateway'], + vlan_id=lancfg.get('vlan_id', None) )) elif self.op == 'update': config = self.inputdata.netconfig(self.node) @@ -640,7 +641,8 @@ class IpmiHandler(object): self.ipmicmd.set_net_configuration( ipv4_address=config['ipv4_address'], ipv4_configuration=config['ipv4_configuration'], - ipv4_gateway=config['ipv4_gateway']) + ipv4_gateway=config['ipv4_gateway'], + vlan_id=config.get('vlan_id', None)) v6addrs = config.get('static_v6_addresses', None) if v6addrs is not None: v6addrs = v6addrs.split(',')