public static ComputeState provisionMachine(VerificationHost host,URI peerURI,ComputeState vmState,boolean isMock,List<String> instancesToCleanUp) throws Throwable, InterruptedException, TimeoutException {
  host.log("Provisioning a single virtual machine on AWS.");
  ProvisionComputeTaskState provisionTask=new ProvisionComputeTaskService.ProvisionComputeTaskState();
  provisionTask.computeLink=vmState.documentSelfLink;
  provisionTask.isMockRequest=isMock;
  provisionTask.taskSubStage=ProvisionComputeTaskState.SubStage.CREATING_HOST;
  ProvisionComputeTaskService.ProvisionComputeTaskState outTask=TestUtils.doPost(host,provisionTask,ProvisionComputeTaskState.class,createServiceURI(host,peerURI,ProvisionComputeTaskService.FACTORY_LINK));
  host.waitForFinishedTask(ProvisionComputeTaskState.class,outTask.documentSelfLink);
  ComputeState provisionCompute=getCompute(host,vmState.documentSelfLink);
  assertNotNull(provisionCompute);
  host.log("Sucessfully provisioned a machine %s ",provisionCompute.id);
  instancesToCleanUp.add(provisionCompute.id);
  return provisionCompute;
}

public static ComputeState provisionMachine ( VerificationHost host , URI peerURI , ComputeState vmState , boolean isMock , List < String > instancesToCleanUp ) throws Throwable , InterruptedException , TimeoutException { host . log ( "Provisioning a single virtual machine on AWS." ) ; ProvisionComputeTaskState provisionTask = new ProvisionComputeTaskService . ProvisionComputeTaskState ( ) ; provisionTask . computeLink = vmState . documentSelfLink ; provisionTask . isMockRequest = isMock ; provisionTask . taskSubStage = ProvisionComputeTaskState . SubStage . CREATING_HOST ; ProvisionComputeTaskService . ProvisionComputeTaskState outTask = TestUtils . doPost ( host , provisionTask , ProvisionComputeTaskState . class , createServiceURI ( host , peerURI , ProvisionComputeTaskService . FACTORY_LINK ) ) ; host . waitForFinishedTask ( ProvisionComputeTaskState . class , outTask . documentSelfLink ) ; ComputeState provisionCompute = getCompute ( host , vmState . documentSelfLink ) ; assertNotNull ( provisionCompute ) ; host . log ( "Sucessfully provisioned a machine %s " , provisionCompute . id ) ; instancesToCleanUp . add ( provisionCompute . id ) ; return provisionCompute ; }
provisions a machine for which the state was created . expects the peeruri for the location of the service .
