Search in sources :

Example 1 with DomainSnapshot

use of org.libvirt.DomainSnapshot in project cloudstack by apache.

the class LibvirtDeleteVMSnapshotCommandWrapper method execute.

@Override
public Answer execute(final DeleteVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    String vmName = cmd.getVmName();
    final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    Domain dm = null;
    DomainSnapshot snapshot = null;
    try {
        final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
        Connect conn = libvirtUtilitiesHelper.getConnection();
        dm = libvirtComputingResource.getDomain(conn, vmName);
        snapshot = dm.snapshotLookupByName(cmd.getTarget().getSnapshotName());
        // only remove this snapshot, not children
        snapshot.delete(0);
        return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    } catch (LibvirtException e) {
        String msg = " Delete VM snapshot failed due to " + e.toString();
        if (dm == null) {
            s_logger.debug("Can not find running vm: " + vmName + ", now we are trying to delete the vm snapshot using qemu-img if the format of root volume is QCOW2");
            VolumeObjectTO rootVolume = null;
            for (VolumeObjectTO volume : cmd.getVolumeTOs()) {
                if (volume.getVolumeType() == Volume.Type.ROOT) {
                    rootVolume = volume;
                    break;
                }
            }
            if (rootVolume != null && ImageFormat.QCOW2.equals(rootVolume.getFormat())) {
                PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO) rootVolume.getDataStore();
                KVMPhysicalDisk rootDisk = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), rootVolume.getPath());
                String qemu_img_snapshot = Script.runSimpleBashScript("qemu-img snapshot -l " + rootDisk.getPath() + " | tail -n +3 | awk -F ' ' '{print $2}' | grep ^" + cmd.getTarget().getSnapshotName() + "$");
                if (qemu_img_snapshot == null) {
                    s_logger.info("Cannot find snapshot " + cmd.getTarget().getSnapshotName() + " in file " + rootDisk.getPath() + ", return true");
                    return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
                }
                int result = Script.runSimpleBashScriptForExitValue("qemu-img snapshot -d " + cmd.getTarget().getSnapshotName() + " " + rootDisk.getPath());
                if (result != 0) {
                    return new DeleteVMSnapshotAnswer(cmd, false, "Delete VM Snapshot Failed due to can not remove snapshot from image file " + rootDisk.getPath() + " : " + result);
                } else {
                    return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
                }
            }
        } else if (snapshot == null) {
            s_logger.debug("Can not find vm snapshot " + cmd.getTarget().getSnapshotName() + " on vm: " + vmName + ", return true");
            return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
        }
        s_logger.warn(msg, e);
        return new DeleteVMSnapshotAnswer(cmd, false, msg);
    } finally {
        if (dm != null) {
            try {
                dm.free();
            } catch (LibvirtException l) {
                s_logger.trace("Ignoring libvirt error.", l);
            }
            ;
        }
    }
}
Also used : KVMStoragePoolManager(com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager) LibvirtException(org.libvirt.LibvirtException) PrimaryDataStoreTO(org.apache.cloudstack.storage.to.PrimaryDataStoreTO) KVMPhysicalDisk(com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk) Connect(org.libvirt.Connect) DomainSnapshot(org.libvirt.DomainSnapshot) VolumeObjectTO(org.apache.cloudstack.storage.to.VolumeObjectTO) DeleteVMSnapshotAnswer(com.cloud.agent.api.DeleteVMSnapshotAnswer) Domain(org.libvirt.Domain)

Example 2 with DomainSnapshot

use of org.libvirt.DomainSnapshot in project cloudstack by apache.

the class LibvirtRevertToVMSnapshotCommandWrapper method execute.

