Examples of VolumeTO


Examples of com.cloud.agent.api.to.VolumeTO

                            " Can't create storage volume on storage pool");
                }
            } else {
                vol = primaryPool.createPhysicalDisk(dskch.getPath(), dskch.getSize());
            }
            VolumeTO volume = new VolumeTO(cmd.getVolumeId(), dskch.getType(),
                    pool.getType(), pool.getUuid(), pool.getPath(),
                    vol.getName(), vol.getName(), disksize, null);
            volume.setBytesReadRate(dskch.getBytesReadRate());
            volume.setBytesWriteRate(dskch.getBytesWriteRate());
            volume.setIopsReadRate(dskch.getIopsReadRate());
            volume.setIopsWriteRate(dskch.getIopsWriteRate());
            return new CreateAnswer(cmd, volume);
        } catch (CloudRuntimeException e) {
            s_logger.debug("Failed to create volume: " + e.toString());
            return new CreateAnswer(cmd, e);
        }
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

        }

    }

    public Answer execute(DestroyCommand cmd) {
        VolumeTO vol = cmd.getVolume();

        try {
            KVMStoragePool pool = _storagePoolMgr.getStoragePool(
                    vol.getPoolType(),
                    vol.getPoolUuid());
            pool.deletePhysicalDisk(vol.getPath());
            return new Answer(cmd, true, "Success");
        } catch (CloudRuntimeException e) {
            s_logger.debug("Failed to delete volume: " + e.toString());
            return new Answer(cmd, false, e.toString());
        }
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

                }
            } else {
                vol = primaryPool.createPhysicalDisk(UUID.randomUUID()
                        .toString(), dskch.getSize());
            }
            VolumeTO volume = new VolumeTO(cmd.getVolumeId(), dskch.getType(),
                    pool.getType(), pool.getUuid(), pool.getPath(),
                    vol.getName(), vol.getName(), disksize, null);
            return new CreateAnswer(cmd, volume);
        } catch (CloudRuntimeException e) {
            s_logger.debug("Failed to create volume: " + e.toString());
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

            return new CreateAnswer(cmd, e);
        }
    }

    public Answer execute(DestroyCommand cmd) {
        VolumeTO vol = cmd.getVolume();

        try {
            KVMStoragePool pool = _storagePoolMgr.getStoragePool(vol
                    .getPoolUuid());
            pool.deletePhysicalDisk(vol.getPath());

            return new Answer(cmd, true, "Success");
        } catch (CloudRuntimeException e) {
            s_logger.debug("Failed to delete volume: " + e.toString());
            return new Answer(cmd, false, e.toString());
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

            createPatchVbd(conn, vmName, vm, vmSpec);
        }
    }

    private VolumeTO getVolume(VirtualMachineTO vmSpec, Volume.Type type) {
        VolumeTO volumes[] = vmSpec.getDisks();
        for (VolumeTO volume : volumes) {
            if (volume.getType() == type) {
                return volume;
            }
        }
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

            VirtualMachineTO vmSpec) throws LibvirtException,
            InternalErrorException {

        List<DiskDef> disks = vm.getDevices().getDisks();
        DiskDef rootDisk = disks.get(0);
        VolumeTO rootVol = getVolume(vmSpec, Volume.Type.ROOT);
        String patchName = vmName + "-patchdisk";
        KVMStoragePool pool = _storagePoolMgr.getStoragePool(rootVol.getPoolUuid());
        String patchDiskPath = pool.getLocalPath() + "/" + patchName;

        List<KVMPhysicalDisk> phyDisks = pool.listPhysicalDisks();
        boolean foundDisk = false;
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

            VDI.Record vdir;
            vdir = vdi.getRecord(conn);
            s_logger.debug("Succesfully created VDI for " + cmd + ".  Uuid = " + vdir.uuid);

            VolumeTO vol = new VolumeTO(cmd.getVolumeId(), dskch.getType(), pool.getType(), pool.getUuid(), vdir.nameLabel,
                    pool.getPath(), vdir.uuid, vdir.virtualSize, null);
            return new CreateAnswer(cmd, vol);
        } catch (Exception e) {
            s_logger.warn("Unable to create volume; Pool=" + pool + "; Disk: " + dskch, e);
            return new CreateAnswer(cmd, e);
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

        }
    }

    public Answer execute(DestroyCommand cmd) {
        Connection conn = getConnection();
        VolumeTO vol = cmd.getVolume();
        // Look up the VDI
        String volumeUUID = vol.getPath();
        VDI vdi = null;
        try {
            vdi = getVDIbyUuid(conn, volumeUUID);
        } catch (Exception e) {
            return new Answer(cmd, true, "Success");
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

            VDI.Record vdir;
            vdir = vdi.getRecord(conn);
            s_logger.debug("Succesfully created VDI for " + cmd + ".  Uuid = " + vdir.uuid);

            VolumeTO vol =
                    new VolumeTO(cmd.getVolumeId(), dskch.getType(), pool.getType(), pool.getUuid(), vdir.nameLabel, pool.getPath(), vdir.uuid, vdir.virtualSize, null);
            return new CreateAnswer(cmd, vol);
        } catch (Exception e) {
            s_logger.warn("Unable to create volume; Pool=" + pool + "; Disk: " + dskch, e);
            return new CreateAnswer(cmd, e);
        }
View Full Code Here

Examples of com.cloud.agent.api.to.VolumeTO

        }
    }

    public Answer execute(DestroyCommand cmd) {
        Connection conn = getConnection();
        VolumeTO vol = cmd.getVolume();
        // Look up the VDI
        String volumeUUID = vol.getPath();
        VDI vdi = null;
        try {
            vdi = getVDIbyUuid(conn, volumeUUID);
        } catch (Exception e) {
            return new Answer(cmd, true, "Success");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.