Alona Kaplan has uploaded a new change for review.

Change subject: engine: introduce UpdateHostNicVfsConfigCommand
......................................................................

engine: introduce UpdateHostNicVfsConfigCommand

This command is responsible for updating VFs config of an sr-iov
enabled nic.
This patch contains-
1. VfsConfigValidator
2. canDoAction section for UpdateHostNicVfsConfigCommand
3. commented code for updating num of vfs (will be implemented in a future
patch).
4. updating the db with isAllNetworksAllowed

Change-Id: I868d58b291c3920f6cf966a409a11a06498854b1
Signed-off-by: Alona Kaplan <alkap...@redhat.com>
---
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommand.java
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfsConfigCommandBase.java
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java
A 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommandTest.java
A 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VfsConfigValidatorTest.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/UpdateHostNicVfsConfigParameters.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VfsConfigBaseParameters.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
14 files changed, 738 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/43/36843/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommand.java
new file mode 100644
index 0000000..bb57834
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommand.java
@@ -0,0 +1,102 @@
+package org.ovirt.engine.core.bll.network.host;
+
+import java.util.Collections;
+
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.context.CommandContext;
+import org.ovirt.engine.core.common.AuditLogType;
+import org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters;
+import org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.compat.Guid;
+
+@NonTransactiveCommandAttribute
+public class UpdateHostNicVfsConfigCommand extends 
VfsConfigCommandBase<UpdateHostNicVfsConfigParameters> {
+
+    public UpdateHostNicVfsConfigCommand(UpdateHostNicVfsConfigParameters 
parameters) {
+        this(parameters, null);
+    }
+
+    public UpdateHostNicVfsConfigCommand(UpdateHostNicVfsConfigParameters 
parameters, CommandContext commandContext) {
+        super(parameters, commandContext);
+    }
+
+    @Override
+    protected void executeCommand() {
+        boolean result = true;
+        HostNicVfsConfig oldVfsConfig = getVfsConfig();
+        boolean allNetworksAllowedChanged = isAllNetworksAllowed() != 
oldVfsConfig.isAllNetworksAllowed();
+
+        super.executeCommand();
+
+        // Check if 'allNetworksAllowed' has changed
+        if (allNetworksAllowedChanged) {
+
+            oldVfsConfig.setAllNetworksAllowed(isAllNetworksAllowed());
+
+            if (isAllNetworksAllowed()) {
+                oldVfsConfig.setNetworks(Collections.<Guid> emptySet());
+                oldVfsConfig.setLabels(Collections.<String> emptySet());
+            }
+        }
+
+        if (wasNumOfVfsChanged()) {
+            // Run Vds Command
+            // VDSReturnValue retrunValue = 
runVdsCommand(VDSCommandType.UpdateNumOfVfs,
+            // new UpdateHostNicVfsConfigVDSParameters());
+            // result = retrunValue.getSucceeded();
+            // if (result) {
+            result = updateNumOfVfs(oldVfsConfig);
+            // }
+        } else {
+            // Check if 'allNetworksAllowed' has changed
+            if (allNetworksAllowedChanged) {
+                getVfsConfigDao().update(oldVfsConfig);
+            }
+        }
+
+        setSucceeded(result);
+    }
+
+    private boolean updateNumOfVfs(HostNicVfsConfig vfsConfig) {
+        // save the new VFs topology to DB
+        // runVdsCommand(VDSCommandType.HostdevListByCaps,
+        // new HostdevListByCapsCommandParameters(vfsConfig));
+        return true;
+    }
+
+    @Override
+    protected boolean canDoAction() {
+        boolean isValid = super.canDoAction();
+        if (isValid && wasNumOfVfsChanged()) {
+            isValid = validate(getVfsConfigValidator().allVfsAreFree())
+                    && 
validate(getVfsConfigValidator().numOfVfsInValidRange(getNumOfVfs()));
+        }
+
+        return isValid;
+    }
+
+    boolean wasNumOfVfsChanged() {
+        return getVfsConfig().getNumOfVfs() != getNumOfVfs();
+    }
+
+    @Override
+    public AuditLogType getAuditLogTypeValue() {
+        return getSucceeded() ? AuditLogType.UPDATE_HOST_NIC_VFS_CONFIG
+                : AuditLogType.UPDATE_HOST_NIC_VFS_CONFIG_FAILED;
+    }
+
+    @Override
+    protected void setActionMessageParameters() {
+        addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE);
+        addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST_NIC_VFS_CONFIG);
+    }
+
+    private int getNumOfVfs() {
+        return getParameters().getNumOfVfs();
+    }
+
+    private boolean isAllNetworksAllowed() {
+        return getParameters().getAllNetworksAllowed();
+    }
+}
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfsConfigCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfsConfigCommandBase.java
new file mode 100644
index 0000000..2372f6f
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfsConfigCommandBase.java
@@ -0,0 +1,71 @@
+package org.ovirt.engine.core.bll.network.host;
+
+import org.ovirt.engine.core.bll.VdsCommand;
+import org.ovirt.engine.core.bll.context.CommandContext;
+import org.ovirt.engine.core.bll.validator.VfsConfigValidator;
+import org.ovirt.engine.core.common.action.VfsConfigBaseParameters;
+import org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig;
+import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
+import org.ovirt.engine.core.dao.network.HostNicVfsConfigDao;
+import org.ovirt.engine.core.dao.network.InterfaceDao;
+
+public abstract class VfsConfigCommandBase<T extends VfsConfigBaseParameters> 
extends VdsCommand<T> {
+
+    private VdsNetworkInterface nic;
+    private HostNicVfsConfig oldVfsConfig;
+    private VfsConfigValidator vfsConfigValidator;
+
+    public VfsConfigCommandBase(T parameters) {
+        this(parameters, null);
+    }
+
+    public VfsConfigCommandBase(T parameters, CommandContext commandContext) {
+        super(parameters, commandContext);
+    }
+
+    @Override
+    protected void executeCommand() {
+        setVdsId(getNic() == null ? null : getNic().getVdsId());
+    }
+
+    @Override
+    protected boolean canDoAction() {
+        return validate(getVfsConfigValidator().nicExists())
+                && validate(getVfsConfigValidator().nicSriovEnabled())
+                && validate(getVfsConfigValidator().sriovFeatureSupported());
+
+    }
+
+    public InterfaceDao getInterfaceDao() {
+        return getDbFacade().getInterfaceDao();
+    }
+
+    public HostNicVfsConfigDao getVfsConfigDao() {
+        return getDbFacade().getHostNicVfsConfigDao();
+    }
+
+    public VfsConfigValidator getVfsConfigValidator() {
+        if (vfsConfigValidator == null) {
+            vfsConfigValidator = new 
VfsConfigValidator(getParameters().getNicId());
+        }
+        return vfsConfigValidator;
+    }
+
+    public HostNicVfsConfig getVfsConfig() {
+        if (oldVfsConfig == null) {
+            oldVfsConfig = 
getVfsConfigDao().getByNicId(getParameters().getNicId());
+        }
+        return oldVfsConfig;
+    }
+
+    public VdsNetworkInterface getNic() {
+        if (nic == null) {
+            nic = getInterfaceDao().get(getVfsConfig().getNicId());
+        }
+        return nic;
+    }
+
+    public String getNicName() {
+        return getNic().getName();
+    }
+}
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java
new file mode 100644
index 0000000..eb71f9e
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java
@@ -0,0 +1,100 @@
+package org.ovirt.engine.core.bll.validator;
+
+import org.ovirt.engine.core.bll.ValidationResult;
+import org.ovirt.engine.core.common.FeatureSupported;
+import org.ovirt.engine.core.common.businessentities.VDS;
+import org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig;
+import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.Version;
+import org.ovirt.engine.core.dal.dbbroker.DbFacade;
+
+public class VfsConfigValidator {
+
+    private Guid nicId;
+    private VdsNetworkInterface nic;
+    private HostNicVfsConfig oldVfsConfig;
+
+    static final String NIC_NAME_REPLACEMENT = "$nicName %s";
+    static final String NUM_OF_VFS_REPLACEMENT = "$numOfVfs %d";
+    static final String MAX_NUM_OF_VFS_REPLACEMENT = "$maxNumOfVfs %d";
+    static final String NETWORK_NAME_REPLACEMENT = "$networkName %s";
+
+    public VfsConfigValidator(Guid nicId) {
+        this.nicId = nicId;
+    }
+
+    protected DbFacade getDbFacade() {
+        return DbFacade.getInstance();
+    }
+
+    /**
+     * @return An error iff a nic with the specified id doesn't exist.
+     */
+    public ValidationResult nicExists() {
+        return 
ValidationResult.failWith(VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST)
+                .when(getNic() == null);
+    }
+
+    /**
+     * @return An error iff the nic is not SR-IOV enabled
+     */
+    public ValidationResult nicSriovEnabled() {
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED,
+                getNicNameReplacement())
+                .when(getOldVfsConfig() == null);
+    }
+
+    /**
+     * @return An error iff SR-IOV feature doesn't supported in the nic's 
cluster compatibility version
+     */
+    public ValidationResult sriovFeatureSupported() {
+
+        VDS host = getDbFacade().getVdsDao().get(getNic().getVdsId());
+        Version clusterCompVer = host.getVdsGroupCompatibilityVersion();
+
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED)
+                .when(!FeatureSupported.sriov(clusterCompVer));
+    }
+
+    /**
+     * @return An error iff there are non-free VFs of the nic
+     */
+    public ValidationResult allVfsAreFree() {
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED,
+                getNicNameReplacement())
+                .when(getOldVfsConfig().getNumOfVfs() != 
getOldVfsConfig().getNumOfFreeVfs());
+    }
+
+    /**
+     * @param numOfVfs
+     *
+     * @return An error iff <code>numOfVfs</code> is bigger than the 
<code>vfsConfig.maxNumOfVfs</code>
+     */
+    public ValidationResult numOfVfsInValidRange(int numOfVfs) {
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE,
+                getNicNameReplacement(),
+                String.format(NUM_OF_VFS_REPLACEMENT, numOfVfs),
+                String.format(MAX_NUM_OF_VFS_REPLACEMENT, 
getOldVfsConfig().getMaxNumOfVfs()))
+                .when(numOfVfs > getOldVfsConfig().getMaxNumOfVfs() || 
numOfVfs < 0);
+    }
+
+    VdsNetworkInterface getNic() {
+        if (nic == null) {
+            nic = getDbFacade().getInterfaceDao().get(nicId);
+        }
+        return nic;
+    }
+
+    String getNicNameReplacement() {
+        return String.format(NIC_NAME_REPLACEMENT, getNic().getName());
+    }
+
+    HostNicVfsConfig getOldVfsConfig() {
+        if (oldVfsConfig == null) {
+            oldVfsConfig = 
getDbFacade().getHostNicVfsConfigDao().getByNicId(nicId);
+        }
+        return oldVfsConfig;
+    }
+}
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommandTest.java
new file mode 100644
index 0000000..3a65d05
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommandTest.java
@@ -0,0 +1,163 @@
+package org.ovirt.engine.core.bll.network.host;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.ovirt.engine.core.bll.ValidationResult;
+import org.ovirt.engine.core.bll.validator.VfsConfigValidator;
+import org.ovirt.engine.core.common.AuditLogType;
+import org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters;
+import org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.dao.network.HostNicVfsConfigDao;
+import org.ovirt.engine.core.dao.network.InterfaceDao;
+
+@RunWith(MockitoJUnitRunner.class)
+public class UpdateHostNicVfsConfigCommandTest {
+
+    private UpdateHostNicVfsConfigParameters param;
+    private UpdateHostNicVfsConfigCommand command;
+
+    private static final Guid NIC_ID = Guid.newGuid();
+    private static final int NUM_OF_VFS = 5;
+
+    @Mock
+    InterfaceDao interfaceDao;
+
+    @Mock
+    HostNicVfsConfigDao vfsConfigDao;
+
+    @Mock
+    HostNicVfsConfig oldVfsConfig;
+
+    @Mock
+    VfsConfigValidator validator;
+
+    @Before
+    public void setup() {
+        createCommand();
+        setAllValidationsValid();
+    }
+
+    public void createCommand() {
+        param = new UpdateHostNicVfsConfigParameters(NIC_ID, NUM_OF_VFS, 
false);
+
+        command = spy(new UpdateHostNicVfsConfigCommand(param));
+        when(command.getVfsConfigValidator()).thenReturn(validator);
+    }
+
+    @Test
+    public void nicNotExist() {
+        nicExists(false);
+        
assertCanDoActionFailure(VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST.toString());
+    }
+
+    @Test
+    public void sriovFeatureIsNotSupported() {
+        sriovFeatureSupported(false);
+        
assertCanDoActionFailure(VdcBllMessages.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED.toString());
+    }
+
+    @Test
+    public void nicNotSriovEnabled() {
+        nicSriovEnabled(false);
+        
assertCanDoActionFailure(VdcBllMessages.ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED.toString());
+    }
+
+    @Test
+    public void notAllVfsAreFree() {
+        allVfsAreFree(false);
+        
assertCanDoActionFailure(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED.toString());
+    }
+
+    @Test
+    public void numOfVfsIsNotInRange() {
+        numOfVfsInValidRange(false);
+        
assertCanDoActionFailure(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE.toString());
+    }
+
+    @Test
+    public void canDoActionSuccessNumOfVfsNotChanged() {
+        doReturn(false).when(command).wasNumOfVfsChanged();
+        allVfsAreFree(false);
+        numOfVfsInValidRange(false);
+        assertCanDoActionSuccess();
+    }
+
+    @Test
+    public void canDoActionSuccessNumOfVfsChanged() {
+        assertCanDoActionSuccess();
+    }
+
+    @Test
+    public void executionFailure() {
+        doReturn(null).when(command).getVfsConfig();
+        doReturn(null).when(command).getNic();
+        assertExecuteActionFailure();
+    }
+
+    private void setAllValidationsValid() {
+        doReturn(true).when(command).wasNumOfVfsChanged();
+        nicExists(true);
+        sriovFeatureSupported(true);
+        nicSriovEnabled(true);
+        allVfsAreFree(true);
+        numOfVfsInValidRange(true);
+    }
+
+    private void nicExists(boolean isValid) {
+        when(validator.nicExists()).thenReturn(isValid ? ValidationResult.VALID
+                : new 
ValidationResult(VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST));
+    }
+
+    private void sriovFeatureSupported(boolean isValid) {
+        when(validator.sriovFeatureSupported()).thenReturn(isValid ? 
ValidationResult.VALID
+                : new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED));
+    }
+
+    private void nicSriovEnabled(boolean isValid) {
+        when(validator.nicSriovEnabled()).thenReturn(isValid ? 
ValidationResult.VALID
+                : new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED));
+    }
+
+    private void allVfsAreFree(boolean isValid) {
+        when(validator.allVfsAreFree()).thenReturn(isValid ? 
ValidationResult.VALID
+                : new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED));
+    }
+
+    private void numOfVfsInValidRange(boolean isValid) {
+        
when(validator.numOfVfsInValidRange(param.getNumOfVfs())).thenReturn(isValid ? 
ValidationResult.VALID
+                : new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE));
+    }
+
+    private void assertCanDoActionFailure(final String messageToVerify) {
+        assertFalse(command.canDoAction());
+        
assertTrue(command.getReturnValue().getCanDoActionMessages().contains(messageToVerify));
+    }
+
+    private void assertCanDoActionSuccess() {
+        assertTrue(command.canDoAction());
+        
assertTrue(command.getReturnValue().getCanDoActionMessages().isEmpty());
+    }
+
+    private void assertExecuteActionFailure() {
+        try {
+            command.executeCommand();
+        } catch (Exception expected) {
+            // An exception is expected here
+        }
+
+        assertFalse(command.getReturnValue().getSucceeded());
+        assertEquals(AuditLogType.UPDATE_HOST_NIC_VFS_CONFIG_FAILED, 
command.getAuditLogTypeValue());
+    }
+}
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VfsConfigValidatorTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VfsConfigValidatorTest.java
new file mode 100644
index 0000000..e690e42
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VfsConfigValidatorTest.java
@@ -0,0 +1,194 @@
+package org.ovirt.engine.core.bll.validator;
+
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+import static 
org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith;
+import static 
org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid;
+
+import org.hamcrest.Matcher;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.ovirt.engine.core.bll.ValidationResult;
+import org.ovirt.engine.core.common.businessentities.VDS;
+import org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig;
+import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
+import org.ovirt.engine.core.common.config.ConfigValues;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.Version;
+import org.ovirt.engine.core.dal.dbbroker.DbFacade;
+import org.ovirt.engine.core.dao.VdsDAO;
+import org.ovirt.engine.core.dao.network.HostNicVfsConfigDao;
+import org.ovirt.engine.core.dao.network.InterfaceDao;
+import org.ovirt.engine.core.utils.MockConfigRule;
+
+@RunWith(MockitoJUnitRunner.class)
+public class VfsConfigValidatorTest {
+
+    private static final String CLUSTER_VERSION = "7";
+
+    private static final int NUM_OF_VFS = 5;
+
+    private Guid nicId = Guid.newGuid();
+
+    private Guid hostId = Guid.newGuid();
+
+    @Mock
+    private VdsNetworkInterface nic;
+
+    @Mock
+    private VDS host;
+
+    @Mock
+    private HostNicVfsConfig oldVfsConfig;
+
+    @Mock
+    private Version version;
+
+    @Mock
+    private DbFacade dbFacade;
+
+    @Mock
+    private InterfaceDao interfaceDao;
+
+    @Mock
+    private HostNicVfsConfigDao vfsConfigDao;
+
+    @Mock
+    private VdsDAO vdsDao;
+
+    private VfsConfigValidator validator;
+
+    @Rule
+    public MockConfigRule mockConfigRule = new MockConfigRule();
+
+    @Before
+    public void setup() {
+        createValidator();
+
+        when(dbFacade.getInterfaceDao()).thenReturn(interfaceDao);
+        when(dbFacade.getHostNicVfsConfigDao()).thenReturn(vfsConfigDao);
+        when(dbFacade.getVdsDao()).thenReturn(vdsDao);
+    }
+
+    private void createValidator() {
+        validator = spy(new VfsConfigValidator(nicId));
+        doReturn(dbFacade).when(validator).getDbFacade();
+    }
+
+    @Test
+    public void sriovFeatureSupported() {
+        sriovFeatureSupportTest(isValid(), true);
+    }
+
+    @Test
+    public void sriovFeatureNotSupported() {
+        
sriovFeatureSupportTest(failsWith(VdcBllMessages.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED),
 false);
+    }
+
+    private void sriovFeatureSupportTest(Matcher<ValidationResult> matcher,
+            boolean isSupported) {
+        simulateNicExists();
+        when(nic.getVdsId()).thenReturn(hostId);
+        when(vdsDao.get(hostId)).thenReturn(host);
+        when(host.getVdsGroupCompatibilityVersion()).thenReturn(version);
+        when(version.getValue()).thenReturn(CLUSTER_VERSION);
+
+        mockConfigRule.mockConfigValue(ConfigValues.NetworkSriovSupported, 
version, isSupported);
+
+        assertThat(validator.sriovFeatureSupported(), matcher);
+    }
+
+    @Test
+    public void nicSriovEnabled() {
+        simulateVfsConfigExists();
+        assertThat(validator.nicSriovEnabled(), isValid());
+    }
+
+    @Test
+    public void nicSriovNotEnabled() {
+        simulateNicExists();
+        assertThat(validator.nicSriovEnabled(),
+                
failsWith(VdcBllMessages.ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED,
+                        String.format(VfsConfigValidator.NIC_NAME_REPLACEMENT, 
nic.getName())));
+    }
+
+    private void simulateNicExists() {
+        when(interfaceDao.get(nicId)).thenReturn(nic);
+    }
+
+    private void simulateVfsConfigExists() {
+        simulateNicExists();
+        when(vfsConfigDao.getByNicId(nicId)).thenReturn(oldVfsConfig);
+    }
+
+    @Test
+    public void numOfVfsValidLessThanMax() {
+        numOfVfsInRangeTest(NUM_OF_VFS, NUM_OF_VFS + 1);
+        assertThat(validator.nicSriovEnabled(), isValid());
+    }
+
+    @Test
+    public void numOfVfsValidEqualsMax() {
+        numOfVfsInRangeTest(NUM_OF_VFS, NUM_OF_VFS);
+        assertThat(validator.nicSriovEnabled(), isValid());
+    }
+
+    @Test
+    public void numOfVfsValidZero() {
+        numOfVfsInRangeTest(0, NUM_OF_VFS);
+        assertThat(validator.nicSriovEnabled(), isValid());
+    }
+
+    @Test
+    public void numOfVfsNotValidBiggerThanMax() {
+        numOfVfsInRangeTest(NUM_OF_VFS, NUM_OF_VFS - 1);
+        assertNumOfVfsInValidRange(NUM_OF_VFS);
+    }
+
+    @Test
+    public void numOfVfsNotValidNegative() {
+        numOfVfsInRangeTest(-NUM_OF_VFS, NUM_OF_VFS);
+        assertNumOfVfsInValidRange(-NUM_OF_VFS);
+    }
+
+    private void numOfVfsInRangeTest(int numOfVfs, int maxNumOfVfs) {
+        simulateVfsConfigExists();
+        when(oldVfsConfig.getMaxNumOfVfs()).thenReturn(maxNumOfVfs);
+    }
+
+    private void assertNumOfVfsInValidRange(int numOfVfs) {
+        assertThat(validator.numOfVfsInValidRange(numOfVfs),
+                
failsWith(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE,
+                        String.format(VfsConfigValidator.NIC_NAME_REPLACEMENT, 
nic.getName()),
+                        
String.format(VfsConfigValidator.NUM_OF_VFS_REPLACEMENT, numOfVfs),
+                        
String.format(VfsConfigValidator.MAX_NUM_OF_VFS_REPLACEMENT, 
oldVfsConfig.getMaxNumOfVfs())));
+    }
+
+    @Test
+    public void noAllVfsAreFree() {
+        allVfsAreFreeTest(NUM_OF_VFS, NUM_OF_VFS - 1);
+        assertThat(validator.allVfsAreFree(),
+                
failsWith(VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED,
+                        String.format(VfsConfigValidator.NIC_NAME_REPLACEMENT, 
nic.getName())));
+    }
+
+    @Test
+    public void allVfsAreFree() {
+        allVfsAreFreeTest(NUM_OF_VFS, NUM_OF_VFS);
+        assertThat(validator.allVfsAreFree(), isValid());
+    }
+
+    private void allVfsAreFreeTest(int numOfVfs, int numOfFreeVfs) {
+        simulateVfsConfigExists();
+        when(oldVfsConfig.getNumOfVfs()).thenReturn(numOfVfs);
+        when(oldVfsConfig.getNumOfFreeVfs()).thenReturn(numOfFreeVfs);
+    }
+
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index 6134f76..905a6740 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -118,7 +118,6 @@
     KDUMP_FLOW_FINISHED_ON_VDS(616),
     KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS(617, AuditLogSeverity.WARNING),
 
-
     HOST_REFRESHED_CAPABILITIES(606),
     HOST_REFRESH_CAPABILITIES_FAILED(607, AuditLogSeverity.ERROR),
 
@@ -154,7 +153,7 @@
     USER_STARTED_VM(153),
     USER_INITIATED_RUN_VM_FAILED(151, AuditLogSeverity.WARNING),
     USER_RUN_VM(32), // User issued runVm command
-    USER_RUN_VM_AS_STATELESS(538),  // User issued runVm command in stateless 
mode
+    USER_RUN_VM_AS_STATELESS(538), // User issued runVm command in stateless 
mode
     USER_FAILED_RUN_VM(54, AuditLogSeverity.ERROR), // User issued runVm 
command
     USER_RUN_VM_AS_STATELESS_FINISHED_FAILURE(70, AuditLogSeverity.ERROR),
     USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT(171, 
AuditLogSeverity.WARNING),
@@ -753,6 +752,10 @@
     IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES(1170, 
AuditLogSeverity.NORMAL,
             AuditLogTimeInterval.MINUTE.getValue()),
 
+    // SR-IOV
+    UPDATE_HOST_NIC_VFS_CONFIG(1191),
+    UPDATE_HOST_NIC_VFS_CONFIG_FAILED(1192, AuditLogSeverity.ERROR),
+
     // NUMA
     NUMA_ADD_VM_NUMA_NODE_SUCCESS(1300),
     NUMA_ADD_VM_NUMA_NODE_FAILED(1301, AuditLogSeverity.ERROR),
@@ -900,7 +903,6 @@
     AUTH_FAILED_INTERNAL_KERBEROS_ERROR(1184, AuditLogSeverity.ERROR),
     USER_ACCOUNT_EXPIRED(1185, AuditLogSeverity.ERROR),
 
-
     // Providers
     PROVIDER_ADDED(205),
     PROVIDER_ADDITION_FAILED(206, AuditLogSeverity.ERROR),
@@ -937,14 +939,14 @@
     FENCE_USING_AGENT_AND_PROXY_HOST(9020),
     FENCE_OPERATION_FAILED_USING_PROXY(9021, AuditLogSeverity.WARNING),
 
-
     TASK_STOPPING_ASYNC_TASK(9500, AuditLogTimeInterval.MINUTE.getValue()),
     TASK_CLEARING_ASYNC_TASK(9501, AuditLogTimeInterval.MINUTE.getValue()),
 
     VDS_ACTIVATE_ASYNC(9502, AuditLogTimeInterval.HOUR.getValue() * 3), // 
When VDS is reactivated by autorecovery
     VDS_ACTIVATE_MANUAL_HA_ASYNC(10455, AuditLogSeverity.WARNING,
             AuditLogTimeInterval.HOUR.getValue() * 3), // When VDS is 
reactivated by autorecovery
-    VDS_ACTIVATE_FAILED_ASYNC(9503, AuditLogSeverity.WARNING, 
AuditLogTimeInterval.HOUR.getValue() * 3), // When VDS is reactivated
+    VDS_ACTIVATE_FAILED_ASYNC(9503, AuditLogSeverity.WARNING, 
AuditLogTimeInterval.HOUR.getValue() * 3), // When VDS is
+                                                                               
                          // reactivated
     @Deprecated
     STORAGE_ACTIVATE_ASYNC(9504, AuditLogTimeInterval.HOUR.getValue() * 3), // 
When VDS is reactivated by autorecovery
 
@@ -965,7 +967,6 @@
 
     MIXING_RHEL_VERSIONS_IN_CLUSTER(9610, AuditLogSeverity.WARNING,
             AuditLogTimeInterval.MINUTE.getValue()),
-
 
     /** Highly available virtual machine went down. */
     HA_VM_FAILED(9602, AuditLogSeverity.ERROR),
@@ -990,7 +991,7 @@
     EXTERNAL_EVENT_ERROR(9803, AuditLogSeverity.ERROR),
     EXTERNAL_ALERT(9804, AuditLogSeverity.ALERT),
 
-    //watchdog
+    // watchdog
     WATCHDOG_EVENT(9901, AuditLogSeverity.WARNING),
 
     // cluster policy
@@ -1005,7 +1006,7 @@
     FAILED_TO_CONNECT_TO_SCHEDULER_PROXY(9920, AuditLogSeverity.ERROR,
             AuditLogTimeInterval.MINUTE.getValue()),
 
-    //trusted service
+    // trusted service
     VDS_UNTRUSTED(10000, AuditLogSeverity.ERROR,
             AuditLogTimeInterval.MINUTE.getValue()),
     USER_UPDATE_VM_FROM_TRUSTED_TO_UNTRUSTED(10001, AuditLogSeverity.WARNING),
@@ -1025,7 +1026,7 @@
     USER_ADD_EXTERNAL_JOB(11000),
     USER_ADD_EXTERNAL_JOB_FAILED(11001, AuditLogSeverity.ERROR),
 
-    //network Qos
+    // network Qos
     USER_ADDED_NETWORK_QOS(10100),
     USER_FAILED_TO_ADD_NETWORK_QOS(10101, AuditLogSeverity.ERROR),
     USER_REMOVED_NETWORK_QOS(10102),
@@ -1057,11 +1058,11 @@
     USER_UPDATED_CPU_PROFILE(10134),
     USER_FAILED_TO_UPDATE_CPU_PROFILE(10135, AuditLogSeverity.ERROR),
 
-    //mom policies
+    // mom policies
     USER_UPDATED_MOM_POLICIES(10200),
     USER_FAILED_TO_UPDATE_MOM_POLICIES(10201, AuditLogSeverity.WARNING),
 
-    //power management policy
+    // power management policy
     PM_POLICY_UP_TO_MAINTENANCE(10250),
     PM_POLICY_MAINTENANCE_TO_DOWN(10251),
     PM_POLICY_TO_UP(10252),
@@ -1072,8 +1073,7 @@
 
     CLUSTER_ALERT_HA_RESERVATION_DOWN(10301, AuditLogSeverity.ALERT),
 
-
-    //affinity groups
+    // affinity groups
     USER_ADDED_AFFINITY_GROUP(10350),
     USER_FAILED_TO_ADD_AFFINITY_GROUP(10351, AuditLogSeverity.ERROR),
     USER_UPDATED_AFFINITY_GROUP(10352),
@@ -1108,7 +1108,7 @@
     VM_SLA_POLICY(10550),
     FAILED_VM_SLA_POLICY(10551, AuditLogSeverity.ERROR),
 
-    //MacPool Log
+    // MacPool Log
     MAC_POOL_ADD_SUCCESS(10700),
     MAC_POOL_ADD_FAILED(10701, AuditLogSeverity.ERROR),
     MAC_POOL_EDIT_SUCCESS(10702),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/UpdateHostNicVfsConfigParameters.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/UpdateHostNicVfsConfigParameters.java
new file mode 100644
index 0000000..bd5bf95
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/UpdateHostNicVfsConfigParameters.java
@@ -0,0 +1,29 @@
+package org.ovirt.engine.core.common.action;
+
+import org.ovirt.engine.core.compat.Guid;
+
+public class UpdateHostNicVfsConfigParameters extends VfsConfigBaseParameters {
+
+    private static final long serialVersionUID = 702645639103829096L;
+
+    private int numOfVfs;
+
+    private boolean allNetworksAllowed;
+
+    public UpdateHostNicVfsConfigParameters() {
+    }
+
+    public UpdateHostNicVfsConfigParameters(Guid nicId, int numOfVfs, boolean 
allNetworksAllowed) {
+        super(nicId);
+        this.numOfVfs = numOfVfs;
+        this.allNetworksAllowed = allNetworksAllowed;
+    }
+
+    public int getNumOfVfs() {
+        return numOfVfs;
+    }
+
+    public boolean getAllNetworksAllowed() {
+        return allNetworksAllowed;
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
index 9784e56..f28deea 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
@@ -115,6 +115,9 @@
     LabelNic(165, ActionGroup.CONFIGURE_HOST_NETWORK, false, 
QuotaDependency.NONE),
     UnlabelNic(166, ActionGroup.CONFIGURE_HOST_NETWORK, false, 
QuotaDependency.NONE),
 
+    // SR-IOV
+    UpdateHostNicVfsConfig(167, ActionGroup.CONFIGURE_HOST_NETWORK, false, 
QuotaDependency.NONE),
+
     // NUMA
     AddVmNumaNodes(170, ActionGroup.EDIT_VM_PROPERTIES, false, 
QuotaDependency.NONE),
     UpdateVmNumaNodes(171, ActionGroup.EDIT_VM_PROPERTIES, false, 
QuotaDependency.NONE),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VfsConfigBaseParameters.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VfsConfigBaseParameters.java
new file mode 100644
index 0000000..d0aa65e
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VfsConfigBaseParameters.java
@@ -0,0 +1,24 @@
+package org.ovirt.engine.core.common.action;
+
+import javax.validation.constraints.NotNull;
+
+import org.ovirt.engine.core.compat.Guid;
+
+public abstract class VfsConfigBaseParameters extends VdsActionParameters {
+
+    private static final long serialVersionUID = 8442994960202140298L;
+
+    @NotNull
+    private Guid nicId;
+
+    public VfsConfigBaseParameters() {
+    }
+
+    public VfsConfigBaseParameters(Guid nicId) {
+        this.nicId = nicId;
+    }
+
+    public Guid getNicId() {
+        return nicId;
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
index 081fa50..01c0bbf 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
@@ -23,6 +23,7 @@
     VAR__TYPE__NETWORKS,
     VAR__TYPE__VNIC_PROFILE,
     VAR__TYPE__LABEL,
+    VAR__TYPE__HOST_NIC_VFS_CONFIG,
     VAR__TYPE__PROVIDER,
     VAR__TYPE__PROVIDER_CERTIFICATE,
     VAR__TYPE__VM_DISK,
@@ -589,6 +590,10 @@
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REWIRED(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_HAVE_MTU(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORKS_CANNOT_BE_PROVISIONED(ErrorType.NOT_SUPPORTED),
+    ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED(ErrorType.NOT_SUPPORTED),
+    ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED(ErrorType.NOT_SUPPORTED),
+    ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED(ErrorType.NOT_SUPPORTED),
+    ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_IN_STORAGE_POOL(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_LUNS_ALREADY_PART_OF_STORAGE_DOMAINS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_LUNS_ALREADY_USED_BY_DISKS(ErrorType.CONFLICT),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 897de2e..dc83c4c 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -285,6 +285,7 @@
 VAR__TYPE__NETWORKS=$type Networks
 VAR__TYPE__VNIC_PROFILE=$type VM network interface profile
 VAR__TYPE__LABEL=$type Label
+VAR__TYPE__HOST_NIC_VFS_CONFIG=$type host NIC VFs configuration
 VAR__TYPE__PROVIDER=$type provider
 VAR__TYPE__PROVIDER_CERTIFICATE=$type provider certificate
 VAR__TYPE__VM=$type VM
@@ -529,6 +530,13 @@
 ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC=Cannot ${action} 
${type}. The following networks cannot be removed from the network interface 
since they are managed by the label: 
${ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC_LIST}. Please 
remove the label from the network interface in order to remove the network.
 LABELED_NETWORK_ATTACHED_TO_WRONG_INTERFACE=Cannot ${action} ${type}. The 
following networks are already attached to a different interface on the host: 
${AssignedNetworks}. Please remove the networks in order to label the interface.
 OTHER_INTERFACE_ALREADY_LABELED=Cannot ${action} ${type}. The label is already 
defined on other interface ${LabeledNic} on the host.
+
+ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED=Cannot ${action} ${type}. 
SR-IOV is not supported on the selected cluster version.
+ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED=Cannot ${action} ${type}. The 
selected network interface ${nicName} has VFs that are in use.
+ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED=Cannot ${action} ${type}. The 
selected network interface ${nicName} is not SR-IOV enabled.
+ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE=Cannot ${action} ${type}. The 
specified number of VFs on network interface ${nicName} is ${numOfVfs}, the 
valid range is 0 - ${maxNumOfVfs}.
+ACTION_TYPE_FAILED_CANNOT_SET_SPECIFIC_NETWORKS=Cannot ${action} ${type}. All 
networks are allowed, cannot set specific network/label.
+
 ERROR_CANNOT_RECOVERY_STORAGE_POOL_THERE_IS_ACTIVE_DATA_DOMAINS=Cannot recover 
Data Center with active Data Storage Domain in Data Center.
 ERROR_CANNOT_DETACH_LAST_STORAGE_DOMAIN=Cannot remove the master Storage 
Domain from the Data Center without another active Storage Domain to take its 
place.\n\
        -Either activate another Storage Domain in the Data Center, or remove 
the Data Center.
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 84171e3..7fac563 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -558,6 +558,8 @@
 UPDATE_VNIC_PROFILE_FAILED=Failed to update VM network interface profile 
${VnicProfileName} for network ${NetworkName} in Data Center: 
${DataCenterName}. (User: ${UserName})
 REMOVE_VNIC_PROFILE=VM network interface profile ${VnicProfileName} was 
removed from network ${NetworkName} in Data Center: ${DataCenterName}. (User: 
${UserName})
 REMOVE_VNIC_PROFILE_FAILED=Failed to remove VM network interface profile 
${VnicProfileName} from network ${NetworkName} in Data Center: 
${DataCenterName}. (User: ${UserName})
+UPDATE_HOST_NIC_VFS_CONFIG=The VFs configuration of network interface card 
${NicName} was updated.
+UPDATE_HOST_NIC_VFS_CONFIG_FAILED=Failed to update the VFs configuration of 
network interface card ${NicName}.
 SYSTEM_DEACTIVATED_STORAGE_DOMAIN=Storage Domain ${StorageDomainName} (Data 
Center ${StoragePoolName}) was deactivated by system because it's not visible 
by any of the hosts.
 SYSTEM_DEACTIVATE_STORAGE_DOMAIN_FAILED=Failed to deactivate Storage Domain 
${StorageDomainName} (Data Center ${StoragePoolName}).
 VDS_SET_NONOPERATIONAL_DOMAIN=Host ${VdsName} cannot access the Storage 
Domain(s) ${StorageDomainNames} attached to the Data Center ${StoragePoolName}. 
Setting Host state to Non-Operational.
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index e4e5469..721e346 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -766,6 +766,9 @@
     @DefaultStringValue("$type Label")
     String VAR__TYPE__LABEL();
 
+    @DefaultStringValue("VAR__TYPE__HOST_NIC_VFS_CONFIG=$type host NIC VFs 
configuration")
+    String VAR__TYPE__HOST_NIC_VFS_CONFIG();
+
     @DefaultStringValue("$type VM network interface profile")
     String VAR__TYPE__VNIC_PROFILE();
 
@@ -1480,6 +1483,18 @@
     @DefaultStringValue("Cannot ${action} ${type}. The label is already 
defined on other interface ${LabeledNic} on the host.")
     String OTHER_INTERFACE_ALREADY_LABELED();
 
+    @DefaultStringValue("Cannot ${action} ${type}. SR-IOV is not supported on 
the selected cluster version.")
+    String ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED();
+
+    @DefaultStringValue("Cannot ${action} ${type}. The selected network 
interface ${nicName} has VFs that are in use.")
+    String ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED();
+
+    @DefaultStringValue("Cannot ${action} ${type}. The selected network 
interface ${nicName} is not SR-IOV enabled.")
+    String ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED();
+
+    @DefaultStringValue("Cannot ${action} ${type}. The specified number of VFs 
on network interface ${nicName} is ${numOfVfs}, the valid range is 0 - 
${maxNumOfVfs}.")
+    String ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE();
+
     @DefaultStringValue("Cannot recover Data Center with active Data Storage 
Domain in Data Center.")
     String ERROR_CANNOT_RECOVERY_STORAGE_POOL_THERE_IS_ACTIVE_DATA_DOMAINS();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 4b7c588..0e23fcf 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -281,6 +281,7 @@
 VAR__TYPE__NETWORK=$type Network
 VAR__TYPE__NETWORKS=$type Networks
 VAR__TYPE__LABEL=$type Label
+VAR__TYPE__HOST_NIC_VFS_CONFIG=$type host NIC VFs configuration
 VAR__TYPE__VNIC_PROFILE=$type VM network interface profile
 VAR__TYPE__PROVIDER=$type provider
 VAR__TYPE__PROVIDER_CERTIFICATE=$type provider certificate
@@ -534,6 +535,13 @@
 ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC=Cannot ${action} 
${type}. The following networks cannot be removed from the network interface 
since they are managed by the label: 
${ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC_LIST}. Please 
remove the label from the network interface in order to remove the network.
 LABELED_NETWORK_ATTACHED_TO_WRONG_INTERFACE=Cannot ${action} ${type}. The 
following networks are already attached to a different interface: 
${AssignedNetworks}. Please remove the networks in order to label the interface.
 OTHER_INTERFACE_ALREADY_LABELED=Cannot ${action} ${type}. The label is already 
defined on other interface ${LabeledNic} on the host.
+
+ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED=Cannot ${action} ${type}. 
SR-IOV is not supported on the selected cluster version.
+ACTION_TYPE_FAILED_NUM_OF_VFS_CANNOT_BE_CHANGED=Cannot ${action} ${type}. The 
selected network interface ${nicName} has VFs that are in use.
+ACTION_TYPE_FAILED_NIC_IS_NOT_SRIOV_ENABLED=Cannot ${action} ${type}. The 
selected network interface ${nicName} is not SR-IOV enabled.
+ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE=Cannot ${action} ${type}. The 
specified number of VFs on network interface ${nicName} is ${numOfVfs}, the 
valid range is 0 - ${maxNumOfVfs}.
+ACTION_TYPE_FAILED_CANNOT_SET_SPECIFIC_NETWORKS=Cannot ${action} ${type}. All 
networks are allowed, cannot set specific network/label.
+
 ERROR_CANNOT_RECOVERY_STORAGE_POOL_THERE_IS_ACTIVE_DATA_DOMAINS=Cannot recover 
Data Center with active Data Storage Domain in Data Center.
 ERROR_CANNOT_DETACH_LAST_STORAGE_DOMAIN=Cannot remove the master Storage 
Domain from the Data Center without another active Storage Domain to take its 
place.\n\
        -Either activate another Storage Domain in the Data Center, or remove 
the Data Center.


-- 
To view, visit http://gerrit.ovirt.org/36843
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I868d58b291c3920f6cf966a409a11a06498854b1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to