@RpcMethod public void createVm(String reservation,Map<String,String> environment,AsyncMethodCallback<Host.AsyncClient.create_vm_call> handler) throws RpcException {
  ensureClient();
  CreateVmRequest createVmRequest=new CreateVmRequest(reservation);
  if (environment != null && !environment.isEmpty()) {
    createVmRequest.setEnvironment(environment);
  }
  clientProxy.setTimeout(CREATE_VM_TIMEOUT_MS);
  logger.info("create_vm target {}, reservation {}, request {}",getHostIp(),reservation,createVmRequest);
  try {
    clientProxy.create_vm(createVmRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void createVm ( String reservation , Map < String , String > environment , AsyncMethodCallback < Host . AsyncClient . create_vm_call > handler ) throws RpcException { ensureClient ( ) ; CreateVmRequest createVmRequest = new CreateVmRequest ( reservation ) ; if ( environment != null && ! environment . isEmpty ( ) ) { createVmRequest . setEnvironment ( environment ) ; } clientProxy . setTimeout ( CREATE_VM_TIMEOUT_MS ) ; logger . info ( "create_vm target {}, reservation {}, request {}" , getHostIp ( ) , reservation , createVmRequest ) ; try { clientProxy . create_vm ( createVmRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to create a vm . on completion , the specified handler is invoked .
