Search in sources :

Example 6 with StorageLayer

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

the class LibvirtCreatePrivateTemplateFromVolumeCommandWrapper method execute.

@Override
public Answer execute(final CreatePrivateTemplateFromVolumeCommand command, final LibvirtComputingResource libvirtComputingResource) {
    final String secondaryStorageURL = command.getSecondaryStorageUrl();
    KVMStoragePool secondaryStorage = null;
    KVMStoragePool primary = null;
    final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    try {
        final String templateFolder = command.getAccountId() + File.separator + command.getTemplateId() + File.separator;
        final String templateInstallFolder = "/template/tmpl/" + templateFolder;
        secondaryStorage = storagePoolMgr.getStoragePoolByURI(secondaryStorageURL);
        try {
            primary = storagePoolMgr.getStoragePool(command.getPool().getType(), command.getPrimaryStoragePoolNameLabel());
        } catch (final CloudRuntimeException e) {
            if (e.getMessage().contains("not found")) {
                primary = storagePoolMgr.createStoragePool(command.getPool().getUuid(), command.getPool().getHost(), command.getPool().getPort(), command.getPool().getPath(), command.getPool().getUserInfo(), command.getPool().getType());
            } else {
                return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
            }
        }
        final KVMPhysicalDisk disk = primary.getPhysicalDisk(command.getVolumePath());
        final String tmpltPath = secondaryStorage.getLocalPath() + File.separator + templateInstallFolder;
        final StorageLayer storage = libvirtComputingResource.getStorage();
        storage.mkdirs(tmpltPath);
        if (primary.getType() != StoragePoolType.RBD) {
            final String createTmplPath = libvirtComputingResource.createTmplPath();
            final int cmdsTimeout = libvirtComputingResource.getCmdsTimeout();
            final Script scriptCommand = new Script(createTmplPath, cmdsTimeout, s_logger);
            scriptCommand.add("-f", disk.getPath());
            scriptCommand.add("-t", tmpltPath);
            scriptCommand.add("-n", command.getUniqueName() + ".qcow2");
            final String result = scriptCommand.execute();
            if (result != null) {
                s_logger.debug("failed to create template: " + result);
                return new CreatePrivateTemplateAnswer(command, false, result);
            }
        } else {
            s_logger.debug("Converting RBD disk " + disk.getPath() + " into template " + command.getUniqueName());
            final QemuImgFile srcFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(primary.getSourceHost(), primary.getSourcePort(), primary.getAuthUserName(), primary.getAuthSecret(), disk.getPath()));
            srcFile.setFormat(PhysicalDiskFormat.RAW);
            final QemuImgFile destFile = new QemuImgFile(tmpltPath + "/" + command.getUniqueName() + ".qcow2");
            destFile.setFormat(PhysicalDiskFormat.QCOW2);
            final QemuImg q = new QemuImg(0);
            try {
                q.convert(srcFile, destFile);
            } catch (final QemuImgException | LibvirtException e) {
                s_logger.error("Failed to create new template while converting " + srcFile.getFileName() + " to " + destFile.getFileName() + " the error was: " + e.getMessage());
            }
            final File templateProp = new File(tmpltPath + "/template.properties");
            if (!templateProp.exists()) {
                templateProp.createNewFile();
            }
            String templateContent = "filename=" + command.getUniqueName() + ".qcow2" + System.getProperty("line.separator");
            final DateFormat dateFormat = new SimpleDateFormat("MM_dd_yyyy");
            final Date date = new Date();
            templateContent += "snapshot.name=" + dateFormat.format(date) + System.getProperty("line.separator");
            try (FileOutputStream templFo = new FileOutputStream(templateProp)) {
                templFo.write(templateContent.getBytes("UTF-8"));
                templFo.flush();
            } catch (final IOException ex) {
                s_logger.error("CreatePrivateTemplateAnswer:Exception:" + ex.getMessage());
            }
        }
        final Map<String, Object> params = new HashMap<String, Object>();
        params.put(StorageLayer.InstanceConfigKey, storage);
        final Processor qcow2Processor = new QCOW2Processor();
        qcow2Processor.configure("QCOW2 Processor", params);
        final FormatInfo info = qcow2Processor.process(tmpltPath, null, command.getUniqueName());
        final TemplateLocation loc = new TemplateLocation(storage, tmpltPath);
        loc.create(1, true, command.getUniqueName());
        loc.addFormat(info);
        loc.save();
        return new CreatePrivateTemplateAnswer(command, true, null, templateInstallFolder + command.getUniqueName() + ".qcow2", info.virtualSize, info.size, command.getUniqueName(), ImageFormat.QCOW2);
    } catch (final InternalErrorException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final IOException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final ConfigurationException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final CloudRuntimeException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } finally {
        if (secondaryStorage != null) {
            storagePoolMgr.deleteStoragePool(secondaryStorage.getType(), secondaryStorage.getUuid());
        }
    }
}
Also used : StorageLayer(com.cloud.storage.StorageLayer) LibvirtException(org.libvirt.LibvirtException) Processor(com.cloud.storage.template.Processor) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) HashMap(java.util.HashMap) KVMStoragePool(com.cloud.hypervisor.kvm.storage.KVMStoragePool) ConfigurationException(javax.naming.ConfigurationException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) TemplateLocation(com.cloud.storage.template.TemplateLocation) QemuImgException(org.apache.cloudstack.utils.qemu.QemuImgException) Script(com.cloud.utils.script.Script) KVMStoragePoolManager(com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager) KVMPhysicalDisk(com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk) IOException(java.io.IOException) InternalErrorException(com.cloud.exception.InternalErrorException) Date(java.util.Date) QemuImg(org.apache.cloudstack.utils.qemu.QemuImg) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) QemuImgFile(org.apache.cloudstack.utils.qemu.QemuImgFile) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) FileOutputStream(java.io.FileOutputStream) CreatePrivateTemplateAnswer(com.cloud.agent.api.storage.CreatePrivateTemplateAnswer) FormatInfo(com.cloud.storage.template.Processor.FormatInfo) QemuImgFile(org.apache.cloudstack.utils.qemu.QemuImgFile) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat)

