diff --git a/os_win/tests/unit/utils/compute/test_vmutils.py b/os_win/tests/unit/utils/compute/test_vmutils.py index 23df36f6..13409781 100644 --- a/os_win/tests/unit/utils/compute/test_vmutils.py +++ b/os_win/tests/unit/utils/compute/test_vmutils.py @@ -1272,6 +1272,13 @@ class VMUtilsTestCase(test_base.OsWinBaseTestCase): self._vmutils._jobutils.stop_jobs.assert_called_once_with( mock_vm, None) + @mock.patch.object(vmutils.VMUtils, '_modify_virtual_system') + def test_set_allow_full_scsi_command_set(self, mock_modify_virtual_system): + mock_vm = self._lookup_vm() + self._vmutils.enable_vm_full_scsi_command_set(mock.sentinel.vm_name) + self.assertTrue(mock_vm.AllowFullSCSICommandSet) + mock_modify_virtual_system.assert_called_once_with(mock_vm) + def test_set_secure_boot(self): vs_data = mock.MagicMock() self._vmutils._set_secure_boot(vs_data, msft_ca_required=False) diff --git a/os_win/utils/compute/vmutils.py b/os_win/utils/compute/vmutils.py index abcf451f..007a03d5 100644 --- a/os_win/utils/compute/vmutils.py +++ b/os_win/utils/compute/vmutils.py @@ -880,6 +880,18 @@ class VMUtils(baseutils.BaseUtilsVirt): raise exceptions.HyperVException( _("Exceeded the maximum number of slots")) + def enable_vm_full_scsi_command_set(self, vm_name): + """Enables the full SCSI command set for the instance + with the given name. + + :param vm_name: The name of the VM for which AllowFullSCSICommandSet + will be enabled. + """ + + vs_data = self._lookup_vm_check(vm_name) + vs_data.AllowFullSCSICommandSet = True + self._modify_virtual_system(vs_data) + def _get_vm_serial_ports(self, vmsettings): rasds = _wqlutils.get_element_associated_class( self._compat_conn, self._SERIAL_PORT_SETTING_DATA_CLASS,