protected boolean canUpgrade(Network network, long oldNetworkOfferingId, long newNetworkOfferingId) { NetworkOffering oldNetworkOffering = _networkOfferingDao.findByIdIncludingRemoved(oldNetworkOfferingId); NetworkOffering newNetworkOffering = _networkOfferingDao.findById(newNetworkOfferingId); // security group service should be the same if (areServicesSupportedByNetworkOffering(oldNetworkOfferingId, Service.SecurityGroup) != areServicesSupportedByNetworkOffering(newNetworkOfferingId, Service.SecurityGroup)) { s_logger.debug("Offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different securityGroupProperty, can't upgrade"); return false; } // tags should be the same if (newNetworkOffering.getTags() != null) { if (oldNetworkOffering.getTags() == null) { s_logger.debug("New network offering id=" + newNetworkOfferingId + " has tags and old network offering id=" + oldNetworkOfferingId + " doesn't, can't upgrade"); return false; } if (!StringUtils.areTagsEqual(oldNetworkOffering.getTags(), newNetworkOffering.getTags())) { s_logger.debug("Network offerings " + newNetworkOffering.getUuid() + " and " + oldNetworkOffering.getUuid() + " have different tags, can't upgrade"); return false; } } // specify vlan should be the same if (oldNetworkOffering.isSpecifyVlan() != newNetworkOffering.isSpecifyVlan()) { s_logger.debug("Network offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different values for specifyVlan, can't upgrade"); return false; } return canMoveToPhysicalNetwork(network, oldNetworkOfferingId, newNetworkOfferingId); }
if (networkOffering.isSpecifyVlan()) { if (s_logger.isDebugEnabled()) { s_logger.debug("NuageVsp doesn't support VLAN values for networks");
@Override public List<Long> getOfferingIdsToUpgradeFrom(NetworkOffering originalOffering) { SearchCriteria<Long> sc = UpgradeSearch.create(); // exclude original offering sc.addAnd("id", SearchCriteria.Op.NEQ, originalOffering.getId()); // list only non-system offerings sc.addAnd("systemOnly", SearchCriteria.Op.EQ, false); // Type of the network should be the same sc.addAnd("guestType", SearchCriteria.Op.EQ, originalOffering.getGuestType()); // Traffic types should be the same sc.addAnd("trafficType", SearchCriteria.Op.EQ, originalOffering.getTrafficType()); sc.addAnd("state", SearchCriteria.Op.EQ, NetworkOffering.State.Enabled); //specify Vlan should be the same sc.addAnd("specifyVlan", SearchCriteria.Op.EQ, originalOffering.isSpecifyVlan()); return customSearch(sc, null); }
@Override public void shutdown(final NetworkProfile profile, final NetworkOffering offering) { if (profile.getBroadcastUri() == null) { return; // Nothing to do here if the uri is null already } if ((profile.getBroadcastDomainType() == BroadcastDomainType.Vlan || profile.getBroadcastDomainType() == BroadcastDomainType.Vxlan) && !offering.isSpecifyVlan()) { s_logger.debug("Releasing vnet for the network id=" + profile.getId()); _dcDao.releaseVnet(BroadcastDomainType.getValue(profile.getBroadcastUri()), profile.getDataCenterId(), profile.getPhysicalNetworkId(), profile.getAccountId(), profile.getReservationId()); ActionEventUtils.onCompletedActionEvent(CallContext.current().getCallingUserId(), profile.getAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_ZONE_VLAN_RELEASE, "Released Zone Vnet: " + BroadcastDomainType.getValue(profile.getBroadcastUri()) + " for Network: " + profile.getId(), 0); } profile.setBroadcastUri(null); }
if (offering.isSpecifyVlan()) { network.setBroadcastUri(userSpecified.getBroadcastUri()); network.setState(State.Setup);
response.setTrafficType(offering.getTrafficType().toString()); response.setIsDefault(offering.isDefault()); response.setSpecifyVlan(offering.isSpecifyVlan()); response.setConserveMode(offering.isConserveMode()); response.setSpecifyIpRanges(offering.isSpecifyIpRanges());
if (offering.isSpecifyVlan()) { network.setBroadcastUri(userSpecified.getBroadcastUri()); network.setState(State.Setup);