Example 7 with StorageLayer

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

the class LocalSecondaryStorageResource method configure.

@Override
@SuppressWarnings("unchecked")
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    super.configure(name, params);
    _guid = (String) params.get("guid");
    if (_guid == null) {
        throw new ConfigurationException("Unable to find the guid");
    }
    _dc = (String) params.get("zone");
    if (_dc == null) {
        throw new ConfigurationException("Unable to find the zone");
    }
    _pod = (String) params.get("pod");
    _instance = (String) params.get("instance");
    _parent = (String) params.get("mount.path");
    if (_parent == null) {
        throw new ConfigurationException("No directory specified.");
    }
    _storage = (StorageLayer) params.get(StorageLayer.InstanceConfigKey);
    if (_storage == null) {
        String value = (String) params.get(StorageLayer.ClassConfigKey);
        if (value == null) {
            value = "com.cloud.storage.JavaStorageLayer";
        }
        try {
            Class<StorageLayer> clazz = (Class<StorageLayer>) Class.forName(value);
            _storage = ComponentContext.inject(clazz);
        } catch (ClassNotFoundException e) {
            throw new ConfigurationException("Unable to find class " + value);
        }
    }
    if (!_storage.mkdirs(_parent)) {
        s_logger.warn("Unable to create the directory " + _parent);
        throw new ConfigurationException("Unable to create the directory " + _parent);
    }
    s_logger.info("Mount point established at " + _parent);
    params.put("template.parent", _parent);
    params.put(StorageLayer.InstanceConfigKey, _storage);
    _dlMgr = new DownloadManagerImpl();
    _dlMgr.configure("DownloadManager", params);
    return true;
}
Also used : DownloadManagerImpl(org.apache.cloudstack.storage.template.DownloadManagerImpl) StorageLayer(com.cloud.storage.StorageLayer) ConfigurationException(javax.naming.ConfigurationException)

Example 8 with StorageLayer

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

the class DownloadManagerImpl method configure.

