Package com.vmware.vim25

Examples of com.vmware.vim25.NasDatastoreInfo


    }
    // Next, get all the NAS datastores from this array of datastores.
    if (morArray.length > 0) {
      int i;
      for (i = 0; i < morArray.length; i++) {
        NasDatastoreInfo nasDS;
        try {
          nasDS = hostDatastoreSystemMo.getNasDatastoreInfo(morArray[i]);
          if (nasDS != null) {
            //DatastoreInfo info = (DatastoreInfo)_context.getServiceUtil().getDynamicProperty(morDatastore, "info");
            if (nasDS.getNas().getRemoteHost().equalsIgnoreCase(hostAddress) &&
                nasDS.getNas().getRemotePath().equalsIgnoreCase(path)) {
              return morArray[i];
            }
          }
        }  catch (Exception e) {
          s_logger.info("Encountered exception when retrieving nas datastore info");
View Full Code Here


        }
        // Next, get all the NAS datastores from this array of datastores.
        if (morArray.size() > 0) {
            int i;
            for (i = 0; i < morArray.size(); i++) {
                NasDatastoreInfo nasDS;
                try {
                    nasDS = hostDatastoreSystemMo.getNasDatastoreInfo(morArray.get(i));
                    if (nasDS != null) {
                        //DatastoreInfo info = (DatastoreInfo)_context.getServiceUtil().getDynamicProperty(morDatastore, "info");
                        if (nasDS.getNas().getRemoteHost().equalsIgnoreCase(hostAddress) && nasDS.getNas().getRemotePath().equalsIgnoreCase(path)) {
                            return morArray.get(i);
                        }
                    }
                } catch (Exception e) {
                    s_logger.info("Encountered exception when retrieving nas datastore info");
View Full Code Here

    }
    // Next, get all the NAS datastores from this array of datastores.
    if (morArray.size() > 0) {
      int i;
      for (i = 0; i < morArray.size(); i++) {
        NasDatastoreInfo nasDS;
        try {
          nasDS = hostDatastoreSystemMo.getNasDatastoreInfo(morArray.get(i));
          if (nasDS != null) {
            //DatastoreInfo info = (DatastoreInfo)_context.getServiceUtil().getDynamicProperty(morDatastore, "info");
            if (nasDS.getNas().getRemoteHost().equalsIgnoreCase(hostAddress) &&
                nasDS.getNas().getRemotePath().equalsIgnoreCase(path)) {
              return morArray.get(i);
            }
          }
        }  catch (Exception e) {
          s_logger.info("Encountered exception when retrieving nas datastore info");
View Full Code Here

    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet().get(0).getVal();
        if(dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
          NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
          if(info != null) {
            String vmwareUrl = info.getUrl();
            if(vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
              vmwareUrl = vmwareUrl.substring(0, vmwareUrl.length() - 1);

            URI uri = new URI(vmwareUrl);
            if(uri.getPath().equals("/" + exportPath)) {
View Full Code Here

    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet(0).getVal();
        if(dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
          NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
          if(info != null) {
            String vmwareUrl = info.getUrl();
            if(vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
              vmwareUrl = vmwareUrl.substring(0, vmwareUrl.length() - 1);
           
            URI uri = new URI(vmwareUrl);
            if(uri.getPath().equals("/" + exportPath)) {
View Full Code Here

     * @return ovf descriptor xml as string data.
     */
    public String exportOvf()
    {
        OvfFile[] ovfFiles = new OvfFile[0];
        OvfCreateDescriptorParams ovfDescParams = new OvfCreateDescriptorParams();
        ovfDescParams.setOvfFiles(ovfFiles);
        try {
            OvfCreateDescriptorResult ovfCreateDescriptorResult =
                conn_.getServiceInstance().getOvfManager().createDescriptor
                (vm_, ovfDescParams);
            return ovfCreateDescriptorResult.getOvfDescriptor();
View Full Code Here

    {
        OvfFile[] ovfFiles = new OvfFile[0];
        OvfCreateDescriptorParams ovfDescParams = new OvfCreateDescriptorParams();
        ovfDescParams.setOvfFiles(ovfFiles);
        try {
            OvfCreateDescriptorResult ovfCreateDescriptorResult =
                conn_.getServiceInstance().getOvfManager().createDescriptor
                (vm_, ovfDescParams);
            return ovfCreateDescriptorResult.getOvfDescriptor();
        } catch (Exception e) { logger_.warning(Utility.toString(e)); return null; }
    }
View Full Code Here

        Datastore datastore = getAvailableDatastore(datastoreName, host);
        assert datastore != null;
       
        /* create spec */
        Folder vmFolder = null;
        OvfCreateImportSpecParams importSpecParams
            = new OvfCreateImportSpecParams();
        String ovfDescriptor = "";

        vmFolder = (Folder) host.getVms()[0].getParent();

        importSpecParams.setLocale("US");
        importSpecParams.setEntityName(newVmName);
        importSpecParams.setDeploymentOption("");
        OvfNetworkMapping networkMapping = new OvfNetworkMapping();
        networkMapping.setName("Network 1");
        networkMapping.setNetwork(host.getNetworks()[0].getMOR());
        importSpecParams.setNetworkMapping(new OvfNetworkMapping[] { networkMapping });
        importSpecParams.setPropertyMapping(null);

        /* read ovf from the file. */
        ovfDescriptor = readOvfContent(ovfPath);

        /* create ovf descriptor */
 
View Full Code Here

                                   newVmName,
                                   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;
        }

View Full Code Here

        vmFolder = (Folder) host.getVms()[0].getParent();

        importSpecParams.setLocale("US");
        importSpecParams.setEntityName(newVmName);
        importSpecParams.setDeploymentOption("");
        OvfNetworkMapping networkMapping = new OvfNetworkMapping();
        networkMapping.setName("Network 1");
        networkMapping.setNetwork(host.getNetworks()[0].getMOR());
        importSpecParams.setNetworkMapping(new OvfNetworkMapping[] { networkMapping });
        importSpecParams.setPropertyMapping(null);

        /* read ovf from the file. */
        ovfDescriptor = readOvfContent(ovfPath);
View Full Code Here

TOP

Related Classes of com.vmware.vim25.NasDatastoreInfo

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.