@Override
public Answer execute(final RevertToVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    String vmName = cmd.getVmName();
    List<VolumeObjectTO> listVolumeTo = cmd.getVolumeTOs();
    VMSnapshot.Type vmSnapshotType = cmd.getTarget().getType();
    Boolean snapshotMemory = vmSnapshotType == VMSnapshot.Type.DiskAndMemory;
    VirtualMachine.PowerState vmState = null;
    Domain dm = null;
    try {
        final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
        Connect conn = libvirtUtilitiesHelper.getConnection();
        dm = libvirtComputingResource.getDomain(conn, vmName);
        if (dm == null) {
            return new RevertToVMSnapshotAnswer(cmd, false, "Revert to VM Snapshot Failed due to can not find vm: " + vmName);
        }
        DomainSnapshot snapshot = dm.snapshotLookupByName(cmd.getTarget().getSnapshotName());
        if (snapshot == null)
            return new RevertToVMSnapshotAnswer(cmd, false, "Cannot find vmSnapshot with name: " + cmd.getTarget().getSnapshotName());
        dm.revertToSnapshot(snapshot);
        snapshot.free();
        if (!snapshotMemory) {
            dm.destroy();
            if (dm.isPersistent() == 1)
                dm.undefine();
            vmState = VirtualMachine.PowerState.PowerOff;
        } else {
            vmState = VirtualMachine.PowerState.PowerOn;
        }
        return new RevertToVMSnapshotAnswer(cmd, listVolumeTo, vmState);
    } catch (LibvirtException e) {
        String msg = " Revert to VM snapshot failed due to " + e.toString();
        s_logger.warn(msg, e);
        return new RevertToVMSnapshotAnswer(cmd, false, msg);
    } finally {
        if (dm != null) {
            try {
                dm.free();
            } catch (LibvirtException l) {
                s_logger.trace("Ignoring libvirt error.", l);
            }
            ;
        }
    }
}
Also used : RevertToVMSnapshotAnswer(com.cloud.agent.api.RevertToVMSnapshotAnswer) LibvirtException(org.libvirt.LibvirtException) Connect(org.libvirt.Connect) DomainSnapshot(org.libvirt.DomainSnapshot) VMSnapshot(com.cloud.vm.snapshot.VMSnapshot) VolumeObjectTO(org.apache.cloudstack.storage.to.VolumeObjectTO) Domain(org.libvirt.Domain) VirtualMachine(com.cloud.vm.VirtualMachine)

Example 3 with DomainSnapshot

use of org.libvirt.DomainSnapshot in project CloudStack-archive by CloudStack-extras.

the class LibvirtComputingResource method execute.