@Override
@SuppressWarnings("unchecked")
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    _name = name;
    String value = null;
    _storage = (StorageLayer) params.get(StorageLayer.InstanceConfigKey);
    if (_storage == null) {
        value = (String) params.get(StorageLayer.ClassConfigKey);
        if (value == null) {
            throw new ConfigurationException("Unable to find the storage layer");
        }
        Class<StorageLayer> clazz;
        try {
            clazz = (Class<StorageLayer>) Class.forName(value);
            _storage = clazz.newInstance();
        } catch (ClassNotFoundException e) {
            throw new ConfigurationException("Unable to instantiate " + value);
        } catch (InstantiationException e) {
            throw new ConfigurationException("Unable to instantiate " + value);
        } catch (IllegalAccessException e) {
            throw new ConfigurationException("Unable to instantiate " + value);
        }
    }
    String inSystemVM = (String) params.get("secondary.storage.vm");
    if (inSystemVM != null && "true".equalsIgnoreCase(inSystemVM)) {
        LOGGER.info("DownloadManager: starting additional services since we are inside system vm");
        _nfsVersion = NfsSecondaryStorageResource.retrieveNfsVersionFromParams(params);
        startAdditionalServices();
        blockOutgoingOnPrivate();
    }
    value = (String) params.get("install.timeout.pergig");
    installTimeoutPerGig = NumbersUtil.parseInt(value, 15 * 60) * 1000;
    value = (String) params.get("install.numthreads");
    final int numInstallThreads = NumbersUtil.parseInt(value, 10);
    String scriptsDir = (String) params.get("template.scripts.dir");
    if (scriptsDir == null) {
        scriptsDir = "scripts/storage/secondary";
    }
    listTmpltScr = Script.findScript(scriptsDir, "listvmtmplt.sh");
    if (listTmpltScr == null) {
        throw new ConfigurationException("Unable to find the listvmtmplt.sh");
    }
    LOGGER.info("listvmtmplt.sh found in " + listTmpltScr);
    createTmpltScr = Script.findScript(scriptsDir, "createtmplt.sh");
    if (createTmpltScr == null) {
        throw new ConfigurationException("Unable to find createtmplt.sh");
    }
    LOGGER.info("createtmplt.sh found in " + createTmpltScr);
    listVolScr = Script.findScript(scriptsDir, "listvolume.sh");
    if (listVolScr == null) {
        throw new ConfigurationException("Unable to find the listvolume.sh");
    }
    LOGGER.info("listvolume.sh found in " + listVolScr);
    createVolScr = Script.findScript(scriptsDir, "createvolume.sh");
    if (createVolScr == null) {
        throw new ConfigurationException("Unable to find createvolume.sh");
    }
    LOGGER.info("createvolume.sh found in " + createVolScr);
    _processors = new HashMap<String, Processor>();
    Processor processor = new VhdProcessor();
    processor.configure("VHD Processor", params);
    _processors.put("VHD Processor", processor);
    processor = new IsoProcessor();
    processor.configure("ISO Processor", params);
    _processors.put("ISO Processor", processor);
    processor = new QCOW2Processor();
    processor.configure("QCOW2 Processor", params);
    _processors.put("QCOW2 Processor", processor);
    processor = new OVAProcessor();
    processor.configure("OVA Processor", params);
    _processors.put("OVA Processor", processor);
    processor = new VmdkProcessor();
    processor.configure("VMDK Processor", params);
    _processors.put("VMDK Processor", processor);
    processor = new RawImageProcessor();
    processor.configure("Raw Image Processor", params);
    _processors.put("Raw Image Processor", processor);
    processor = new TARProcessor();
    processor.configure("TAR Processor", params);
    _processors.put("TAR Processor", processor);
    _templateDir = (String) params.get("public.templates.root.dir");
    if (_templateDir == null) {
        _templateDir = TemplateConstants.DEFAULT_TMPLT_ROOT_DIR;
    }
    _templateDir += File.separator + TemplateConstants.DEFAULT_TMPLT_FIRST_LEVEL_DIR;
    _volumeDir = TemplateConstants.DEFAULT_VOLUME_ROOT_DIR + File.separator;
    // Add more processors here.
    threadPool = Executors.newFixedThreadPool(numInstallThreads);
    return true;
}
Also used : IsoProcessor(com.cloud.storage.template.IsoProcessor) StorageLayer(com.cloud.storage.StorageLayer) VhdProcessor(com.cloud.storage.template.VhdProcessor) OVAProcessor(com.cloud.storage.template.OVAProcessor) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) TARProcessor(com.cloud.storage.template.TARProcessor) IsoProcessor(com.cloud.storage.template.IsoProcessor) Processor(com.cloud.storage.template.Processor) VmdkProcessor(com.cloud.storage.template.VmdkProcessor) RawImageProcessor(com.cloud.storage.template.RawImageProcessor) OVAProcessor(com.cloud.storage.template.OVAProcessor) RawImageProcessor(com.cloud.storage.template.RawImageProcessor) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) ConfigurationException(javax.naming.ConfigurationException) VmdkProcessor(com.cloud.storage.template.VmdkProcessor) VhdProcessor(com.cloud.storage.template.VhdProcessor) TARProcessor(com.cloud.storage.template.TARProcessor)

