@Override public boolean resourceCountNeedsUpdate(final NetworkOffering ntwkOff, final ACLType aclType) { //Update resource count only for Isolated account specific non-system networks final boolean updateResourceCount = ntwkOff.getGuestType() == GuestType.Isolated && !ntwkOff.isSystemOnly() && aclType == ACLType.Account; return updateResourceCount; }
protected boolean canHandle(NetworkOffering offering) { if (isMyTrafficType(offering.getTrafficType()) && offering.isSystemOnly()) { return true; } else { s_logger.trace("It's not storage network offering, skip it."); return false; } }
protected boolean canHandle(NetworkOffering offering) { if (offering.isSystemOnly() && isMyTrafficType(offering.getTrafficType())) { return true; } else { s_logger.trace("We only care about System only Control network"); return false; } }
@Override public boolean isNetworkSystem(Network network) { NetworkOffering no = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()); if (no.isSystemOnly()) { return true; } else { return false; } }
protected boolean isNetworkSystem(Network network) { NetworkOffering no = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()); if (no.isSystemOnly()) { return true; } else { return false; } }
protected boolean canHandle(NetworkOffering offering) { return isMyTrafficType(offering.getTrafficType()) && offering.isSystemOnly(); }
protected boolean canHandle(NetworkOffering offering, DataCenter dc) { // This guru handles only system Guest network if (dc.getNetworkType() == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated && offering.isSystemOnly()) { return true; } else { s_logger.trace("We only take care of system Guest networks of type " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced); return false; } }
@Override public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { if (offering.isSystemOnly() || !canHandle(dest, offering.getTrafficType(), network.getGuestType())) { s_logger.debug("BaremetalDhcpElement can not handle networkoffering: " + offering.getName()); return false; } return true; }
@Override protected boolean canHandle(NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) { // This guru handles only Guest Isolated network that supports Source // nat service if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && (offering.getGuestType() == Network.GuestType.Isolated || offering.getGuestType() == GuestType.L2) && isMyIsolationMethod(physicalNetwork) && !offering.isSystemOnly()) { return true; } else { s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced); return false; } }
@Override public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { if (dest.getDataCenter().getNetworkType() == DataCenter.NetworkType.Advanced){ return true; } if (offering.isSystemOnly() || !canHandle(dest, offering.getTrafficType(), network.getGuestType())) { s_logger.debug("BaremetalPxeElement can not handle network offering: " + offering.getName()); return false; } return true; }
throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { if (offering.isSystemOnly()) { return false;
private void verifyNetworkCanBeMigrated(Account callerAccount, Network network) { // Don't allow to update system network NetworkOffering oldOffering = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()); if (oldOffering.isSystemOnly()) { throw new InvalidParameterValueException("Failed to migrate network as the specified network is a system network."); } // allow to upgrade only Guest networks if (network.getTrafficType() != TrafficType.Guest) { throw new InvalidParameterValueException("Can't allow networks which traffic type is not " + TrafficType.Guest); } _accountMgr.checkAccess(callerAccount, null, true, network); boolean validateNetworkReadyToMigrate = (network.getState() == Network.State.Implemented || network.getState() == Network.State.Setup || network.getState() == Network.State.Allocated); if (!validateNetworkReadyToMigrate) { s_logger.error("Failed to migrate network as it is in invalid state."); CloudRuntimeException ex = new CloudRuntimeException("Failed to migrate network as it is in invalid state."); ex.addProxyObject(network.getUuid(), "networkId"); throw ex; } }
if (networkOffering.isSystemOnly()) { throw new InvalidParameterValueException("Network id=" + networkId + " is system only and can't be used for vm deployment");
private boolean networkNeedsMigration(Network network, long newPhysicalNetworkId, NetworkOffering oldNtwkOff, NetworkOffering newNtwkOff) { if (newNtwkOff == null || newNtwkOff.isSystemOnly()) { InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find network offering."); if (newNtwkOff != null) {
if (offering.isSystemOnly()) { throw new InvalidParameterValueException("Can't update system networks");
if (networkOffering.isSystemOnly()) { InvalidParameterValueException ex = new InvalidParameterValueException( "Specified Network id is system only and can't be used for vm deployment"); if (networkOffering.isSystemOnly()) { InvalidParameterValueException ex = new InvalidParameterValueException("Specified Network id is system only and can't be used for vm deployment"); ex.addProxyObject(network.getUuid(), "networkId");
if (offering.isSystemOnly()) { throw new InvalidParameterValueException("Can't update system networks");
response.setNetworkOfferingDisplayText(networkOffering.getDisplayText()); response.setNetworkOfferingConserveMode(networkOffering.isConserveMode()); response.setIsSystem(networkOffering.isSystemOnly()); response.setNetworkOfferingAvailability(networkOffering.getAvailability().toString()); response.setIsPersistent(networkOffering.isPersistent());