Add GPU expansion support for HP_ProLiant_BL460c_Gen10_Graphics_Exp

This commit is contained in:
Cyril Levis 2020-08-26 10:45:31 +02:00
commit 00c778d3bf
No known key found for this signature in database
GPG key ID: 8538D68543979A20
7 changed files with 2006 additions and 6 deletions

View file

@ -67,3 +67,29 @@ class DellHost(ServerBase):
break
return value
def get_expansion_product(self):
"""
Get the extension slot that is on a pair slot number
next to the compute slot that is on an odd slot number
"""
raise NotImplementedError
def is_expansion_slot(self, server):
"""
Return True if its an extension slot
"""
raise NotImplementedError
def get_blade_expansion_slot(self):
"""
Expansion slot are always the compute bay number + 1
"""
raise NotImplementedError
def own_expansion_slot(self):
"""
Say if the device can host an extension card based
on the product name
"""
raise NotImplementedError

View file

@ -21,3 +21,29 @@ class GenericHost(ServerBase):
def get_chassis_service_tag(self):
return self.get_service_tag()
def get_expansion_product(self):
"""
Get the extension slot that is on a pair slot number
next to the compute slot that is on an odd slot number
"""
raise NotImplementedError
def is_expansion_slot(self, server):
"""
Return True if its an extension slot
"""
raise NotImplementedError
def get_blade_expansion_slot(self):
"""
Expansion slot are always the compute bay number + 1
"""
raise NotImplementedError
def own_expansion_slot(self):
"""
Say if the device can host an extension card based
on the product name
"""
raise NotImplementedError

View file

@ -11,12 +11,9 @@ class HPHost(ServerBase):
self.hp_rack_locator = self._find_rack_locator()
def is_blade(self):
if self.product.startswith("ProLiant BL"):
return True
elif self.product.startswith("ProLiant m") and self.product.endswith("Server Cartridge"):
return True
else:
return False
blade = self.product.startswith("ProLiant BL")
blade |= self.product.startswith("ProLiant m") and self.product.endswith("Server Cartridge")
return blade
def _find_rack_locator(self):
"""
@ -68,3 +65,36 @@ class HPHost(ServerBase):
if self.is_blade():
return self.hp_rack_locator["Enclosure Serial"].strip()
return self.get_service_tag()
def get_expansion_product(self):
"""
Get the extension slot that is on a pair slot number
next to the compute slot that is on an odd slot number
I only know on model of slot GPU extension card that.
"""
if self.own_expansion_slot():
return "ProLiant BL460c Graphics Expansion Blade"
return None
def is_expansion_slot(self, server):
"""
Return True if its an extension slot, based on the name
"""
return server.name.endswith(" expansion")
def get_blade_expansion_slot(self):
"""
Expansion slot are always the compute bay number + 1
"""
if self.is_blade() and self.own_expansion_slot():
return 'Bay {}'.format(
str(int(self.hp_rack_locator['Server Bay'].strip()) + 1)
)
return None
def own_expansion_slot(self):
"""
Say if the device can host an extension card based
on the product name
"""
return self.get_product_name().endswith('Graphics Exp')

View file

@ -63,3 +63,30 @@ class SupermicroHost(ServerBase):
if not self.is_blade():
return None
return 'Chassis {}'.format(self.get_chassis_service_tag())
def get_expansion_product(self):
"""
Get the extension slot that is on a pair slot number
next to the compute slot that is on an odd slot number
I only know on model of slot GPU extension card that.
"""
raise NotImplementedError
def is_expansion_slot(self, server):
"""
Return True if its an extension slot, based on the name
"""
raise NotImplementedError
def get_blade_expansion_slot(self):
"""
Expansion slot are always the compute bay number + 1
"""
raise NotImplementedError
def own_expansion_slot(self):
"""
Say if the device can host an extension card based
on the product name
"""
raise NotImplementedError