Example 9 with StorageLayer

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

the class LibvirtCreatePrivateTemplateFromSnapshotCommandWrapper method execute.

@Override
public Answer execute(final CreatePrivateTemplateFromSnapshotCommand command, final LibvirtComputingResource libvirtComputingResource) {
    final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    final String templateFolder = command.getAccountId() + File.separator + command.getNewTemplateId();
    final String templateInstallFolder = "template/tmpl/" + templateFolder;
    final String tmplName = libvirtUtilitiesHelper.generateUuidName();
    final String tmplFileName = tmplName + ".qcow2";
    KvmStoragePool secondaryPool = null;
    KvmStoragePool snapshotPool = null;
    final KvmStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    try {
        String snapshotPath = command.getSnapshotUuid();
        final int index = snapshotPath.lastIndexOf("/");
        snapshotPath = snapshotPath.substring(0, index);
        snapshotPool = storagePoolMgr.getStoragePoolByUri(command.getSecondaryStorageUrl() + snapshotPath);
        secondaryPool = storagePoolMgr.getStoragePoolByUri(command.getSecondaryStorageUrl());
        final KvmPhysicalDisk snapshot = snapshotPool.getPhysicalDisk(command.getSnapshotName());
        final String templatePath = secondaryPool.getLocalPath() + File.separator + templateInstallFolder;
        final StorageLayer storage = libvirtComputingResource.getStorage();
        storage.mkdirs(templatePath);
        final String tmplPath = templateInstallFolder + File.separator + tmplFileName;
        final String createTmplPath = libvirtComputingResource.createTmplPath();
        final int cmdsTimeout = libvirtComputingResource.getCmdsTimeout();
        final Script scriptCommand = new Script(createTmplPath, cmdsTimeout, s_logger);
        scriptCommand.add("-t", templatePath);
        scriptCommand.add("-n", tmplFileName);
        scriptCommand.add("-f", snapshot.getPath());
        scriptCommand.execute();
        final Processor qcow2Processor = libvirtUtilitiesHelper.buildQcow2Processor(storage);
        final FormatInfo info = qcow2Processor.process(templatePath, null, tmplName);
        final TemplateLocation loc = libvirtUtilitiesHelper.buildTemplateLocation(storage, templatePath);
        loc.create(1, true, tmplName);
        loc.addFormat(info);
        loc.save();
        return new CreatePrivateTemplateAnswer(command, true, "", tmplPath, info.virtualSize, info.size, tmplName, info.format);
    } catch (final ConfigurationException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
    } catch (final InternalErrorException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
    } catch (final IOException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
    } catch (final CloudRuntimeException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
    } finally {
        if (secondaryPool != null) {
            storagePoolMgr.deleteStoragePool(secondaryPool.getType(), secondaryPool.getUuid());
        }
        if (snapshotPool != null) {
            storagePoolMgr.deleteStoragePool(snapshotPool.getType(), snapshotPool.getUuid());
        }
    }
}
Also used : Script(com.cloud.utils.script.Script) KvmStoragePool(com.cloud.hypervisor.kvm.storage.KvmStoragePool) StorageLayer(com.cloud.storage.StorageLayer) Processor(com.cloud.storage.template.Processor) InternalErrorException(com.cloud.exception.InternalErrorException) IOException(java.io.IOException) ConfigurationException(javax.naming.ConfigurationException) TemplateLocation(com.cloud.storage.template.TemplateLocation) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) KvmStoragePoolManager(com.cloud.hypervisor.kvm.storage.KvmStoragePoolManager) CreatePrivateTemplateAnswer(com.cloud.agent.api.storage.CreatePrivateTemplateAnswer) KvmPhysicalDisk(com.cloud.hypervisor.kvm.storage.KvmPhysicalDisk) FormatInfo(com.cloud.storage.template.Processor.FormatInfo)

