Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackVolume


                }
                if (diskOfferingId == null) throw new EC2ServiceException(ServerError.InternalError, "No Customize Disk Offering Found");
            }

//      // -> no volume name is given in the Amazon request but is required in the cloud API
            CloudStackVolume vol = getApi().createVolume(UUID.randomUUID().toString(), null, diskOfferingId, null, size, snapshotId, toZoneId(request.getZoneName(), null));
            if (vol != null) {
                EC2Volume resp = new EC2Volume();
                resp.setAttached(vol.getAttached());
                resp.setCreated(vol.getCreated());
//        resp.setDevice();
                resp.setDeviceId(vol.getDeviceId());
                resp.setHypervisor(vol.getHypervisor());
                resp.setId(vol.getId());
                resp.setInstanceId(vol.getVirtualMachineId());
                resp.setSize(vol.getSize());
                resp.setSnapshotId(vol.getSnapshotId());
                resp.setState(vol.getState());
                resp.setType(vol.getVolumeType());
                resp.setVMState(vol.getVirtualMachineState());
                resp.setAttachmentState("detached");
                resp.setZoneName(vol.getZoneName());
                return resp;
            }
            return null;
        } catch( Exception e ) {
            logger.error( "EC2 CreateVolume - ", e);
View Full Code Here

TOP

Related Classes of com.cloud.stack.models.CloudStackVolume

Copyright © 2018 www.massapicom. 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.