private String getMountParent() { return getEnvironmentProperty("mount.parent"); }
saveUser(); createServiceOffering(User.UID_SYSTEM, "Small Instance", 1, 512, 500, "Small Instance", ProvisioningType.THIN, false, false, null); createServiceOffering(User.UID_SYSTEM, "Medium Instance", 1, 1024, 1000, "Medium Instance", ProvisioningType.THIN, false, false, null); createdefaultDiskOffering(null, "Small", "Small Disk, 5 GB", ProvisioningType.THIN, 5, null, false, false); createdefaultDiskOffering(null, "Medium", "Medium Disk, 20 GB", ProvisioningType.THIN, 20, null, false, false); createdefaultDiskOffering(null, "Large", "Large Disk, 100 GB", ProvisioningType.THIN, 100, null, false, false); createdefaultDiskOffering(null, "Large", "Large Disk, 100 GB", ProvisioningType.THIN, 100, null, false, false); createdefaultDiskOffering(null, "Custom", "Custom Disk", ProvisioningType.THIN, 0, null, true, false); String mountParent = getMountParent(); if (mountParent != null) { _configDao.update(Config.MountParent.key(), Config.MountParent.getCategory(), mountParent); updateSSOKey(); createDefaultNetworkOfferings(); createDefaultNetworks(); for (final VlanVO vlan : vlans) { if (vlan.getNetworkId().longValue() == 0) { updateVlanWithNetworkId(vlan); updateResourceCount(); updateKeyPairs();
@Override public boolean isReady(PhysicalNetworkServiceProvider provider) { Map<String, String> serviceMap = ((ConfigurationServerImpl)_configServer).getServicesAndProvidersForNetwork( _manager.getRouterOffering().getId()); List<TrafficType> types = new ArrayList<TrafficType>(); types.add(TrafficType.Control); types.add(TrafficType.Management); types.add(TrafficType.Storage); List<NetworkVO> systemNets = _manager.findSystemNetworks(types); if (systemNets != null && !systemNets.isEmpty()) { for (NetworkVO net: systemNets) { s_logger.debug("update system network service: " + net.getName() + "; service provider: " + serviceMap); _networksDao.update(net.getId(), net, serviceMap); } } else { s_logger.debug("no system networks created yet"); } serviceMap = ((ConfigurationServerImpl)_configServer).getServicesAndProvidersForNetwork( _manager.getPublicRouterOffering().getId()); types = new ArrayList<TrafficType>(); types.add(TrafficType.Public); systemNets = _manager.findSystemNetworks(types); if (systemNets != null && !systemNets.isEmpty()) { for (NetworkVO net: systemNets) { s_logger.debug("update system network service: " + net.getName() + "; service provider: " + serviceMap); _networksDao.update(net.getId(), net, serviceMap); } } else { s_logger.debug("no system networks created yet"); } return true; }
protected void injectSshKeysIntoSystemVmIsoPatch(String publicKeyPath, String privKeyPath) { s_logger.info("Trying to inject public and private keys into systemvm iso"); String injectScript = getInjectScript(); String scriptPath = Script.findScript("", injectScript); String systemVmIsoPath = Script.findScript("", "vms/systemvm.iso"); if(isOnWindows()) { command = new Script("python", s_logger); } else { command = new Script("/bin/bash", s_logger); if (isOnWindows()) { scriptPath = scriptPath.replaceAll("\\\\" ,"/" ); systemVmIsoPath = systemVmIsoPath.replaceAll("\\\\" ,"/" );
private ServiceOfferingVO createServiceOffering(long userId, String name, int cpu, int ramSize, int speed, String displayText, ProvisioningType provisioningType, boolean localStorageRequired, boolean offerHA, String tags) { tags = cleanupTags(tags); ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, speed, null, null, offerHA, displayText, provisioningType, localStorageRequired, false, tags, false, null, false); offering.setUniqueName("Cloud.Com-" + name); // leaving the above reference to cloud.com in as it is an identifyer and has no real world relevance offering = _serviceOfferingDao.persistSystemServiceOffering(offering); return offering; }
network.setDns2(zone.getDns2()); network.setState(State.Implemented); _networkDao.persist(network, false, getServicesAndProvidersForNetwork(networkOfferingId)); id++;
private DiskOfferingVO createdefaultDiskOffering(Long domainId, String name, String description, ProvisioningType provisioningType, int numGibibytes, String tags, boolean isCustomized, boolean isSystemUse) { long diskSize = numGibibytes; diskSize = diskSize * 1024 * 1024 * 1024; tags = cleanupTags(tags); DiskOfferingVO newDiskOffering = new DiskOfferingVO(domainId, name, description, provisioningType, diskSize, tags, isCustomized, null, null, null); newDiskOffering.setUniqueName("Cloud.Com-" + name); // leaving the above reference to cloud.com in as it is an identifyer and has no real world relevance newDiskOffering.setSystemUse(isSystemUse); newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering); return newDiskOffering; }