diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 62c9d741..c5f031dd 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1726,3 +1726,7 @@ class Command(object): """ self.oem_init() self._oem.attach_remote_media(url, username, password) + + def detach_remote_media(self): + self.oem_init() + self._oem.detach_remote_media() diff --git a/pyghmi/ipmi/oem/generic.py b/pyghmi/ipmi/oem/generic.py index 5d7e84eb..c31740ed 100644 --- a/pyghmi/ipmi/oem/generic.py +++ b/pyghmi/ipmi/oem/generic.py @@ -224,5 +224,8 @@ class OEMHandler(object): """ return + def detach_remote_media(self): + raise exc.UnsupportedFunctionality() + def attach_remote_media(self, imagename, username, password): raise exc.UnsupportedFunctionality() diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 0949e2d3..ee757172 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -676,3 +676,9 @@ class OEMHandler(generic.OEMHandler): imagename, domain, path, host) else: raise + + def detach_remote_media(self): + if self.has_megarac: + self.ipmicmd.xraw_command( + netfn=0x32, command=0x9f, data=(8, 10, 0, 0)) + self.ipmicmd.xraw_command(netfn=0x32, command=0x9f, data=(8, 11))