@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; }
@Override public boolean isOfferingForVpc(final NetworkOffering offering) { return offering.isForVpc(); }
public String getAvailability() { return availability == null ? Availability.Optional.toString() : availability; }
@Override protected boolean canHandle(final 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()) && supportedGuestTypes(offering, Network.GuestType.Isolated, Network.GuestType.Shared) && isMyIsolationMethod(physicalNetwork) && ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) { return true; } else { return false; } }
@Override protected boolean canHandle(NetworkOffering offering, NetworkType networkType, PhysicalNetwork physicalNetwork) { if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated && isMyIsolationMethod(physicalNetwork)) { 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 ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { return canHandle(offering.getTrafficType()); }
protected boolean canHandle(NetworkOffering offering) { return isMyTrafficType(offering.getTrafficType()) && offering.isSystemOnly(); }
private boolean supportedGuestTypes(NetworkOffering offering, GuestType... types) { for (GuestType guestType : types) { if (offering.getGuestType().equals(guestType)){ return true; } } return false; }
public DiskProfile(Volume vol, DiskOffering offering, HypervisorType hyperType) { this(vol.getId(), vol.getVolumeType(), vol.getName(), offering.getId(), vol.getSize(), offering.getTagsArray(), offering.isUseLocalStorage(), offering.isCustomized(), null); this.hyperType = hyperType; this.provisioningType = offering.getProvisioningType(); }
public boolean isNccServiceProvider(Network network) { NetworkOffering networkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId()); if(null!= networkOffering && networkOffering.getServicePackage() != null ) { return true; } else { return false; } }
@Override public boolean isNetworkSystem(Network network) { NetworkOffering no = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()); if (no.isSystemOnly()) { return true; } else { return false; } }
@Override public Long getDiskIopsReadRate(final ServiceOffering offering, final DiskOffering diskOffering) { if ((offering != null) && (offering.getIopsReadRate() != null) && (offering.getIopsReadRate() > 0)) { return offering.getIopsReadRate(); } else if ((diskOffering != null) && (diskOffering.getIopsReadRate() != null) && (diskOffering.getIopsReadRate() > 0)) { return diskOffering.getIopsReadRate(); } else { Long iopsReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsReadRate.key())); if ((iopsReadRate > 0) && ((offering == null) || (!offering.isSystemUse()))) { return iopsReadRate; } } return 0L; }
@Override public Long getDiskIopsWriteRate(final ServiceOffering offering, final DiskOffering diskOffering) { if ((offering != null) && (offering.getIopsWriteRate() != null) && (offering.getIopsWriteRate() > 0)) { return offering.getIopsWriteRate(); } else if ((diskOffering != null) && (diskOffering.getIopsWriteRate() != null) && (diskOffering.getIopsWriteRate() > 0)) { return diskOffering.getIopsWriteRate(); } else { Long iopsWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsWriteRate.key())); if ((iopsWriteRate > 0) && ((offering == null) || (!offering.isSystemUse()))) { return iopsWriteRate; } } return 0L; }
@Override public Long getDiskBytesWriteRate(final ServiceOffering offering, final DiskOffering diskOffering) { if ((offering != null) && (offering.getBytesWriteRate() != null) && (offering.getBytesWriteRate() > 0)) { return offering.getBytesWriteRate(); } else if ((diskOffering != null) && (diskOffering.getBytesWriteRate() != null) && (diskOffering.getBytesWriteRate() > 0)) { return diskOffering.getBytesWriteRate(); } else { Long bytesWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesWriteRate.key())); if ((bytesWriteRate > 0) && ((offering == null) || (!offering.isSystemUse()))) { return bytesWriteRate; } } return 0L; }
@Override public Long getDiskBytesReadRate(final ServiceOffering offering, final DiskOffering diskOffering) { if ((offering != null) && (offering.getBytesReadRate() != null) && (offering.getBytesReadRate() > 0)) { return offering.getBytesReadRate(); } else if ((diskOffering != null) && (diskOffering.getBytesReadRate() != null) && (diskOffering.getBytesReadRate() > 0)) { return diskOffering.getBytesReadRate(); } else { Long bytesReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesReadRate.key())); if ((bytesReadRate > 0) && ((offering == null) || (!offering.isSystemUse()))) { return bytesReadRate; } } return 0L; }
public String getName() { return name.name(); }
@Override public void allocate(final String vmInstanceName, final VirtualMachineTemplate template, final ServiceOffering serviceOffering, final LinkedHashMap<? extends Network, List<? extends NicProfile>> networks, final DeploymentPlan plan, final HypervisorType hyperType) throws InsufficientCapacityException { allocate(vmInstanceName, template, serviceOffering, new DiskOfferingInfo(serviceOffering), new ArrayList<DiskOfferingInfo>(), networks, plan, hyperType, null, null); }
@Override public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { if (!canHandle(dest, offering.getTrafficType())) { return false; } return true; }
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; } }
private boolean canHandle(NetworkOffering offering) { TrafficType type = offering.getTrafficType(); return (isMyTrafficType(type)); }