Example 10 with StorageLayer

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

the class LibvirtCreatePrivateTemplateFromVolumeCommandWrapper method execute.

@Override
public Answer execute(final CreatePrivateTemplateFromVolumeCommand command, final LibvirtComputingResource libvirtComputingResource) {
    final String secondaryStorageUrl = command.getSecondaryStorageUrl();
    KvmStoragePool secondaryStorage = null;
    KvmStoragePool primary = null;
    final KvmStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    try {
        final String templateFolder = command.getAccountId() + File.separator + command.getTemplateId() + File.separator;
        final String templateInstallFolder = "/template/tmpl/" + templateFolder;
        secondaryStorage = storagePoolMgr.getStoragePoolByUri(secondaryStorageUrl);
        try {
            primary = storagePoolMgr.getStoragePool(command.getPool().getType(), command.getPrimaryStoragePoolNameLabel());
        } catch (final CloudRuntimeException e) {
            if (e.getMessage().contains("not found")) {
                primary = storagePoolMgr.createStoragePool(command.getPool().getUuid(), command.getPool().getHost(), command.getPool().getPort(), command.getPool().getPath(), command.getPool().getUserInfo(), command.getPool().getType());
            } else {
                return new CreatePrivateTemplateAnswer(command, false, e.getMessage());
            }
        }
        final KvmPhysicalDisk disk = primary.getPhysicalDisk(command.getVolumePath());
        final String tmpltPath = secondaryStorage.getLocalPath() + File.separator + templateInstallFolder;
        final StorageLayer storage = libvirtComputingResource.getStorage();
        storage.mkdirs(tmpltPath);
        if (primary.getType() != StoragePoolType.RBD) {
            final String createTmplPath = libvirtComputingResource.createTmplPath();
            final int cmdsTimeout = libvirtComputingResource.getCmdsTimeout();
            final Script scriptCommand = new Script(createTmplPath, cmdsTimeout, s_logger);
            scriptCommand.add("-f", disk.getPath());
            scriptCommand.add("-t", tmpltPath);
            scriptCommand.add("-n", command.getUniqueName() + ".qcow2");
            final String result = scriptCommand.execute();
            if (result != null) {
                s_logger.debug("failed to create template: " + result);
                return new CreatePrivateTemplateAnswer(command, false, result);
            }
        } else {
            s_logger.debug("Converting RBD disk " + disk.getPath() + " into template " + command.getUniqueName());
            final QemuImgFile srcFile = new QemuImgFile(KvmPhysicalDisk.rbdStringBuilder(primary.getSourceHost(), primary.getSourcePort(), primary.getAuthUserName(), primary.getAuthSecret(), disk.getPath()));
            srcFile.setFormat(PhysicalDiskFormat.RAW);
            final QemuImgFile destFile = new QemuImgFile(tmpltPath + "/" + command.getUniqueName() + ".qcow2");
            destFile.setFormat(PhysicalDiskFormat.QCOW2);
            final QemuImg q = new QemuImg(0);
            try {
                q.convert(srcFile, destFile);
            } catch (final QemuImgException e) {
                s_logger.error("Failed to create new template while converting " + srcFile.getFileName() + " to " + destFile.getFileName() + " the error was: " + e.getMessage());
            }
            final File templateProp = new File(tmpltPath + "/template.properties");
            if (!templateProp.exists()) {
                templateProp.createNewFile();
            }
            String templateContent = "filename=" + command.getUniqueName() + ".qcow2" + System.getProperty("line.separator");
            final DateFormat dateFormat = new SimpleDateFormat("MM_dd_yyyy");
            final Date date = new Date();
            templateContent += "snapshot.name=" + dateFormat.format(date) + System.getProperty("line.separator");
            try (FileOutputStream templFo = new FileOutputStream(templateProp)) {
                templFo.write(templateContent.getBytes("UTF-8"));
                templFo.flush();
            } catch (final IOException ex) {
                s_logger.error("CreatePrivateTemplateAnswer:Exception:" + ex.getMessage());
            }
        }
        final Map<String, Object> params = new HashMap<>();
        params.put(StorageLayer.InstanceConfigKey, storage);
        final Processor qcow2Processor = new QCOW2Processor();
        qcow2Processor.configure("QCOW2 Processor", params);
        final FormatInfo info = qcow2Processor.process(tmpltPath, null, command.getUniqueName());
        final TemplateLocation loc = new TemplateLocation(storage, tmpltPath);
        loc.create(1, true, command.getUniqueName());
        loc.addFormat(info);
        loc.save();
        return new CreatePrivateTemplateAnswer(command, true, null, templateInstallFolder + command.getUniqueName() + ".qcow2", info.virtualSize, info.size, command.getUniqueName(), ImageFormat.QCOW2);
    } catch (final InternalErrorException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final IOException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final ConfigurationException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } catch (final CloudRuntimeException e) {
        return new CreatePrivateTemplateAnswer(command, false, e.toString());
    } finally {
        if (secondaryStorage != null) {
            storagePoolMgr.deleteStoragePool(secondaryStorage.getType(), secondaryStorage.getUuid());
        }
    }
}
Also used : KvmStoragePool(com.cloud.hypervisor.kvm.storage.KvmStoragePool) StorageLayer(com.cloud.storage.StorageLayer) Processor(com.cloud.storage.template.Processor) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) HashMap(java.util.HashMap) ConfigurationException(javax.naming.ConfigurationException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) TemplateLocation(com.cloud.storage.template.TemplateLocation) QemuImgException(com.cloud.utils.qemu.QemuImgException) KvmStoragePoolManager(com.cloud.hypervisor.kvm.storage.KvmStoragePoolManager) KvmPhysicalDisk(com.cloud.hypervisor.kvm.storage.KvmPhysicalDisk) Script(com.cloud.utils.script.Script) IOException(java.io.IOException) InternalErrorException(com.cloud.exception.InternalErrorException) Date(java.util.Date) QemuImg(com.cloud.utils.qemu.QemuImg) QCOW2Processor(com.cloud.storage.template.QCOW2Processor) QemuImgFile(com.cloud.utils.qemu.QemuImgFile) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) FileOutputStream(java.io.FileOutputStream) CreatePrivateTemplateAnswer(com.cloud.agent.api.storage.CreatePrivateTemplateAnswer) FormatInfo(com.cloud.storage.template.Processor.FormatInfo) QemuImgFile(com.cloud.utils.qemu.QemuImgFile) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

