From 1aea2040d0ca49699204559213a2521203d1f00f Mon Sep 17 00:00:00 2001 From: Mudit Date: Mon, 1 Feb 2021 05:50:32 -0500 Subject: [PATCH] More GPU support in idrac-wsman inspect interface Enhance idrac wsman inspect interface to report an additional GPU device, namely GV100GL [Tesla V100 PCIe 16GB]. Story: 2008552 Task: 41682 Change-Id: I368180a15bfa7d166d35cef4cdf9741e787046e8 --- ironic/drivers/modules/drac/inspect.py | 3 +- .../unit/drivers/modules/drac/test_inspect.py | 54 ++++++++++++++++++- ...add-more-gpu-support-c3e24d8471ed6759.yaml | 9 ++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/idrac-add-more-gpu-support-c3e24d8471ed6759.yaml diff --git a/ironic/drivers/modules/drac/inspect.py b/ironic/drivers/modules/drac/inspect.py index 77e48226fc..3218b3557c 100644 --- a/ironic/drivers/modules/drac/inspect.py +++ b/ironic/drivers/modules/drac/inspect.py @@ -49,7 +49,8 @@ class DracRedfishInspect(redfish_inspect.RedfishInspect): class DracWSManInspect(base.InspectInterface): - _GPU_SUPPORTED_LIST = {"TU104GL [Tesla T4]"} + _GPU_SUPPORTED_LIST = {"TU104GL [Tesla T4]", + "GV100GL [Tesla V100 PCIe 16GB]"} def get_properties(self): """Return the properties of the interface. diff --git a/ironic/tests/unit/drivers/modules/drac/test_inspect.py b/ironic/tests/unit/drivers/modules/drac/test_inspect.py index ecb9346f24..64dc6d39f6 100644 --- a/ironic/tests/unit/drivers/modules/drac/test_inspect.py +++ b/ironic/tests/unit/drivers/modules/drac/test_inspect.py @@ -287,7 +287,57 @@ class DracInspectionTestCase(test_utils.BaseDracTest): 'pci_subdevice_id': '0737', 'pci_subvendor_id': '1028'}, {'id': 'Video.Slot.7-1', - 'description': 'GV100GL [Tesla V100 PCIe 16GB]]', + 'description': 'GV100 [TITAN V]', + 'function_number': 0, + 'manufacturer': 'NVIDIA Corporation', + 'pci_device_id': '1D81', + 'pci_vendor_id': '10DE', + 'pci_subdevice_id': '1214', + 'pci_subvendor_id': '10DE'}] + + expected_node_properties = { + 'memory_mb': 32768, + 'local_gb': 279, + 'cpus': 18, + 'cpu_arch': 'x86_64', + 'capabilities': 'boot_mode:uefi,pci_gpu_devices:0'} + mock_client = mock.Mock() + mock_get_drac_client.return_value = mock_client + mock_client.list_memory.return_value = self.memory + mock_client.list_cpus.return_value = self.cpus + mock_client.list_virtual_disks.return_value = [] + mock_client.list_physical_disks.return_value = self.physical_disks + mock_client.list_nics.return_value = self.nics + mock_client.list_bios_settings.return_value = self.uefi_boot_settings + video_controllers = [test_utils.dict_to_namedtuple(values=vc) + for vc in controllers] + mock_client.list_video_controllers.return_value = video_controllers + + with task_manager.acquire(self.context, self.node.uuid, + shared=True) as task: + return_value = task.driver.inspect.inspect_hardware(task) + + self.node.refresh() + self.assertEqual(expected_node_properties, self.node.properties) + self.assertEqual(states.MANAGEABLE, return_value) + self.assertEqual(2, mock_port_create.call_count) + + @mock.patch.object(drac_common, 'get_drac_client', spec_set=True, + autospec=True) + @mock.patch.object(objects.Port, 'create', spec_set=True, autospec=True) + def test_inspect_hardware_multiple_supported_gpu(self, mock_port_create, + mock_get_drac_client): + controllers = [ + {'id': 'Video.Slot.7-1', + 'description': 'TU104GL [Tesla T4]', + 'function_number': 0, + 'manufacturer': 'NVIDIA Corporation', + 'pci_device_id': '1EB8', + 'pci_vendor_id': '10DE', + 'pci_subdevice_id': '12A2', + 'pci_subvendor_id': '10DE'}, + {'id': 'Video.Slot.8-1', + 'description': 'GV100GL [Tesla V100 PCIe 16GB]', 'function_number': 0, 'manufacturer': 'NVIDIA Corporation', 'pci_device_id': '1DB4', @@ -300,7 +350,7 @@ class DracInspectionTestCase(test_utils.BaseDracTest): 'local_gb': 279, 'cpus': 18, 'cpu_arch': 'x86_64', - 'capabilities': 'boot_mode:uefi,pci_gpu_devices:0'} + 'capabilities': 'boot_mode:uefi,pci_gpu_devices:2'} mock_client = mock.Mock() mock_get_drac_client.return_value = mock_client mock_client.list_memory.return_value = self.memory diff --git a/releasenotes/notes/idrac-add-more-gpu-support-c3e24d8471ed6759.yaml b/releasenotes/notes/idrac-add-more-gpu-support-c3e24d8471ed6759.yaml new file mode 100644 index 0000000000..0b9b270e3d --- /dev/null +++ b/releasenotes/notes/idrac-add-more-gpu-support-c3e24d8471ed6759.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Enhance ``idrac-wsman`` inspect hardware interface to report an additional + GPU device namely GV100GL [Tesla V100 PCIe 16GB]. With this enhancement, + following GPU devices are reported + + * TU104GL [Tesla T4] + * GV100GL [Tesla V100 PCIe 16GB]