diff --git a/proliantutils/redfish/redfish.py b/proliantutils/redfish/redfish.py index 77bb38e9..43cf118c 100644 --- a/proliantutils/redfish/redfish.py +++ b/proliantutils/redfish/redfish.py @@ -625,6 +625,9 @@ class RedfishOperations(operations.IloOperations): 'sriov_enabled', sushy_system.bios_settings.sriov == sys_cons.SRIOV_ENABLED ), + ('cpu_vt', + sushy_system.bios_settings.cpu_vt == ( + sys_cons.CPUVT_ENABLED)), ('trusted_boot', (tpm_state == sys_cons.TPM_PRESENT_ENABLED or tpm_state == sys_cons.TPM_PRESENT_DISABLED)), diff --git a/proliantutils/redfish/resources/system/bios.py b/proliantutils/redfish/resources/system/bios.py index 92da3544..8f0be15d 100644 --- a/proliantutils/redfish/resources/system/bios.py +++ b/proliantutils/redfish/resources/system/bios.py @@ -41,6 +41,9 @@ class BIOSSettings(base.ResourceBase): tpm_state = base.MappedField(["Attributes", "TpmState"], mappings.TPM_MAP) + cpu_vt = base.MappedField(["Attributes", "ProcVirtualization"], + mappings.CPUVT_MAP) + _pending_settings = None _boot_settings = None _base_configs = None diff --git a/proliantutils/redfish/resources/system/constants.py b/proliantutils/redfish/resources/system/constants.py index 81e20e66..3ac25a0c 100644 --- a/proliantutils/redfish/resources/system/constants.py +++ b/proliantutils/redfish/resources/system/constants.py @@ -50,3 +50,8 @@ SECUREBOOT_RESET_KEYS_DELETE_PK = 'delete pk' TPM_PRESENT_ENABLED = 'Tpm present enabled' TPM_PRESENT_DISABLED = 'Tpm present disabled' TPM_NOT_PRESENT = 'Tpm not present' + +# BIOS Cpu Virtualisation contants + +CPUVT_ENABLED = 'cpu_vt enabled' +CPUVT_DISABLED = 'cpu_vt disabled' diff --git a/proliantutils/redfish/resources/system/mappings.py b/proliantutils/redfish/resources/system/mappings.py index 40769784..70d6ddef 100644 --- a/proliantutils/redfish/resources/system/mappings.py +++ b/proliantutils/redfish/resources/system/mappings.py @@ -64,3 +64,8 @@ TPM_MAP = { 'PresentDisabled': constants.TPM_PRESENT_DISABLED, 'NotPresent': constants.TPM_NOT_PRESENT } + +CPUVT_MAP = { + 'Enabled': constants.CPUVT_ENABLED, + 'Disabled': constants.CPUVT_DISABLED +} diff --git a/proliantutils/tests/redfish/resources/system/test_bios.py b/proliantutils/tests/redfish/resources/system/test_bios.py index c38fb913..cef1c766 100644 --- a/proliantutils/tests/redfish/resources/system/test_bios.py +++ b/proliantutils/tests/redfish/resources/system/test_bios.py @@ -43,6 +43,8 @@ class BIOSSettingsTestCase(testtools.TestCase): self.bios_inst.boot_mode) self.assertEqual(sys_cons.SRIOV_ENABLED, self.bios_inst.sriov) + self.assertEqual(sys_cons.CPUVT_ENABLED, + self.bios_inst.cpu_vt) def test_pending_settings(self): self.assertIsNone(self.bios_inst._pending_settings) diff --git a/proliantutils/tests/redfish/test_redfish.py b/proliantutils/tests/redfish/test_redfish.py index c7a9fe2c..a7e4968b 100644 --- a/proliantutils/tests/redfish/test_redfish.py +++ b/proliantutils/tests/redfish/test_redfish.py @@ -655,6 +655,8 @@ class RedfishOperationsTestCase(testtools.TestCase): [mock.MagicMock(spec=pci_device.PCIDevice)]) type(get_system_mock.return_value.bios_settings).sriov = ( sys_cons.SRIOV_ENABLED) + type(get_system_mock.return_value.bios_settings).cpu_vt = ( + sys_cons.CPUVT_ENABLED) type(get_system_mock.return_value.secure_boot).current_boot = ( sys_cons.SECUREBOOT_CURRENT_BOOT_ENABLED) type(get_system_mock.return_value).rom_version = ( @@ -669,7 +671,7 @@ class RedfishOperationsTestCase(testtools.TestCase): tpm_mock) actual = self.rf_client.get_server_capabilities() expected = {'pci_gpu_devices': 1, 'sriov_enabled': 'true', - 'secure_boot': 'true', + 'secure_boot': 'true', 'cpu_vt': 'true', 'rom_firmware_version': 'U31 v1.00 (03/11/2017)', 'ilo_firmware_version': 'iLO 5 v1.15', 'nic_capacity': '1Gb', @@ -690,6 +692,8 @@ class RedfishOperationsTestCase(testtools.TestCase): [mock.MagicMock(spec=pci_device.PCIDevice)]) type(get_system_mock.return_value.bios_settings).sriov = ( sys_cons.SRIOV_DISABLED) + type(get_system_mock.return_value.bios_settings).cpu_vt = ( + sys_cons.CPUVT_DISABLED) type(get_system_mock.return_value.secure_boot).current_boot = ( sys_cons.SECUREBOOT_CURRENT_BOOT_DISABLED) type(get_system_mock.return_value).rom_version = (