Package com.vmware.vim25.mo

Examples of com.vmware.vim25.mo.HostSystem


    {
      System.out.println("No Datastore found");
      return null;
    }

    ConfigTarget configTarget = envBrowser.queryConfigTarget(new HostSystem(vm.getServerConnection(), hmor));
    VirtualMachineDatastoreInfo[] dis = configTarget.getDatastore();
    for (int i=0; dis!=null && i<dis.length; i++)
    {
      dsSum = dis[i].getDatastore();
      if (dsSum.isAccessible() && dsName.equals(dsSum.getName()))
View Full Code Here


  throws Exception
  {
    VirtualMachineRuntimeInfo vmRuntimeInfo = vm.getRuntime();
    EnvironmentBrowser envBrowser = vm.getEnvironmentBrowser();
    ManagedObjectReference hmor = vmRuntimeInfo.getHost();
    VirtualMachineConfigOption cfgOpt = envBrowser.queryConfigOption(null, new HostSystem(vm.getServerConnection(), hmor));
    VirtualDevice[] defaultDevs = null;
    if (cfgOpt != null)
    {
      defaultDevs = cfgOpt.getDefaultDevice();
      if (defaultDevs == null)
View Full Code Here

    ArrayList<String> hostList=new ArrayList<String>();
   
    for(int i=0; i<hosts.length; i++)
    {

      HostSystem host= (HostSystem) hosts[i];
      hostList.add(host.getName());

    }
   
    return hostList;
  }
View Full Code Here

                                   rp.getName(),
                                   host.getName(),
                                   datastore.getName()));
       
        OvfCreateImportSpecResult ovfImportResult = null;
        HttpNfcLease httpNfcLease = null;       

        /* create import spec */
        ovfImportResult =
            conn_.getServiceInstance().getOvfManager().createImportSpec
            (ovfDescriptor, rp, datastore, importSpecParams);

        /* import execution */
        try {
            httpNfcLease =
                rp.importVApp(ovfImportResult.getImportSpec(), vmFolder, host);
        } catch (Exception e) {
            logger_.warning("importVapp failed.");
            throw e;
        }

        String morefOfNewVm = null;
       
        /* wait nfc lease */
        HttpNfcLeaseState hls;
    while (true) {
      hls = httpNfcLease.getState();
      if (hls == HttpNfcLeaseState.ready ||
                hls == HttpNfcLeaseState.error) { break; }
    }
        if (hls == HttpNfcLeaseState.ready) {

            morefOfNewVm = httpNfcLease.getInfo().getEntity().getVal();

            logger_.info
                (String.format
                 ("Moref of the created vm: %s\n", morefOfNewVm));
           
            httpNfcLease.httpNfcLeaseComplete();
            /*
              We do not upload disk files, because the specified ovf
              must not contain disk information.
            */
        } else {
View Full Code Here

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

    {
        List<ManagedEntity> ret = new LinkedList<ManagedEntity>();
       
        ManagedEntity[] mes;
        try {
            mes = new InventoryNavigator(rootFolder_).searchManagedEntities
                (new String[][] { {type, name}, }, true);
           
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            return ret;
        }
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

     */
    public VirtualMachineManager searchVmWithName(String vmName)
        throws Exception
    {
        if (conn_.isConnected() == false) { conn_.connect(); }
        ManagedEntity vm = conn_.searchManagedEntity("VirtualMachine", vmName);
        if (vm == null) { throw new Exception(); }
        return new VirtualMachineManager(conn_, (VirtualMachine)vm);
    }
View Full Code Here

TOP

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

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.