use of org.ovirt.engine.core.common.action.CreateOrUpdateBond in project ovirt-engine by oVirt.
the class HostSetupNetworksCommand method getExistingInterfacesAndNewlyCreatedBonds.
private List<VdsNetworkInterface> getExistingInterfacesAndNewlyCreatedBonds() {
List<VdsNetworkInterface> nicsToConfigure = new ArrayList<>();
nicsToConfigure.addAll(interfaceDao.getAllInterfacesForVds(getVdsId()));
for (CreateOrUpdateBond createOrUpdateBond : getParameters().getCreateOrUpdateBonds()) {
if (createOrUpdateBond.getId() == null) {
Bond newBond = new Bond(createOrUpdateBond.getName());
nicsToConfigure.add(newBond);
}
}
return nicsToConfigure;
}
use of org.ovirt.engine.core.common.action.CreateOrUpdateBond in project ovirt-engine by oVirt.
the class HostSetupNetworksValidator method validateBondModeVsNetworksAttachedToIt.
protected ValidationResult validateBondModeVsNetworksAttachedToIt(Collection<NetworkAttachment> attachmentsToConfigure) {
Map<String, VdsNetworkInterface> hostInterfacesByNetworkName = NetworkUtils.hostInterfacesByNetworkName(existingInterfaces);
for (NetworkAttachment attachment : attachmentsToConfigure) {
if (!mustAttachementBeCheckedForBondMode(attachment, hostInterfacesByNetworkName)) {
continue;
}
CreateOrUpdateBond bondToCheck = createOrUpdateBondBusinessEntityMap.get(attachment.getNicName());
if (bondToCheck == null) {
VdsNetworkInterface existingNetworkInterfaceForAttachement = existingInterfacesMap.get(attachment.getNicName());
if (existingNetworkInterfaceForAttachement == null || !existingNetworkInterfaceForAttachement.isBond()) {
continue;
}
bondToCheck = CreateOrUpdateBond.fromBond((Bond) existingNetworkInterfaceForAttachement);
}
String networkLabel = networkBusinessEntityMap.get(attachment.getNetworkName()).getLabel();
ValidationResult validationResult = checkBondMode(bondToCheck, networkLabel, attachment.getNetworkName());
if (!validationResult.isValid()) {
return validationResult;
}
}
return ValidationResult.VALID;
}
use of org.ovirt.engine.core.common.action.CreateOrUpdateBond in project ovirt-engine by oVirt.
the class ItemInfoPopup method showNic.
private void showNic(NetworkInterfaceModel nic) {
contents.removeAllRows();
VdsNetworkInterface entity = nic.getOriginalIface();
addRow(templates.titleSetupNetworkTooltip(nic.getName(), SafeStylesUtils.forTrustedBackgroundColor(BACKGROUND_COLOR)));
if (nic.getItems().isEmpty() && !nic.isBonded()) {
insertHorizontalLine();
addMtuInfo(entity.getMtu());
addBootProtoAndIpInfo(new InterfacePropertiesAccessor.FromNic(entity, null));
}
if (nic instanceof BondNetworkInterfaceModel) {
CreateOrUpdateBond createOrUpdateBond = ((BondNetworkInterfaceModel) nic).getCreateOrUpdateBond();
String bondOptions = entity.getBondOptions();
if (createOrUpdateBond != null) {
bondOptions = createOrUpdateBond.getBondOptions();
}
addRow(constants.bondOptionsItemInfo(), // $NON-NLS-1$
bondOptions.replace(BOND_OPTIONS_IP_SEPARATOR, BOND_OPTIONS_IP_SEPARATOR + " "));
} else {
addLldpInfo(nic);
}
if (nic.isVf()) {
addRow(constants.physicalFunction(), nic.getPhysicalFunction());
}
}
Aggregations