protected BackupSnapshotAnswer execute(final BackupSnapshotCommand cmd) {
    Long dcId = cmd.getDataCenterId();
    Long accountId = cmd.getAccountId();
    Long volumeId = cmd.getVolumeId();
    String secondaryStoragePoolUrl = cmd.getSecondaryStorageUrl();
    String snapshotName = cmd.getSnapshotName();
    String snapshotPath = cmd.getVolumePath();
    String snapshotDestPath = null;
    String snapshotRelPath = null;
    String vmName = cmd.getVmName();
    KVMStoragePool secondaryStoragePool = null;
    try {
        Connect conn = LibvirtConnection.getConnection();
        secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI(secondaryStoragePoolUrl);
        String ssPmountPath = secondaryStoragePool.getLocalPath();
        snapshotRelPath = File.separator + "snapshots" + File.separator + dcId + File.separator + accountId + File.separator + volumeId;
        snapshotDestPath = ssPmountPath + File.separator + "snapshots" + File.separator + dcId + File.separator + accountId + File.separator + volumeId;
        KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd.getPrimaryStoragePoolNameLabel());
        KVMPhysicalDisk snapshotDisk = primaryPool.getPhysicalDisk(cmd.getVolumePath());
        Script command = new Script(_manageSnapshotPath, _cmdsTimeout, s_logger);
        command.add("-b", snapshotDisk.getPath());
        command.add("-n", snapshotName);
        command.add("-p", snapshotDestPath);
        command.add("-t", snapshotName);
        String result = command.execute();
        if (result != null) {
            s_logger.debug("Failed to backup snaptshot: " + result);
            return new BackupSnapshotAnswer(cmd, false, result, null, true);
        }
        /* Delete the snapshot on primary */
        DomainInfo.DomainState state = null;
        Domain vm = null;
        if (vmName != null) {
            try {
                vm = getDomain(conn, cmd.getVmName());
                state = vm.getInfo().state;
            } catch (LibvirtException e) {
            }
        }
        KVMStoragePool primaryStorage = _storagePoolMgr.getStoragePool(cmd.getPool().getUuid());
        if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryStorage.isExternalSnapshot()) {
            String vmUuid = vm.getUUIDString();
            Object[] args = new Object[] { snapshotName, vmUuid };
            String snapshot = SnapshotXML.format(args);
            s_logger.debug(snapshot);
            DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
            snap.delete(0);
            /*
				 * libvirt on RHEL6 doesn't handle resume event emitted from
				 * qemu
				 */
            vm = getDomain(conn, cmd.getVmName());
            state = vm.getInfo().state;
            if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) {
                vm.resume();
            }
        } else {
            command = new Script(_manageSnapshotPath, _cmdsTimeout, s_logger);
            command.add("-d", snapshotDisk.getPath());
            command.add("-n", snapshotName);
            result = command.execute();
            if (result != null) {
                s_logger.debug("Failed to backup snapshot: " + result);
                return new BackupSnapshotAnswer(cmd, false, "Failed to backup snapshot: " + result, null, true);
            }
        }
    } catch (LibvirtException e) {
        return new BackupSnapshotAnswer(cmd, false, e.toString(), null, true);
    } catch (CloudRuntimeException e) {
        return new BackupSnapshotAnswer(cmd, false, e.toString(), null, true);
    } finally {
        if (secondaryStoragePool != null) {
            secondaryStoragePool.delete();
        }
    }
    return new BackupSnapshotAnswer(cmd, true, null, snapshotRelPath + File.separator + snapshotName, true);
}
Also used : Script(com.cloud.utils.script.Script) LibvirtException(org.libvirt.LibvirtException) KVMPhysicalDisk(com.cloud.agent.storage.KVMPhysicalDisk) Connect(org.libvirt.Connect) DomainSnapshot(org.libvirt.DomainSnapshot) KVMStoragePool(com.cloud.agent.storage.KVMStoragePool) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) BackupSnapshotAnswer(com.cloud.agent.api.BackupSnapshotAnswer) DomainInfo(org.libvirt.DomainInfo) Domain(org.libvirt.Domain)

Example 4 with DomainSnapshot

use of org.libvirt.DomainSnapshot in project CloudStack-archive by CloudStack-extras.

the class LibvirtComputingResource method execute.

protected ManageSnapshotAnswer execute(final ManageSnapshotCommand cmd) {
    String snapshotName = cmd.getSnapshotName();
    String snapshotPath = cmd.getSnapshotPath();
    String vmName = cmd.getVmName();
    try {
        Connect conn = LibvirtConnection.getConnection();
        DomainInfo.DomainState state = null;
        Domain vm = null;
        if (vmName != null) {
            try {
                vm = getDomain(conn, cmd.getVmName());
                state = vm.getInfo().state;
            } catch (LibvirtException e) {
            }
        }
        KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd.getPool().getUuid());
        KVMPhysicalDisk disk = primaryPool.getPhysicalDisk(cmd.getVolumePath());
        if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryPool.isExternalSnapshot()) {
            String vmUuid = vm.getUUIDString();
            Object[] args = new Object[] { snapshotName, vmUuid };
            String snapshot = SnapshotXML.format(args);
            s_logger.debug(snapshot);
            if (cmd.getCommandSwitch().equalsIgnoreCase(ManageSnapshotCommand.CREATE_SNAPSHOT)) {
                vm.snapshotCreateXML(snapshot);
            } else {
                DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
                snap.delete(0);
            }
            /*
				 * libvirt on RHEL6 doesn't handle resume event emitted from
				 * qemu
				 */
            vm = getDomain(conn, cmd.getVmName());
            state = vm.getInfo().state;
            if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) {
                vm.resume();
            }
        } else {
            /* VM is not running, create a snapshot by ourself */
            final Script command = new Script(_manageSnapshotPath, _cmdsTimeout, s_logger);
            if (cmd.getCommandSwitch().equalsIgnoreCase(ManageSnapshotCommand.CREATE_SNAPSHOT)) {
                command.add("-c", disk.getPath());
            } else {
                command.add("-d", snapshotPath);
            }
            command.add("-n", snapshotName);
            String result = command.execute();
            if (result != null) {
                s_logger.debug("Failed to manage snapshot: " + result);
                return new ManageSnapshotAnswer(cmd, false, "Failed to manage snapshot: " + result);
            }
        }
        return new ManageSnapshotAnswer(cmd, cmd.getSnapshotId(), disk.getPath() + File.separator + snapshotName, true, null);
    } catch (LibvirtException e) {
        s_logger.debug("Failed to manage snapshot: " + e.toString());
        return new ManageSnapshotAnswer(cmd, false, "Failed to manage snapshot: " + e.toString());
    }
}
Also used : Script(com.cloud.utils.script.Script) LibvirtException(org.libvirt.LibvirtException) KVMPhysicalDisk(com.cloud.agent.storage.KVMPhysicalDisk) Connect(org.libvirt.Connect) DomainSnapshot(org.libvirt.DomainSnapshot) ManageSnapshotAnswer(com.cloud.agent.api.ManageSnapshotAnswer) KVMStoragePool(com.cloud.agent.storage.KVMStoragePool) DomainInfo(org.libvirt.DomainInfo) Domain(org.libvirt.Domain)

