Package com.vmware.vim25

Examples of com.vmware.vim25.VirtualMachineFileInfo


    vmSpec.setDeviceChange(new VirtualDeviceConfigSpec[]
        {scsiSpec, diskSpec, nicSpec});
   
    // create vm file info for the vmx file
    VirtualMachineFileInfo vmfi = new VirtualMachineFileInfo();
    vmfi.setVmPathName("["+ datastoreName +"]");
    vmSpec.setFiles(vmfi);

    // call the createVM_Task method on the vm folder
    Task task = vmFolder.createVM_Task(vmSpec, rp, null);
    String result = task.waitForMe();      
View Full Code Here


    scsiController.setKey(1);
    VirtualDeviceConfigSpec scsiControllerSpec = new VirtualDeviceConfigSpec();
    scsiControllerSpec.setDevice(scsiController);
    scsiControllerSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

    VirtualMachineFileInfo fileInfo = new VirtualMachineFileInfo();
    DatastoreMO dsMo = new DatastoreMO(host.getContext(), morDs);
    fileInfo.setVmPathName(String.format("[%s]", dsMo.getName()));
    vmConfig.setFiles(fileInfo);
   
    VirtualMachineVideoCard videoCard = new VirtualMachineVideoCard();
    videoCard.setControllerKey(100);
    videoCard.setUseAutoDetect(true);
View Full Code Here

    vmSpec.setDeviceChange(machineSpecs);

   
    // create vm file info for the vmx file
    VirtualMachineFileInfo vmfi = new VirtualMachineFileInfo();
    vmfi.setVmPathName("["+ vmDataStoreName +"]");
    System.out.println("Vm DatastoreName"+vmDataStoreName);

    vmSpec.setFiles(vmfi);

    // call the createVM_Task method on the vm folder
View Full Code Here

     *
     * @return a list of the name of snapshots.
     */
    public List<String> getAllSnapshotNameList()
    {
        VirtualMachineSnapshotInfo snapInfo = vm_.getSnapshot();
        if (snapInfo == null) { return null; }

        VirtualMachineSnapshotTree[] snapTree
            = snapInfo.getRootSnapshotList();

        List<String> ret = getAllSnapshotNameList(snapTree);

        return ret;
    }
View Full Code Here

            if (snapTrees[i].getSnapshot().getVal().equals(snapMorefStr)) {
                return snapTrees[i];
            }
            VirtualMachineSnapshotTree[] childTrees =
                snapTrees[i].getChildSnapshotList();
            VirtualMachineSnapshotTree ret =
                searchSnapshotTreeWithMoref(childTrees, snapMorefStr);
            if (ret != null) {
                return ret;
            }
        }
View Full Code Here

        VirtualMachineSnapshotTree[] snapTree =
            vm_.getSnapshot().getRootSnapshotList();

        if (snapTree == null) { return null; }
       
        VirtualMachineSnapshotTree st =
            findSnapshotInTree(snapTree, vmSnap);
        return st;
    }
View Full Code Here

     */
    private VirtualMachineSnapshotTree findSnapshotInTree
        (VirtualMachineSnapshotTree[] snapTree, VirtualMachineSnapshot vmSnap)
    {
        for (int i = 0; i < snapTree.length; i ++) {
            VirtualMachineSnapshotTree node = snapTree[i];
            if (node.getSnapshot().equals(vmSnap.getMOR())) {
                return node;
            }
            VirtualMachineSnapshotTree[] childTree =
                node.getChildSnapshotList();
            if (childTree != null) {
                VirtualMachineSnapshotTree ret =
                    findSnapshotInTree(childTree, vmSnap);
                if (ret != null) {
                    return ret;
                }
            }
View Full Code Here

     */
    private ManagedObjectReference findSnapshotInTree
        (VirtualMachineSnapshotTree[] snapTree, String snapName)
    {
        for (int i = 0; i < snapTree.length; i ++) {
            VirtualMachineSnapshotTree node = snapTree[i];
            if (snapName.equals(node.getName())) {
                return node.getSnapshot();
            } else {
                VirtualMachineSnapshotTree[] childTree =
                    node.getChildSnapshotList();
                if (childTree != null) {
                    ManagedObjectReference mor =
                        findSnapshotInTree(childTree, snapName);
                    if (mor != null) { return mor; }
                }
View Full Code Here

        ctrl.setKey(ckey_);
        ctrl.setBusNumber(busNumber_);
        if (isScsi) {
            assert ctrl instanceof VirtualSCSIController;
            VirtualSCSIController scsiCtrl = (VirtualSCSIController) ctrl;
            scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing);
        }
        controllerSpec.setDevice(ctrl);

        return controllerSpec;
    }
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

TOP

Related Classes of com.vmware.vim25.VirtualMachineFileInfo

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.