Package org.jclouds.savvis.vpdc.domain

Examples of org.jclouds.savvis.vpdc.domain.Task


               });
      System.out.printf("Creating vm - vpdcId %s, vpdcName %s, networkName %s, name %s, os %s%n", vpdcId, vpdc.getName(), networkTierName, name, os);

      // TODO: determine the sizes available in the VDC, for example there's
      // a minimum size of boot disk, and also a preset combination of cpu count vs ram
      Task task = api.addVMIntoVDC(billingSiteId, vpdcId, VMSpec.builder().name(name).networkTierName(
               networkTierName).operatingSystem(os).memoryInGig(2).addDataDrive("/data01", 25).build());
     
      // make sure there's no error
      assert task.getId() != null && task.getError() == null : task;

      assert this.taskTester.apply(task.getId());
     
      // fetch the task again, in savvis, task.getOwner is populated with vApp after task has finished
      task = restContext.getApi().getBrowsingApi().getTask(task.getId());
     
      vm = restContext.getApi().getBrowsingApi().getVM(task.getOwner().getHref(), GetVMOptions.NONE);
      assert vm.getHref() != null : vm;
     
      // cannot ssh in savvis, as no public ip is assigned by default
//      conditionallyCheckSSH();
   }
View Full Code Here


         }

      })) {

         System.out.printf("Capturing VAppTemplate for vApp - %s%n", vApp.getName());
         Task task = api.captureVApp(billingSiteId, vpdcId, vApp.getHref());

         // make sure there's no error
         assert task.getId() != null && task.getError() == null : task;

         assert this.taskTester.apply(task.getId());
      }
   }
View Full Code Here

    
     String clonedVMName = vm.getName() + "clone";
    
     System.out.printf("Cloning vm - name %s in vpdcId %s in network %s, newVM name is %s%n", vm.getName(), vpdcId, networkTierName, clonedVMName);
    
       Task task = api.cloneVApp(vm.getHref(), clonedVMName, networkTierName);
      
       // make sure there's no error
       assert task.getId() != null && task.getError() == null : task;
       assert this.taskTester.apply(task.getId());
      
       // fetch the task again, in savvis, task.getOwner is populated with vApp after task has finished
       task = restContext.getApi().getBrowsingApi().getTask(task.getId());
      
       VM clonedVM = restContext.getApi().getBrowsingApi().getVM(task.getOwner().getHref(), GetVMOptions.NONE);
       assert clonedVM.getHref() != null : clonedVM;
   }
View Full Code Here

            specBuilder.bootDeviceName(volume.getDevice()).bootDiskSize(volume.getSize().intValue());
         else
            specBuilder.addDataDrive(volume.getDevice(), volume.getSize().intValue());
      }

      Task task = api.getVMApi().addVMIntoVDC(billingSiteId, vpdcId, specBuilder.build());
      // make sure there's no error
      if (task.getError() != null)
         throw new RuntimeException("cloud not add vm: " + task.getError().toString());

      if (taskTester.apply(task.getId())) {
         try {
            VM returnVal = this.getNode(task.getResult().getHref().toASCIIString());
            return new NodeAndInitialCredentials<VM>(returnVal, returnVal.getId(), null);
         } finally {
            // TODO: get the credentials relevant to the billingSiteId/Org
            // credentialStore.put(id, new Credentials(orgId, orgUser));
         }
View Full Code Here

TOP

Related Classes of org.jclouds.savvis.vpdc.domain.Task

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.