Package com.vmware.vim25.mo

Examples of com.vmware.vim25.mo.VirtualMachine


    VsphereServer vsphereServer=new VsphereServer(vsphereUrl, vsphereUsername,vspherePassword);
    try {
      vsphereServer.connect();
           
      //Find if vm by name vmname already exists
      VirtualMachine existingVm=vsphereServer.findVmByName(vmName);

      if (existingVm!=null) {
        vsphereServer.vncActivateVm(existingVm,vncPort,vncPassword);
      } else {
        System.out.println("VM "+vmName+" not found");
View Full Code Here


    try {
      VsphereServer vsphereServer=new VsphereServer(vsphereUrl, vsphereUsername,vspherePassword);
      vsphereServer.connect();

      //Find if vm by name vmname already exists
      VirtualMachine existingVm=vsphereServer.findVmByName(vmName);

      if (existingVm!=null) {
        vsphereServer.powerOnVm(existingVm);   
      }
View Full Code Here

    VsphereServer vsphereServer=new VsphereServer(vsphereUrl, vsphereUsername,vspherePassword);
    try {
      vsphereServer.connect();
           
      //Find if vm by name vmname already exists
      VirtualMachine existingVm=vsphereServer.findVmByName(vmName);

      if (existingVm!=null) {
        vsphereServer.vncDeActivateVm(existingVm);
      } else {
        System.out.println("VM "+vmName+" not found");
View Full Code Here

     * Get manager of current snapshot if exists.
     */
    public SnapshotManager getCurrentSnapshot()
    {
        try {
            VirtualMachineSnapshot vmSnap = vm_.getCurrentSnapShot();
            if (vmSnap != null) {
                return new SnapshotManager(conn_, vm_, vmSnap);
            } else {
                return null;
            }
View Full Code Here

    /**
     * Search virtual machine snapshot with a specified name.
     */
    public SnapshotManager searchSnapshotWithName(String snapName)
    {
        VirtualMachineSnapshot vmSnap = getSnapshotInTree(snapName);
        if (vmSnap != null) {
            return new SnapshotManager(conn_, vm_, vmSnap);
        } else {
            return null;
        }
View Full Code Here

    /**
     * Search snapshot with a moref. !!!Not implemented yet.!!!
     */
    public SnapshotManager searchSnapshotWithMoref(String snapMorefStr)
    {
        VirtualMachineSnapshot vmSnap =
            conn_.generateSnapshotWithMoref(snapMorefStr);
        if (vmSnap != null) {
            return new SnapshotManager(conn_, vm_, vmSnap);
        } else {
            return null;
View Full Code Here

            vm_.getSnapshot().getRootSnapshotList();
       
        if (snapTree != null) {
            ManagedObjectReference mor = findSnapshotInTree(snapTree, snapName);
            if (mor != null) {
                return new
                    VirtualMachineSnapshot(vm_.getServerConnection(), mor);
            }
        }
        return null;
    }
View Full Code Here

     */
    private boolean snapshotTaskDetail(TaskType type, String snapName,
                                       String messageInSuccess, String messageInFailure)
    {

        VirtualMachineSnapshot vmsnap = null;

        if (type != TaskType.CREATE) {
            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;
View Full Code Here

     */
    public VmdkBitmap getChangedBlocksOfDisk
        (VmdkInfo vmdkInfo, String baseChangeId)
    {
        final VirtualMachine vm = vmm_.getVirtualMachine();
        final VirtualMachineSnapshot vmSnap = snapshot_;

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

View Full Code Here

    public boolean isChangedDisk(VmdkInfo vmdkInfo, String baseChangeId)
    {
        logger_.info("isChangedDisk start.");
       
        final VirtualMachine vm = vmm_.getVirtualMachine();
        final VirtualMachineSnapshot vmSnap = snapshot_;

        if (baseChangeId == null) {
            return false;
        }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.mo.VirtualMachine

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.