Search in sources :

Example 41 with VdsNetworkInterface

use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface in project ovirt-engine by oVirt.

the class HostNetworkAttachmentsPersister method initReportedNetworksAndNics.

private void initReportedNetworksAndNics(List<VdsNetworkInterface> nics) {
    for (VdsNetworkInterface nic : nics) {
        if (nic.getNetworkName() != null) {
            Network network = clusterNetworks.get(nic.getNetworkName());
            if (network != null) {
                reportedNetworksById.put(network.getId(), network);
                reportedNicsByNetworkId.put(network.getId(), nic);
            }
        }
    }
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Example 42 with VdsNetworkInterface

use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface in project ovirt-engine by oVirt.

the class HostNetworkInterfacesPersisterImpl method createNewInterfaces.

private void createNewInterfaces() {
    List<VdsNetworkInterface> nicsForCreate = prepareNicsForCreate();
    for (VdsNetworkInterface nicForCreate : nicsForCreate) {
        interfaceDao.saveInterfaceForVds(nicForCreate);
        interfaceDao.saveStatisticsForVds(nicForCreate.getStatistics());
    }
}
Also used : VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Example 43 with VdsNetworkInterface

use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface in project ovirt-engine by oVirt.

the class HostNetworkAttachmentsPersisterTest method createVdsNetworkInterface.

private VdsNetworkInterface createVdsNetworkInterface(Guid id, String name) {
    VdsNetworkInterface vdsNetworkInterface = new VdsNetworkInterface();
    vdsNetworkInterface.setName(name);
    vdsNetworkInterface.setId(id);
    return vdsNetworkInterface;
}
Also used : VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) CustomPropertiesForVdsNetworkInterface(org.ovirt.engine.core.common.action.CustomPropertiesForVdsNetworkInterface)

Example 44 with VdsNetworkInterface

use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface in project ovirt-engine by oVirt.

the class ExecuteNetworkCommandInNetworkOperationTest method assertBond.

private void assertBond(CreateOrUpdateBond bond, Guid bondId, List<VdsNetworkInterface> slaves) {
    // $NON-NLS-1$
    assertThat("id mismatch", bond.getId(), is(bondId));
    for (VdsNetworkInterface slave : slaves) {
        // $NON-NLS-1$
        assertThat("missing slave", bond.getSlaves().contains(slave.getName()), is(true));
    }
    // $NON-NLS-1$
    assertThat("invalid slaves count", bond.getSlaves().size(), is(slaves.size()));
}
Also used : VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Example 45 with VdsNetworkInterface

use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface in project ovirt-engine by oVirt.

the class ReportedConfigurationsFiller method fillReportedConfigurations.

private void fillReportedConfigurations(Map<String, VdsNetworkInterface> networkNameToNicMap, BusinessEntityMap<Network> networkMap, NetworkAttachment networkAttachment, DnsResolverConfiguration reportedDnsResolverConfiguration, Cluster cluster) {
    Network network = networkMap.get(networkAttachment.getNetworkId());
    VdsNetworkInterface nic = getNicToWhichIsNetworkAttached(networkNameToNicMap, networkMap, networkAttachment);
    if (nic != null) {
        NetworkInSyncWithVdsNetworkInterface isInSync = createNetworkInSyncWithVdsNetworkInterface(networkAttachment, nic, network, reportedDnsResolverConfiguration, cluster);
        ReportedConfigurations reportedConfigurations = isInSync.reportConfigurationsOnHost();
        networkAttachment.setReportedConfigurations(reportedConfigurations);
    }
}
Also used : ReportedConfigurations(org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations) Network(org.ovirt.engine.core.common.businessentities.network.Network) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) NetworkInSyncWithVdsNetworkInterface(org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface) NetworkInSyncWithVdsNetworkInterface(org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface)

Aggregations

VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)233 Test (org.junit.Test)68 Network (org.ovirt.engine.core.common.businessentities.network.Network)47 ArrayList (java.util.ArrayList)46 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)35 Guid (org.ovirt.engine.core.compat.Guid)30 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)24 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)23 List (java.util.List)19 HashMap (java.util.HashMap)18 FindActiveVmsUsingNetwork (org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetwork)18 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)17 NicLabel (org.ovirt.engine.core.common.businessentities.network.NicLabel)16 VDS (org.ovirt.engine.core.common.businessentities.VDS)15 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)14 Nic (org.ovirt.engine.core.common.businessentities.network.Nic)13 Map (java.util.Map)12 HostDevice (org.ovirt.engine.core.common.businessentities.HostDevice)9 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)8 Vlan (org.ovirt.engine.core.common.businessentities.network.Vlan)8