Search in sources :

Example 1 with JavaStorageLayer

use of com.cloud.storage.JavaStorageLayer in project cloudstack by apache.

the class KVMStorageProcessor method configure.

public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
    storageLayer = new JavaStorageLayer();
    storageLayer.configure("StorageLayer", params);
    String storageScriptsDir = (String) params.get("storage.scripts.dir");
    if (storageScriptsDir == null) {
        storageScriptsDir = getDefaultStorageScriptsDir();
    }
    _createTmplPath = Script.findScript(storageScriptsDir, "createtmplt.sh");
    if (_createTmplPath == null) {
        throw new ConfigurationException("Unable to find the createtmplt.sh");
    }
    _manageSnapshotPath = Script.findScript(storageScriptsDir, "managesnapshot.sh");
    if (_manageSnapshotPath == null) {
        throw new ConfigurationException("Unable to find the managesnapshot.sh");
    }
    final String value = (String) params.get("cmds.timeout");
    _cmdsTimeout = NumbersUtil.parseInt(value, 7200) * 1000;
    return true;
}
Also used : ConfigurationException(javax.naming.ConfigurationException) JavaStorageLayer(com.cloud.storage.JavaStorageLayer)

Example 2 with JavaStorageLayer

use of com.cloud.storage.JavaStorageLayer in project cosmic by MissionCriticalCloud.

the class LibvirtComputingResource method initStorage.

private void initStorage(final Map<String, Object> propertiesMap) throws ConfigurationException {
    storage = new JavaStorageLayer();
    storage.configure("StorageLayer", propertiesMap);
}
Also used : JavaStorageLayer(com.cloud.storage.JavaStorageLayer)

Example 3 with JavaStorageLayer

use of com.cloud.storage.JavaStorageLayer in project cosmic by MissionCriticalCloud.

the class KvmStorageProcessor method configure.

public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
    storageLayer = new JavaStorageLayer();
    storageLayer.configure("StorageLayer", params);
    String storageScriptsDir = (String) params.get("storage.scripts.dir");
    if (storageScriptsDir == null) {
        storageScriptsDir = getDefaultStorageScriptsDir();
    }
    createTmplPath = Script.findScript(storageScriptsDir, "createtmplt.sh");
    if (createTmplPath == null) {
        throw new ConfigurationException("Unable to find the createtmplt.sh");
    }
    manageSnapshotPath = Script.findScript(storageScriptsDir, "managesnapshot.sh");
    if (manageSnapshotPath == null) {
        throw new ConfigurationException("Unable to find the managesnapshot.sh");
    }
    cmdsTimeout = ((Integer) params.get("cmds.timeout")) * 1000;
    return true;
}
Also used : ConfigurationException(javax.naming.ConfigurationException) JavaStorageLayer(com.cloud.storage.JavaStorageLayer)

Example 4 with JavaStorageLayer

use of com.cloud.storage.JavaStorageLayer in project cloudstack by apache.

the class VmwareManagerImpl method configure.

