use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails in project ovirt-engine by oVirt.
the class HostNetworkTopologyPersisterImpl method logUnsynchronizedNetworks.
private void logUnsynchronizedNetworks(VDS host, Map<String, Network> networks) {
List<String> networkNames = new ArrayList<>();
for (VdsNetworkInterface iface : host.getInterfaces()) {
Network network = networks.get(iface.getNetworkName());
NetworkImplementationDetails networkImplementationDetails = networkImplementationDetailsUtils.calculateNetworkImplementationDetails(iface, network);
if (networkImplementationDetails != null && !networkImplementationDetails.isInSync() && networkImplementationDetails.isManaged()) {
networkNames.add(iface.getNetworkName());
}
}
if (!networkNames.isEmpty()) {
final AuditLogable logable = createAuditLogForHost(host);
logable.addCustomValue("Networks", StringUtils.join(networkNames, ","));
auditLogDirector.log(logable, AuditLogType.VDS_NETWORKS_OUT_OF_SYNC);
}
}
use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails in project ovirt-engine by oVirt.
the class HostSetupNetworksCommand method getExistingNics.
private List<VdsNetworkInterface> getExistingNics() {
if (existingNics == null) {
existingNics = interfaceDao.getAllInterfacesForVds(getVdsId());
NetworkCommonUtils.fillBondSlaves(existingNics);
for (VdsNetworkInterface iface : existingNics) {
Network network = getNetworkBusinessEntityMap().get(iface.getNetworkName());
NetworkImplementationDetails networkImplementationDetails = networkImplementationDetailsUtils.calculateNetworkImplementationDetails(iface, network);
iface.setNetworkImplementationDetails(networkImplementationDetails);
}
}
return existingNics;
}
use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails in project ovirt-engine by oVirt.
the class HostSetupNetworksValidator method mustAttachementBeCheckedForBondMode.
private boolean mustAttachementBeCheckedForBondMode(NetworkAttachment attachment, Map<String, VdsNetworkInterface> hostInterfacesByNetworkName) {
Network network = networkBusinessEntityMap.get(attachment.getNetworkName());
String networkName = attachment.getNetworkName();
if (!network.isVmNetwork()) {
return false;
}
VdsNetworkInterface nic = hostInterfacesByNetworkName.get(networkName);
if (nic == null) {
return true;
}
NetworkImplementationDetails networkImplementationDetails = nic.getNetworkImplementationDetails();
return networkImplementationDetails == null || networkImplementationDetails.isInSync() || attachment.isOverrideConfiguration();
}
use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails in project ovirt-engine by oVirt.
the class GetVdsAndNetworkInterfacesByNetworkIdQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
List<VDS> vdsList = vdsDao.getAllForNetwork(getParameters().getId());
List<VdsNetworkInterface> vdsNetworkInterfaceList = interfaceDao.getVdsInterfacesByNetworkId(getParameters().getId());
final Map<Guid, VDS> vdsById = Entities.businessEntitiesById(vdsList);
List<PairQueryable<VdsNetworkInterface, VDS>> vdsInterfaceVdsPairs = new ArrayList<>();
Network network = networkDao.get(getParameters().getId());
for (final VdsNetworkInterface vdsNetworkInterface : vdsNetworkInterfaceList) {
vdsInterfaceVdsPairs.add(new PairQueryable<>(vdsNetworkInterface, vdsById.get(vdsNetworkInterface.getVdsId())));
NetworkImplementationDetails vdsInterfaceNetworkImplementationDetails = networkImplementationDetailsUtils.calculateNetworkImplementationDetails(vdsNetworkInterface, network);
vdsNetworkInterface.setNetworkImplementationDetails(vdsInterfaceNetworkImplementationDetails);
}
getQueryReturnValue().setReturnValue(vdsInterfaceVdsPairs);
}
Aggregations