Package com.vmware.vim25.mo.util

Examples of com.vmware.vim25.mo.util.CommandLineParser


    /**
     * 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

public class VMClone
{
   public static void main(String[] args) throws Exception
   {
     CommandLineParser clp = new CommandLineParser(constructOptions(), args);
    
     String urlStr = clp.get_option("url");
     String username = clp.get_option("username");
     String password = clp.get_option("password");
     String cloneName = clp.get_option("CloneName");
     String vmPath = clp.get_option("vmPath");
     String datacenterName= clp.get_option("DatacenterName");

     try
     {
       ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true);
       VirtualMachine vm = (VirtualMachine) si.getSearchIndex().findByInventoryPath(vmPath);
View Full Code Here

public class VmStartupOption
{
  public static void main(String[] args) throws Exception
  {
    CommandLineParser clp = new CommandLineParser(
        constructOptions(), args);
    String urlStr = clp.get_option("url");
    String username = clp.get_option("username");
    String password = clp.get_option("password");
    String hostname = clp.get_option("hostname");

    ServiceInstance si = new ServiceInstance(new URL(urlStr),
        username, password, true);
    HostSystem host = (HostSystem) new InventoryNavigator(si
        .getRootFolder()).searchManagedEntity("HostSystem",
View Full Code Here

public class SessionProducer
{
  public static void main(String[] args) throws Exception
  {
      CommandLineParser clp = new CommandLineParser(new OptionSpec[]{}, args);
       String urlStr = clp.get_option("url");
        String username = clp.get_option("username");
      String password = clp.get_option("password");

    ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true);

    String sessionStr = si.getServerConnection().getSessionStr();
   
View Full Code Here

public class VmRename
{
  public static void main(String[] args) throws Exception
  {
   
      CommandLineParser clp = new CommandLineParser(new OptionSpec[]{}, args);
       String urlStr = clp.get_option("url");
        String username = clp.get_option("username");
      String password = clp.get_option("password");

    ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true);
    Folder rootFolder = si.getRootFolder();
    VirtualMachine vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntities("VirtualMachine")[0];
View Full Code Here

TOP

Related Classes of com.vmware.vim25.mo.util.CommandLineParser

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.