Examples of ComputeResource


Examples of com.vmware.vim25.mo.ComputeResource

        rootFolder).searchManagedEntity(
            "VirtualMachine", vmname);
    HostSystem newHost = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity(
            "HostSystem", newHostName);
    ComputeResource cr = (ComputeResource) newHost.getParent();
   
    String[] checks = new String[] {"cpu", "software"};
    HostVMotionCompatibility[] vmcs =
      si.queryVMotionCompatibility(vm, new HostSystem[]
         {newHost},checks );
   
    String[] comps = vmcs[0].getCompatibility();
    if(checks.length != comps.length)
    {
      System.out.println("CPU/software NOT compatible. Exit.");
      si.getServerConnection().logout();
      return;
    }
   
    Task task = vm.migrateVM_Task(cr.getResourcePool(), newHost,
        VirtualMachineMovePriority.highPriority,
        VirtualMachinePowerState.poweredOn);
 
    if(task.waitForMe()==Task.SUCCESS)
    {
View Full Code Here

Examples of com.vmware.vim25.mo.ComputeResource

    {
      throw new InvalidPowerState();
    }
   
    HostSystem host = new HostSystem(vm.getServerConnection(), vm.getRuntime().getHost());
    ComputeResource cr = (ComputeResource) host.getParent();
    EnvironmentBrowser envBrowser = cr.getEnvironmentBrowser();
    ConfigTarget configTarget = envBrowser.queryConfigTarget(host);
    VirtualMachineConfigOption vmCfgOpt = envBrowser.queryConfigOption(null, host);

    type = validateNicType(vmCfgOpt.getGuestOSDescriptor(), vm.getConfig().getGuestId(), type);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

     */
    @Override
    public boolean addLocalSubmissionDetails(String computeResourceId, int priorityOrder, LOCALSubmission localSubmission) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            ComputeResource computeResource = appCatalog.getComputeResource();
            addJobSubmissionInterface(computeResource, computeResourceId,
                computeResource.addLocalJobSubmission(localSubmission), JobSubmissionProtocol.LOCAL, priorityOrder);
            return true;
        } catch (AppCatalogException e) {
            logger.error("Error while adding job submission interface to resource compute resource...", e);
            AiravataSystemException exception = new AiravataSystemException();
            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

     */
    @Override
    public boolean addSSHJobSubmissionDetails(String computeResourceId, int priorityOrder, SSHJobSubmission sshJobSubmission) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            ComputeResource computeResource = appCatalog.getComputeResource();
            addJobSubmissionInterface(computeResource, computeResourceId,
                computeResource.addSSHJobSubmission(sshJobSubmission), JobSubmissionProtocol.SSH, priorityOrder);
            return true;
        } catch (AppCatalogException e) {
            logger.error("Error while adding job submission interface to resource compute resource...", e);
            AiravataSystemException exception = new AiravataSystemException();
            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

     */
    @Override
    public boolean addLocalDataMovementDetails(String computeResourceId, int priorityOrder, LOCALDataMovement localDataMovement) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            ComputeResource computeResource = appCatalog.getComputeResource();
            addDataMovementInterface(computeResource, computeResourceId,
                computeResource.addLocalDataMovement(localDataMovement), DataMovementProtocol.LOCAL, priorityOrder);
            return true;
        } catch (AppCatalogException e) {
            logger.error("Error while adding data movement interface to resource compute resource...", e);
            AiravataSystemException exception = new AiravataSystemException();
            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

     */
    @Override
    public boolean addSCPDataMovementDetails(String computeResourceId, int priorityOrder, SCPDataMovement scpDataMovement) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            ComputeResource computeResource = appCatalog.getComputeResource();
            addDataMovementInterface(computeResource, computeResourceId,
                computeResource.addScpDataMovement(scpDataMovement), DataMovementProtocol.SCP, priorityOrder);
            return true;
        } catch (AppCatalogException e) {
            logger.error("Error while adding data movement interface to resource compute resource...", e);
            AiravataSystemException exception = new AiravataSystemException();
            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

     */
    @Override
    public boolean addGridFTPDataMovementDetails(String computeResourceId, int priorityOrder, GridFTPDataMovement gridFTPDataMovement) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            ComputeResource computeResource = appCatalog.getComputeResource();
            addDataMovementInterface(computeResource, computeResourceId,
                computeResource.addGridFTPDataMovement(gridFTPDataMovement), DataMovementProtocol.GridFTP, priorityOrder);
            return true;
        } catch (AppCatalogException e) {
            logger.error("Error while adding data movement interface to resource compute resource...", e);
            AiravataSystemException exception = new AiravataSystemException();
            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

    @Override
    public ComputeResourcePreference getGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
      try {
            appCatalog = AppCatalogFactory.getAppCatalog();
            GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
            ComputeResource computeResource = appCatalog.getComputeResource();
            if (!gatewayProfile.isGatewayResourceProfileExists(gatewayID)){
                logger.error("Given gateway profile does not exist in the system. Please provide a valid gateway id...");
                AiravataSystemException exception = new AiravataSystemException();
                exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
                exception.setMessage("Given gateway profile does not exist in the system. Please provide a valid gateway id...");
                throw exception;
            }
            if (!computeResource.isComputeResourceExists(computeResourceId)){
                logger.error("Given compute resource does not exist in the system. Please provide a valid compute resource id...");
                AiravataSystemException exception = new AiravataSystemException();
                exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
                exception.setMessage("Given compute resource does not exist in the system. Please provide a valid compute resource id...");
                throw exception;
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

    @Test
    public void testAppDeployment () throws Exception {
        ApplicationDeployment appDep = appcatalog.getApplicationDeployment();
        ApplicationInterface appInt = appcatalog.getApplicationInterface();
        ComputeResource computeRs = appcatalog.getComputeResource();
        ComputeResourceDescription cm = new ComputeResourceDescription();
        cm.setHostName("localhost");
        cm.setResourceDescription("test compute host");
        String hostId = computeRs.addComputeResource(cm);

        ApplicationModule module = new ApplicationModule();
        module.setAppModuleName("WRF");
        module.setAppModuleVersion("1.0.0");
        String wrfModuleId = appInt.addApplicationModule(module);
View Full Code Here

Examples of org.airavata.appcatalog.cpi.ComputeResource

    }

    @Test
    public void testAddComputeResource (){
        try {
            ComputeResource computeResource = appcatalog.getComputeResource();
            ComputeResourceDescription description = new ComputeResourceDescription();

            description.setHostName("localhost");
            description.setResourceDescription("test compute resource");
            Set<String> ipdaresses = new HashSet<String>();
            ipdaresses.add("222.33.43.444");
            ipdaresses.add("23.344.44.454");
            description.setIpAddresses(ipdaresses);
            Set<String> aliases = new HashSet<String>();
            aliases.add("test.alias1");
            aliases.add("test.alias2");
            description.setHostAliases(aliases);
            String sshsubmissionId = addSSHJobSubmission();
            System.out.println("**** SSH Submission id ****** :" + sshsubmissionId);
//            String gsiSSHsubmissionId = addGSISSHJobSubmission();
//            System.out.println("**** GSISSH Submission id ****** :" + gsiSSHsubmissionId);
//            String globusSubmissionId = addGlobusJobSubmission();
//            System.out.println("**** Globus Submission id ****** :" + globusSubmissionId);
            JobSubmissionInterface sshSubmissionInt = new JobSubmissionInterface();
            sshSubmissionInt.setJobSubmissionInterfaceId(sshsubmissionId);
            sshSubmissionInt.setPriorityOrder(1);
            sshSubmissionInt.setJobSubmissionProtocol(JobSubmissionProtocol.SSH);
            JobSubmissionInterface globusSubInt = new JobSubmissionInterface();
//            globusSubInt.setJobSubmissionInterfaceId(globusSubmissionId);
            globusSubInt.setPriorityOrder(2);
            globusSubInt.setJobSubmissionProtocol(JobSubmissionProtocol.GLOBUS);
            List<JobSubmissionInterface> interfaceList = new ArrayList<JobSubmissionInterface>();
            interfaceList.add(sshSubmissionInt);
            interfaceList.add(globusSubInt);
            description.setJobSubmissionInterfaces(interfaceList);

            String scpDataMoveId = addSCPDataMovement();
            System.out.println("**** SCP DataMoveId****** :" + scpDataMoveId);
            String gridFTPDataMoveId = addGridFTPDataMovement();
            System.out.println("**** grid FTP DataMoveId****** :" + gridFTPDataMoveId);

            List<DataMovementInterface> dataMovementInterfaces = new ArrayList<DataMovementInterface>();
            DataMovementInterface scpInterface = new DataMovementInterface();
            scpInterface.setDataMovementInterfaceId(scpDataMoveId);
            scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP);
            scpInterface.setPriorityOrder(1);

            DataMovementInterface gridFTPMv = new DataMovementInterface();
            gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId);
            gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP);
            gridFTPMv.setPriorityOrder(2);

            description.setDataMovementInterfaces(dataMovementInterfaces);

            BatchQueue batchQueue1 = new BatchQueue();
            batchQueue1.setQueueName("queue1");
            batchQueue1.setQueueDescription("que1Desc1");
            batchQueue1.setMaxRunTime(10);
            batchQueue1.setMaxNodes(4);
            batchQueue1.setMaxJobsInQueue(1);

            BatchQueue batchQueue2 = new BatchQueue();
            batchQueue2.setQueueName("queue2");
            batchQueue2.setQueueDescription("que1Desc2");
            batchQueue2.setMaxRunTime(10);
            batchQueue2.setMaxNodes(4);
            batchQueue2.setMaxJobsInQueue(1);

            List<BatchQueue> batchQueueList = new ArrayList<BatchQueue>();
            batchQueueList.add(batchQueue1);
            batchQueueList.add(batchQueue2);
            description.setBatchQueues(batchQueueList);

            Map<FileSystems, String> fileSysMap = new HashMap<FileSystems, String>();
            fileSysMap.put(FileSystems.HOME, "/home");
            fileSysMap.put(FileSystems.SCRATCH, "/tmp");
            description.setFileSystems(fileSysMap);

            String resourceId = computeResource.addComputeResource(description);
            System.out.println("**********Resource id ************* : " +  resourceId);
            ComputeResourceDescription host = null;
            if (computeResource.isComputeResourceExists(resourceId)){
                host = computeResource.getComputeResource(resourceId);
                System.out.println("**********Resource name ************* : " +  host.getHostName());
            }

            SSHJobSubmission sshJobSubmission = computeResource.getSSHJobSubmission(sshsubmissionId);
            System.out.println("**********SSH Submission resource job manager ************* : " +  sshJobSubmission.getResourceJobManager().toString());

//            GlobusJobSubmission globusJobSubmission = computeResource.get(globusSubmissionId);
//            System.out.println("**********Globus Submission resource job manager ************* : " + globusJobSubmission.getResourceJobManager().toString());

            SCPDataMovement scpDataMovement = computeResource.getSCPDataMovement(scpDataMoveId);
            System.out.println("**********SCP Data Move Security protocol ************* : " + scpDataMovement.getSecurityProtocol().toString());

            GridFTPDataMovement gridFTPDataMovement = computeResource.getGridFTPDataMovement(gridFTPDataMoveId);
            System.out.println("**********GRID FTP Data Move Security protocol ************* : " + gridFTPDataMovement.getSecurityProtocol().toString());

            description.setHostName("localhost2");
            computeResource.updateComputeResource(resourceId, description);
            if (computeResource.isComputeResourceExists(resourceId)){
                host = computeResource.getComputeResource(resourceId);
                System.out.println("**********Updated Resource name ************* : " +  host.getHostName());
            }

            Map<String, String> cfilters = new HashMap<String, String>();
            cfilters.put(AbstractResource.ComputeResourceConstants.HOST_NAME, "localhost2");
            List<ComputeResourceDescription> computeResourceList = computeResource.getComputeResourceList(cfilters);
            System.out.println("**********Size of compute resources ************* : " +  computeResourceList.size());

            List<ComputeResourceDescription> allComputeResourceList = computeResource.getAllComputeResourceList();
            System.out.println("**********Size of all compute resources ************* : " +  allComputeResourceList.size());

            Map<String, String> allComputeResourceIdList = computeResource.getAllComputeResourceIdList();
            System.out.println("**********Size of all compute resources ids ************* : " +  allComputeResourceIdList.size());

//            Map<String, String> globusfilters = new HashMap<String, String>();
//            globusfilters.put(AbstractResource.GlobusJobSubmissionConstants.RESOURCE_JOB_MANAGER, ResourceJobManager.PBS.toString());
//            List<GlobusJobSubmission> gList = computeResource.getGlobusJobSubmissionList(globusfilters);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.