Package com.vmware.vim25

Examples of com.vmware.vim25.Action


     */
    protected ManagedEntity searchManagedEntity(String type, String name)
    {
        ManagedEntity ret = null;
        try {
            ret = new InventoryNavigator
                (rootFolder_).searchManagedEntity(type, name);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            logger_.warning(Utility.toString(e));
            return null;
        }
View Full Code Here


    {
        List<ManagedEntity> ret = new LinkedList<ManagedEntity>();
       
        ManagedEntity[] mes;
        try {
            mes = new InventoryNavigator(rootFolder_).searchManagedEntities(type);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            return ret;
        }
        assert(mes != null);

View Full Code Here

     * @param name Name of the entity.
     * @return Found managed entity in success or null in failure.
     */
    protected ManagedEntity searchManagedEntity(String type, String name)
    {
        ManagedEntity ret = null;
        try {
            ret = new InventoryNavigator
                (rootFolder_).searchManagedEntity(type, name);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            logger_.warning(Utility.toString(e));
View Full Code Here

        ManagedObjectReference mor =
            generateMoref("VirtualMachine", morefStr);
        if (mor == null) { return null; }

        ManagedEntity vm =
            MorUtil.createExactManagedEntity(si_.getServerConnection(), mor);

        if (vm instanceof VirtualMachine) {
            return (VirtualMachine) vm; /* may be null */
        } else {
View Full Code Here

        ManagedObjectReference mor =
            generateMoref("VirtualMachineSnapshot", morefStr);
        if (mor == null) { return null; }

        ManagedObject snap =
            MorUtil.createExactManagedObject(si_.getServerConnection(), mor);

        if (snap instanceof VirtualMachineSnapshot) {
            return (VirtualMachineSnapshot) snap; /* may be null */
        } else {
View Full Code Here

     */
    public void connect()
        throws Exception
    {
        logger_.info(String.format("connecting to %s...", url_));
    si_ = new ServiceInstance
            (new URL(url_), username_, password_, true);
    rootFolder_ = si_.getRootFolder();
        logger_.info("connected");
    }
View Full Code Here

            vmsnap = getSnapshotInTree(snapName);
            if (vmsnap == null) { return false; }
        }

        try {
            Task task = null;
            switch (type) {
            case CREATE:
                task = vm_.createSnapshot_Task(snapName, null, false, false);
                break;
            case DELETE:
                task = vmsnap.removeSnapshot_Task(true);
                break;
            case REVERT:
                task = vmsnap.revertToSnapshot_Task(null, true);
                break;
            default:
                throw new Exception("Snapshot TaskType is wrong.");
            }
            assert task != null;
            String ret = task.waitForTask();
            if (ret.equals("success")) {
                logger_.info(messageInSuccess);
                return true;
            } else {
                logger_.info(messageInFailure);
View Full Code Here

        vmConfigSpec.setDeviceChange
            (specList.toArray(new VirtualDeviceConfigSpec[0]));

        /* reconfigure vm task */
        try {
            Task task = vm_.reconfigVM_Task(vmConfigSpec);
            String ret = task.waitForTask();
            logger_.info(String.format("%s: addDisksToVm()\n", ret));
            if (ret.equals("success")) {
                return true;
            } else {
                return false;
View Full Code Here

        vmConfigSpec.setDeviceChange
            (specList.toArray(new VirtualDeviceConfigSpec[0]));

        /* reconfigure vm task */
        try {
            Task task = vm_.reconfigVM_Task(vmConfigSpec);
            String ret = task.waitForTask();
            logger_.info(String.format("%s: addEmptyDisks()\n", ret));
            if (ret.equals("success")) {
                return true;
            } else {
                return false;
View Full Code Here

     * @return changed block information as a bitmap data.
     */
    public VmdkBitmap getChangedBlocksOfDisk
        (VmdkInfo vmdkInfo, String baseChangeId)
    {
        final VirtualMachine vm = vmm_.getVirtualMachine();
        final VirtualMachineSnapshot vmSnap = snapshot_;

        if (baseChangeId == null) {
            baseChangeId = "*";
        }

        logger_.info(vmdkInfo.toString());
        logger_.info(baseChangeId); /* debug */

        final long capacityInBytes = vmdkInfo.capacityInKB_ * 1024L;
       
        /* block size is fixed to 1MB currently */
        VmdkBitmap bmp = new VmdkBitmap(capacityInBytes, 1024 * 1024);
       
        boolean isNotChangedAtAll = false;
        try {
            long offset = 0;
            DiskChangeInfo dci = null;
            do {
                dci = vm.queryChangedDiskAreas
                    (vmSnap, vmdkInfo.key_, offset, baseChangeId);

                if (offset == 0 && (dci.changedArea == null)) {
                    /*
                      ChangeId is not null and DiskChangeInfo.changedArea is null,
View Full Code Here

TOP

Related Classes of com.vmware.vim25.Action

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.