inspect.py (ironic-17.0.2) | : | inspect.py (ironic-17.0.3) | ||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
from oslo_utils import importutils | from oslo_utils import importutils | |||
from oslo_utils import units | from oslo_utils import units | |||
from ironic.common import boot_modes | from ironic.common import boot_modes | |||
from ironic.common import exception | from ironic.common import exception | |||
from ironic.common.i18n import _ | from ironic.common.i18n import _ | |||
from ironic.common import states | from ironic.common import states | |||
from ironic.common import utils | from ironic.common import utils | |||
from ironic.drivers import base | from ironic.drivers import base | |||
from ironic.drivers.modules.drac import common as drac_common | from ironic.drivers.modules.drac import common as drac_common | |||
from ironic.drivers.modules.drac import utils as drac_utils | ||||
from ironic.drivers.modules import inspect_utils | from ironic.drivers.modules import inspect_utils | |||
from ironic.drivers.modules.redfish import inspect as redfish_inspect | from ironic.drivers.modules.redfish import inspect as redfish_inspect | |||
from ironic.drivers.modules.redfish import utils as redfish_utils | from ironic.drivers.modules.redfish import utils as redfish_utils | |||
from ironic import objects | from ironic import objects | |||
drac_exceptions = importutils.try_import('dracclient.exceptions') | drac_exceptions = importutils.try_import('dracclient.exceptions') | |||
sushy = importutils.try_import('sushy') | sushy = importutils.try_import('sushy') | |||
LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | |||
skipping to change at line 120 | skipping to change at line 121 | |||
pxe_port_macs.append(mac_address) | pxe_port_macs.append(mac_address) | |||
elif system.boot.mode == boot_modes.LEGACY_BIOS: | elif system.boot.mode == boot_modes.LEGACY_BIOS: | |||
# When a server is in BIOS boot mode, whether or not a | # When a server is in BIOS boot mode, whether or not a | |||
# NIC port is set to PXE boot is stored on the NIC port | # NIC port is set to PXE boot is stored on the NIC port | |||
# itself internally to the BMC. Getting this information | # itself internally to the BMC. Getting this information | |||
# requires using an OEM extension to export the system | # requires using an OEM extension to export the system | |||
# configuration, as the redfish standard does not specify | # configuration, as the redfish standard does not specify | |||
# how to get it, and Dell does not have OEM redfish calls | # how to get it, and Dell does not have OEM redfish calls | |||
# to selectively retrieve it at this time. | # to selectively retrieve it at this time. | |||
# Get instance of Sushy OEM manager object | # Get instance of Sushy OEM manager object | |||
pxe_port_macs_list = drac_utils.execute_oem_manager_method( | ||||
task, 'get PXE port MAC addresses', | ||||
lambda m: m.get_pxe_port_macs_bios(ethernet_interfaces_mac)) | ||||
pxe_port_macs = [mac for mac in pxe_port_macs_list] | ||||
for manager in system.managers: | ||||
try: | ||||
# Get instance of Sushy OEM manager object | ||||
oem_manager = manager.get_oem_extension('Dell') | ||||
except sushy.exceptions.OEMExtensionNotFoundError as e: | ||||
error_msg = (_("Search for Sushy OEM extension package " | ||||
"'sushy-oem-idrac' failed for node " | ||||
"%(node)s. Ensure it's installed. " | ||||
" Error: %(error)s") % | ||||
{'node': task.node.uuid, 'error': e}) | ||||
LOG.error(error_msg) | ||||
raise exception.RedfishError(error=error_msg) | ||||
try: | ||||
pxe_port_macs_list = oem_manager.get_pxe_port_macs_bios( | ||||
ethernet_interfaces_mac) | ||||
pxe_port_macs = [mac for mac in pxe_port_macs_list] | ||||
return pxe_port_macs | ||||
except sushy.exceptions.OEMExtensionNotFoundError as e: | ||||
error_msg = (_("Search for Sushy OEM extension package " | ||||
"'sushy-oem-idrac' failed for node " | ||||
" %(node)s. Ensure it is installed. " | ||||
"Error: %(error)s") % | ||||
{'node': task.node.uuid, 'error': e}) | ||||
LOG.debug(error_msg) | ||||
continue | ||||
LOG.info("Get pxe port MAC addresses for %(node)s via OEM", | ||||
{'node': task.node.uuid}) | ||||
break | ||||
else: | ||||
error_msg = (_('iDRAC Redfish Get pxe port MAC addresse ' | ||||
'failed for node %(node)s, because system ' | ||||
'%(system)s has no ' | ||||
'manager%(no_manager)s.') % | ||||
{'node': task.node.uuid, | ||||
'system': system.uuid if system.uuid else | ||||
system.identity, | ||||
'no_manager': '' if not system.managers else | ||||
' which could'}) | ||||
LOG.error(error_msg) | ||||
raise exception.RedfishError(error=error_msg) | ||||
return pxe_port_macs | return pxe_port_macs | |||
class DracWSManInspect(base.InspectInterface): | class DracWSManInspect(base.InspectInterface): | |||
_GPU_SUPPORTED_LIST = {"TU104GL [Tesla T4]", | _GPU_SUPPORTED_LIST = {"TU104GL [Tesla T4]", | |||
"GV100GL [Tesla V100 PCIe 16GB]"} | "GV100GL [Tesla V100 PCIe 16GB]"} | |||
def get_properties(self): | def get_properties(self): | |||
"""Return the properties of the interface. | """Return the properties of the interface. | |||
End of changes. 3 change blocks. | ||||
41 lines changed or deleted | 5 lines changed or added |