Example 5 with DomainSnapshot

use of org.libvirt.DomainSnapshot in project cloudstack by apache.

the class KVMStorageProcessor method backupSnapshot.

@Override
public Answer backupSnapshot(final CopyCommand cmd) {
    final DataTO srcData = cmd.getSrcTO();
    final DataTO destData = cmd.getDestTO();
    final SnapshotObjectTO snapshot = (SnapshotObjectTO) srcData;
    final PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO) snapshot.getDataStore();
    final SnapshotObjectTO destSnapshot = (SnapshotObjectTO) destData;
    final DataStoreTO imageStore = destData.getDataStore();
    if (!(imageStore instanceof NfsTO)) {
        return backupSnapshotForObjectStore(cmd);
    }
    final NfsTO nfsImageStore = (NfsTO) imageStore;
    final String secondaryStoragePoolUrl = nfsImageStore.getUrl();
    // NOTE: snapshot name is encoded in snapshot path
    final int index = snapshot.getPath().lastIndexOf("/");
    // -1 means the snapshot is created from existing vm snapshot
    final boolean isCreatedFromVmSnapshot = (index == -1) ? true : false;
    final String snapshotName = snapshot.getPath().substring(index + 1);
    String descName = snapshotName;
    final String volumePath = snapshot.getVolume().getPath();
    String snapshotDestPath = null;
    String snapshotRelPath = null;
    final String vmName = snapshot.getVmName();
    KVMStoragePool secondaryStoragePool = null;
    Connect conn = null;
    KVMPhysicalDisk snapshotDisk = null;
    KVMStoragePool primaryPool = null;
    try {
        conn = LibvirtConnection.getConnectionByVmName(vmName);
        secondaryStoragePool = storagePoolMgr.getStoragePoolByURI(secondaryStoragePoolUrl);
        final String ssPmountPath = secondaryStoragePool.getLocalPath();
        snapshotRelPath = destSnapshot.getPath();
        snapshotDestPath = ssPmountPath + File.separator + snapshotRelPath;
        snapshotDisk = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), volumePath);
        primaryPool = snapshotDisk.getPool();
        long size = 0;
        /**
             * Since Ceph version Dumpling (0.67.X) librbd / Qemu supports converting RBD
             * snapshots to RAW/QCOW2 files directly.
             *
             * This reduces the amount of time and storage it takes to back up a snapshot dramatically
             */
        if (primaryPool.getType() == StoragePoolType.RBD) {
            final String rbdSnapshot = snapshotDisk.getPath() + "@" + snapshotName;
            final String snapshotFile = snapshotDestPath + "/" + snapshotName;
            try {
                s_logger.debug("Attempting to backup RBD snapshot " + rbdSnapshot);
                final File snapDir = new File(snapshotDestPath);
                s_logger.debug("Attempting to create " + snapDir.getAbsolutePath() + " recursively for snapshot storage");
                FileUtils.forceMkdir(snapDir);
                final QemuImgFile srcFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(primaryPool.getSourceHost(), primaryPool.getSourcePort(), primaryPool.getAuthUserName(), primaryPool.getAuthSecret(), rbdSnapshot));
                srcFile.setFormat(snapshotDisk.getFormat());
                final QemuImgFile destFile = new QemuImgFile(snapshotFile);
                destFile.setFormat(PhysicalDiskFormat.QCOW2);
                s_logger.debug("Backing up RBD snapshot " + rbdSnapshot + " to " + snapshotFile);
                final QemuImg q = new QemuImg(cmd.getWaitInMillSeconds());
                q.convert(srcFile, destFile);
                final File snapFile = new File(snapshotFile);
                if (snapFile.exists()) {
                    size = snapFile.length();
                }
                s_logger.debug("Finished backing up RBD snapshot " + rbdSnapshot + " to " + snapshotFile + " Snapshot size: " + size);
            } catch (final FileNotFoundException e) {
                s_logger.error("Failed to open " + snapshotDestPath + ". The error was: " + e.getMessage());
                return new CopyCmdAnswer(e.toString());
            } catch (final IOException e) {
                s_logger.error("Failed to create " + snapshotDestPath + ". The error was: " + e.getMessage());
                return new CopyCmdAnswer(e.toString());
            } catch (final QemuImgException e) {
                s_logger.error("Failed to backup the RBD snapshot from " + rbdSnapshot + " to " + snapshotFile + " the error was: " + e.getMessage());
                return new CopyCmdAnswer(e.toString());
            }
        } else {
            final Script command = new Script(_manageSnapshotPath, cmd.getWaitInMillSeconds(), s_logger);
            command.add("-b", snapshotDisk.getPath());
            command.add("-n", snapshotName);
            command.add("-p", snapshotDestPath);
            if (isCreatedFromVmSnapshot) {
                descName = UUID.randomUUID().toString();
            }
            command.add("-t", descName);
            final String result = command.execute();
            if (result != null) {
                s_logger.debug("Failed to backup snaptshot: " + result);
                return new CopyCmdAnswer(result);
            }
            final File snapFile = new File(snapshotDestPath + "/" + descName);
            if (snapFile.exists()) {
                size = snapFile.length();
            }
        }
        final SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
        newSnapshot.setPath(snapshotRelPath + File.separator + descName);
        newSnapshot.setPhysicalSize(size);
        return new CopyCmdAnswer(newSnapshot);
    } catch (final LibvirtException e) {
        s_logger.debug("Failed to backup snapshot: ", e);
        return new CopyCmdAnswer(e.toString());
    } catch (final CloudRuntimeException e) {
        s_logger.debug("Failed to backup snapshot: ", e);
        return new CopyCmdAnswer(e.toString());
    } finally {
        if (isCreatedFromVmSnapshot) {
            s_logger.debug("Ignoring removal of vm snapshot on primary as this snapshot is created from vm snapshot");
        } else {
            try {
                /* Delete the snapshot on primary */
                DomainInfo.DomainState state = null;
                Domain vm = null;
                if (vmName != null) {
                    try {
                        vm = resource.getDomain(conn, vmName);
                        state = vm.getInfo().state;
                    } catch (final LibvirtException e) {
                        s_logger.trace("Ignoring libvirt error.", e);
                    }
                }
                final KVMStoragePool primaryStorage = storagePoolMgr.getStoragePool(primaryStore.getPoolType(), primaryStore.getUuid());
                if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryStorage.isExternalSnapshot()) {
                    final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
                    snap.delete(0);
                    /*
                         * libvirt on RHEL6 doesn't handle resume event emitted from
                         * qemu
                         */
                    vm = resource.getDomain(conn, vmName);
                    state = vm.getInfo().state;
                    if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) {
                        vm.resume();
                    }
                } else {
                    if (primaryPool.getType() != StoragePoolType.RBD) {
                        final Script command = new Script(_manageSnapshotPath, _cmdsTimeout, s_logger);
                        command.add("-d", snapshotDisk.getPath());
                        command.add("-n", snapshotName);
                        final String result = command.execute();
                        if (result != null) {
                            s_logger.debug("Failed to delete snapshot on primary: " + result);
                        // return new CopyCmdAnswer("Failed to backup snapshot: " + result);
                        }
                    }
                }
            } catch (final Exception ex) {
                s_logger.debug("Failed to delete snapshots on primary", ex);
            }
        }
        try {
            if (secondaryStoragePool != null) {
                secondaryStoragePool.delete();
            }
        } catch (final Exception ex) {
            s_logger.debug("Failed to delete secondary storage", ex);
        }
    }
}
Also used : SnapshotObjectTO(org.apache.cloudstack.storage.to.SnapshotObjectTO) LibvirtException(org.libvirt.LibvirtException) FileNotFoundException(java.io.FileNotFoundException) DataTO(com.cloud.agent.api.to.DataTO) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) QemuImgException(org.apache.cloudstack.utils.qemu.QemuImgException) DomainInfo(org.libvirt.DomainInfo) Script(com.cloud.utils.script.Script) PrimaryDataStoreTO(org.apache.cloudstack.storage.to.PrimaryDataStoreTO) DataStoreTO(com.cloud.agent.api.to.DataStoreTO) Connect(org.libvirt.Connect) DomainSnapshot(org.libvirt.DomainSnapshot) IOException(java.io.IOException) NfsTO(com.cloud.agent.api.to.NfsTO) URISyntaxException(java.net.URISyntaxException) LibvirtException(org.libvirt.LibvirtException) RbdException(com.ceph.rbd.RbdException) QemuImgException(org.apache.cloudstack.utils.qemu.QemuImgException) FileNotFoundException(java.io.FileNotFoundException) InternalErrorException(com.cloud.exception.InternalErrorException) ConfigurationException(javax.naming.ConfigurationException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) RadosException(com.ceph.rados.exceptions.RadosException) IOException(java.io.IOException) QemuImg(org.apache.cloudstack.utils.qemu.QemuImg) PrimaryDataStoreTO(org.apache.cloudstack.storage.to.PrimaryDataStoreTO) QemuImgFile(org.apache.cloudstack.utils.qemu.QemuImgFile) Domain(org.libvirt.Domain) QemuImgFile(org.apache.cloudstack.utils.qemu.QemuImgFile) S3Utils.putFile(com.cloud.utils.storage.S3.S3Utils.putFile) File(java.io.File) CopyCmdAnswer(org.apache.cloudstack.storage.command.CopyCmdAnswer)

Aggregations

DomainSnapshot (org.libvirt.DomainSnapshot)8 LibvirtException (org.libvirt.LibvirtException)8 Connect (org.libvirt.Connect)7 Domain (org.libvirt.Domain)7 Script (com.cloud.utils.script.Script)5 KVMPhysicalDisk (com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk)3 KVMStoragePoolManager (com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager)3 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 IOException (java.io.IOException)3 DomainInfo (org.libvirt.DomainInfo)3 IoCTX (com.ceph.rados.IoCTX)2 Rados (com.ceph.rados.Rados)2 RadosException (com.ceph.rados.exceptions.RadosException)2 Rbd (com.ceph.rbd.Rbd)2 RbdException (com.ceph.rbd.RbdException)2 RbdImage (com.ceph.rbd.RbdImage)2 BackupSnapshotAnswer (com.cloud.agent.api.BackupSnapshotAnswer)2 ManageSnapshotAnswer (com.cloud.agent.api.ManageSnapshotAnswer)2 KVMPhysicalDisk (com.cloud.agent.storage.KVMPhysicalDisk)2 KVMStoragePool (com.cloud.agent.storage.KVMStoragePool)2