StorageLayer (com.cloud.storage.StorageLayer)18 ConfigurationException (javax.naming.ConfigurationException)18 Processor (com.cloud.storage.template.Processor)13 InternalErrorException (com.cloud.exception.InternalErrorException)12 TemplateLocation (com.cloud.storage.template.TemplateLocation)12 FormatInfo (com.cloud.storage.template.Processor.FormatInfo)10 Answer (com.cloud.agent.api.Answer)8 CheckRouterAnswer (com.cloud.agent.api.CheckRouterAnswer)8 CreatePrivateTemplateFromSnapshotCommand (com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand)8 LibvirtRequestWrapper (com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper)8 LibvirtUtilitiesHelper (com.cloud.hypervisor.kvm.resource.wrapper.LibvirtUtilitiesHelper)8 StoragePool (com.cloud.storage.StoragePool)8 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)8 Test (org.junit.Test)8 KVMPhysicalDisk (com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk)6 KVMStoragePool (com.cloud.hypervisor.kvm.storage.KVMStoragePool)6 KVMStoragePoolManager (com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager)6 KvmPhysicalDisk (com.cloud.hypervisor.kvm.storage.KvmPhysicalDisk)6 KvmStoragePool (com.cloud.hypervisor.kvm.storage.KvmStoragePool)6 KvmStoragePoolManager (com.cloud.hypervisor.kvm.storage.KvmStoragePoolManager)6