@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    s_logger.info("Configure VmwareManagerImpl, manager name: " + name);
    if (!_configDao.isPremium()) {
        s_logger.error("Vmware component can only run under premium distribution");
        throw new ConfigurationException("Vmware component can only run under premium distribution");
    }
    _instance = _configDao.getValue(Config.InstanceName.key());
    if (_instance == null) {
        _instance = "DEFAULT";
    }
    s_logger.info("VmwareManagerImpl config - instance.name: " + _instance);
    _mountParent = _configDao.getValue(Config.MountParent.key());
    if (_mountParent == null) {
        _mountParent = File.separator + "mnt";
    }
    if (_instance != null) {
        _mountParent = _mountParent + File.separator + _instance;
    }
    s_logger.info("VmwareManagerImpl config - _mountParent: " + _mountParent);
    String value = (String) params.get("scripts.timeout");
    _timeout = NumbersUtil.parseInt(value, 1440) * 1000;
    _storage = (StorageLayer) params.get(StorageLayer.InstanceConfigKey);
    if (_storage == null) {
        _storage = new JavaStorageLayer();
        _storage.configure("StorageLayer", params);
    }
    value = _configDao.getValue(Config.VmwareCreateFullClone.key());
    if (value == null) {
        _fullCloneFlag = false;
    } else {
        _fullCloneFlag = Boolean.parseBoolean(value);
    }
    value = _configDao.getValue(Config.SetVmInternalNameUsingDisplayName.key());
    if (value == null) {
        _instanceNameFlag = false;
    } else {
        _instanceNameFlag = Boolean.parseBoolean(value);
    }
    _serviceConsoleName = _configDao.getValue(Config.VmwareServiceConsole.key());
    if (_serviceConsoleName == null) {
        _serviceConsoleName = "Service Console";
    }
    _managemetPortGroupName = _configDao.getValue(Config.VmwareManagementPortGroup.key());
    if (_managemetPortGroupName == null) {
        _managemetPortGroupName = "Management Network";
    }
    _defaultSystemVmNicAdapterType = _configDao.getValue(Config.VmwareSystemVmNicDeviceType.key());
    if (_defaultSystemVmNicAdapterType == null) {
        _defaultSystemVmNicAdapterType = VirtualEthernetCardType.E1000.toString();
    }
    _additionalPortRangeStart = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareAdditionalVncPortRangeStart.key()), 59000);
    if (_additionalPortRangeStart > 65535) {
        s_logger.warn("Invalid port range start port (" + _additionalPortRangeStart + ") for additional VNC port allocation, reset it to default start port 59000");
        _additionalPortRangeStart = 59000;
    }
    _additionalPortRangeSize = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareAdditionalVncPortRangeSize.key()), 1000);
    if (_additionalPortRangeSize < 0 || _additionalPortRangeStart + _additionalPortRangeSize > 65535) {
        s_logger.warn("Invalid port range size (" + _additionalPortRangeSize + " for range starts at " + _additionalPortRangeStart);
        _additionalPortRangeSize = Math.min(1000, 65535 - _additionalPortRangeStart);
    }
    _vCenterSessionTimeout = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 1200) * 1000;
    s_logger.info("VmwareManagerImpl config - vmware.vcenter.session.timeout: " + _vCenterSessionTimeout);
    _recycleHungWorker = _configDao.getValue(Config.VmwareRecycleHungWorker.key());
    if (_recycleHungWorker == null || _recycleHungWorker.isEmpty()) {
        _recycleHungWorker = "false";
    }
    _rootDiskController = _configDao.getValue(Config.VmwareRootDiskControllerType.key());
    if (_rootDiskController == null || _rootDiskController.isEmpty()) {
        _rootDiskController = DiskControllerType.ide.toString();
    }
    s_logger.info("Additional VNC port allocation range is settled at " + _additionalPortRangeStart + " to " + (_additionalPortRangeStart + _additionalPortRangeSize));
    ((VmwareStorageManagerImpl) _storageMgr).configure(params);
    _agentMgr.registerForHostEvents(this, true, true, true);
    s_logger.info("VmwareManagerImpl has been successfully configured");
    return true;
}
Also used : ConfigurationException(javax.naming.ConfigurationException) JavaStorageLayer(com.cloud.storage.JavaStorageLayer)

Example 5 with JavaStorageLayer

use of com.cloud.storage.JavaStorageLayer in project cloudstack by apache.

the class HypervManagerImpl method configure.

@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    if (params != null) {
        String value = (String) params.get("scripts.timeout");
        _timeout = NumbersUtil.parseInt(value, 30) * 1000;
        _storage = (StorageLayer) params.get(StorageLayer.InstanceConfigKey);
    }
    if (_storage == null) {
        _storage = new JavaStorageLayer();
        _storage.configure("StorageLayer", params);
    }
    _routerExtraPublicNics = NumbersUtil.parseInt(_configDao.getValue(Config.RouterExtraPublicNics.key()), 2);
    return true;
}
Also used : JavaStorageLayer(com.cloud.storage.JavaStorageLayer)

Aggregations

JavaStorageLayer (com.cloud.storage.JavaStorageLayer)6 ConfigurationException (javax.naming.ConfigurationException)4 VirtualRoutingResource (com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource)1 RollingMaintenanceAgentExecutor (com.cloud.hypervisor.kvm.resource.rolling.maintenance.RollingMaintenanceAgentExecutor)1 RollingMaintenanceServiceExecutor (com.cloud.hypervisor.kvm.resource.rolling.maintenance.RollingMaintenanceServiceExecutor)1 IscsiStorageCleanupMonitor (com.cloud.hypervisor.kvm.storage.IscsiStorageCleanupMonitor)1 KVMStoragePoolManager (com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager)1 KVMStorageProcessor (com.cloud.hypervisor.kvm.storage.KVMStorageProcessor)1 StorageSubsystemCommandHandlerBase (com.cloud.storage.resource.StorageSubsystemCommandHandlerBase)1 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 QemuImgFile (org.apache.cloudstack.utils.qemu.QemuImgFile)1 Connect (org.libvirt.Connect)1 LibvirtException (org.libvirt.LibvirtException)1 Network (org.libvirt.Network)1