diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 41f22490..9cd0b946 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -250,6 +250,18 @@ class Command(object): 'persistent': persistent, 'uefimode': uefimode} + def reseat_bay(self, bay): + """Request the reseat of a bay + + Request the enclosure manager to reseat the system in a particular + bay. + + :param bay: The bay identifier to reseat + :return: + """ + self.oem_init() + self._oem.reseat_bay(bay) + def set_power(self, powerstate, wait=False): """Request power state change (helper) diff --git a/pyghmi/ipmi/oem/generic.py b/pyghmi/ipmi/oem/generic.py index e50defd0..62f925ae 100644 --- a/pyghmi/ipmi/oem/generic.py +++ b/pyghmi/ipmi/oem/generic.py @@ -202,6 +202,10 @@ class OEMHandler(object): raise exc.UnsupportedFunctionality( 'Firmware update not supported on this platform') + def reseat_bay(self, bay): + raise exc.UnsupportedFunctionality( + 'Bay reseat not supported on this platform') + def get_graphical_console(self): """Get graphical console launcher""" return () diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index c7b52e86..ae5d8514 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -247,6 +247,11 @@ class OEMHandler(generic.OEMHandler): event['component_type_id'] == 13): event['component'] += ' {0}'.format(evdata[1] & 0b11111) + def reseat_bay(self, bay): + if self.is_fpc: + return self.smmhandler.reseat_bay(bay) + return super(OEMHandler, self).reseat_bay(bay) + def get_ntp_enabled(self): if self.has_tsm: ntpres = self.ipmicmd.xraw_command(netfn=0x32, command=0xa7) diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index ef993e04..7bc06348 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -240,6 +240,10 @@ class SMMClient(object): self.password = ipmicmd.ipmi_session.password self._wc = None + def reseat_bay(self, bay): + self.ipmicmd.xraw_command(netfn=0x32, command=0xa4, + data=[int(bay), 2]) + def process_fru(self, fru): # TODO(jjohnson2): can also get EIOM, SMM, and riser data if warranted fru['Serial Number'] = self.ipmicmd.xraw_command(