From fd3195e7232cc4de6123f2fbcd6cfb462312219b Mon Sep 17 00:00:00 2001 From: Kambiz Aghaiepour Date: Tue, 10 Mar 2020 14:28:25 -0400 Subject: [PATCH] Add support for blade centers assuming the naming convention is followed as : rack-uloc-blade-type.domain where "blade" would be 000 for single system chassis systems, while for bladecenters such as the fx2 chassis from Dell would use values of "b01", "b02", etc. This patch will extend the idrac_interfaces lookups to differentiate between each blade and will require a distinct entry for each for the "foreman" and "director" types. For example, if you have hosts with these names: f01-h20-b01-fc640.example.com f01-h20-b02-fc640.example.com Then you will also likely want to have the following entries in your idrac_interfaces.yml file: director_fc640_b01_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 director_fc640_b02_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 foreman_fc640_b01_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.8-1-1 foreman_fc640_b02_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.4-1-1 the reason is that the shared IO modules map interfaces to different PCI slots from the host perspective, and as such the boot devices will be different depending on which blade you're working with. If the hostname contains the 000 instead, then we don't alter the director and foreman entries (i.e. no suffix is added). Fixes: https://github.com/redhat-performance/quads/issues/319 Change-Id: I84821bcdc8e768c6e1eb1c2c58c10f2e8a10e57e --- conf/idrac_interfaces.yml | 8 ++++++++ quads/config.py | 2 +- quads/tools/badfish.py | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/conf/idrac_interfaces.yml b/conf/idrac_interfaces.yml index a66fb03a0..f901da2a5 100644 --- a/conf/idrac_interfaces.yml +++ b/conf/idrac_interfaces.yml @@ -5,6 +5,10 @@ # # Also see /opt/quads/quads/config.py SUPPORTED list if adding system types. # +director_fc640_b01_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 +director_fc640_b02_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 +director_fc640_b03_interfaces: NIC.ChassisSlot.6-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 +director_fc640_b04_interfaces: NIC.ChassisSlot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1 director_r620_interfaces: NIC.Slot.2-4,HardDisk.List.1-1,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3,NIC.Integrated.1-3-1 director_r630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1 director_r640_interfaces: NIC.Slot.3-1,HardDisk.List.1-1,NIC.Slot.3-2,NIC.Integrated.1-1-1 @@ -12,6 +16,10 @@ director_r720xd_interfaces: NIC.Slot.4-2-1,HardDisk.List.1-1,NIC.Integrated.1-3- director_r730xd_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1 director_r740xd_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Integrated.1-3-1 director_r930_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1 +foreman_fc640_b01_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.8-1-1 +foreman_fc640_b02_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.4-1-1 +foreman_fc640_b03_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.6-1-1 +foreman_fc640_b04_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.2-1-1 foreman_r620_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3 foreman_r630_interfaces: NIC.Slot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-2-1 foreman_r640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Slot.3-1,NIC.Slot.3-2 diff --git a/quads/config.py b/quads/config.py index fd4f28e76..d51e871de 100644 --- a/quads/config.py +++ b/quads/config.py @@ -26,7 +26,7 @@ def quads_load_config(quads_config): QUADSVERSION = "1.1.2" QUADSCODENAME = "gaúcho" -SUPPORTED = ["r620", "r630", "r640", "r720", "r730xd", "r930", "r730", "r740xd", "r720xd"] +SUPPORTED = ["fc640", "r620", "r630", "r640", "r720", "r730xd", "r930", "r730", "r740xd", "r720xd"] SUPERMICRO = ["1029p", "1029u", "1028r", "6029p", "6018r", "6048r", "5039ms", "6049p"] OFFSETS = {"em1": 0, "em2": 1, "em3": 2, "em4": 3} TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "templates") diff --git a/quads/tools/badfish.py b/quads/tools/badfish.py index 4bde52427..bae27c92d 100755 --- a/quads/tools/badfish.py +++ b/quads/tools/badfish.py @@ -254,6 +254,9 @@ async def get_host_type(self, _interfaces_path): raise BadfishException host_model = self.host.split(".")[0].split("-")[-1] + host_blade = self.host.split(".")[0].split("-")[-2] + if host_blade != "000": + host_model = "%s_%s" % (host_model, host_blade) interfaces = {} for _host in ["foreman", "director"]: match = True @@ -386,6 +389,9 @@ async def change_boot_order(self, _interfaces_path, _host_type): raise BadfishException host_model = self.host.split(".")[0].split("-")[-1] + host_blade = self.host.split(".")[0].split("-")[-2] + if host_blade != "000": + host_model = "%s_%s" % (host_model, host_blade) interfaces = definitions["%s_%s_interfaces" % (_host_type, host_model)].split(",") boot_devices = await self.get_boot_devices() @@ -784,5 +790,8 @@ def get_host_type_boot_device(self, host_type, _interfaces_path): raise BadfishException host_model = self.host.split(".")[0].split("-")[-1] + host_blade = self.host.split(".")[0].split("-")[-2] + if host_blade != "000": + host_model = "%s_%s" % (host_model, host_blade) return definitions["%s_%s_interfaces" % (host_type, host_model)].split(",")[0] return None