@RpcMethod public void provision(List<String> dataStoreList,Set<String> imageDataStores,boolean usedForVMs,String hostAddress,int hostPort,double memoryOverCommit,String loggingEndpoint,String logLevel,StatsPluginConfig statsPluginConfig,boolean managementOnly,String hostId,String deploymentId,String ntpEndpoint,AsyncMethodCallback<AgentControl.AsyncClient.provision_call> handler) throws RpcException {
  ensureClient();
  HashSet<ImageDatastore> imageDatastoreSet=new HashSet<>();
  imageDataStores.forEach(null);
  ProvisionRequest provisionRequest=new ProvisionRequest();
  provisionRequest.setDatastores(dataStoreList);
  provisionRequest.setAddress(new ServerAddress(hostAddress,hostPort));
  provisionRequest.setMemory_overcommit(memoryOverCommit);
  provisionRequest.setManagement_only(managementOnly);
  provisionRequest.setHost_id(hostId);
  provisionRequest.setDeployment_id(deploymentId);
  provisionRequest.setNtp_endpoint(ntpEndpoint);
  provisionRequest.setImage_datastores(imageDatastoreSet);
  provisionRequest.setStats_plugin_config(statsPluginConfig);
  clientProxy.setTimeout(PROVISION_TIMEOUT_MS);
  logger.info("provision target: {}, request {}",getHostIp(),provisionRequest);
  try {
    clientProxy.provision(provisionRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void provision ( List < String > dataStoreList , Set < String > imageDataStores , boolean usedForVMs , String hostAddress , int hostPort , double memoryOverCommit , String loggingEndpoint , String logLevel , StatsPluginConfig statsPluginConfig , boolean managementOnly , String hostId , String deploymentId , String ntpEndpoint , AsyncMethodCallback < AgentControl . AsyncClient . provision_call > handler ) throws RpcException { ensureClient ( ) ; HashSet < ImageDatastore > imageDatastoreSet = new HashSet < > ( ) ; imageDataStores . forEach ( null ) ; ProvisionRequest provisionRequest = new ProvisionRequest ( ) ; provisionRequest . setDatastores ( dataStoreList ) ; provisionRequest . setAddress ( new ServerAddress ( hostAddress , hostPort ) ) ; provisionRequest . setMemory_overcommit ( memoryOverCommit ) ; provisionRequest . setManagement_only ( managementOnly ) ; provisionRequest . setHost_id ( hostId ) ; provisionRequest . setDeployment_id ( deploymentId ) ; provisionRequest . setNtp_endpoint ( ntpEndpoint ) ; provisionRequest . setImage_datastores ( imageDatastoreSet ) ; provisionRequest . setStats_plugin_config ( statsPluginConfig ) ; clientProxy . setTimeout ( PROVISION_TIMEOUT_MS ) ; logger . info ( "provision target: {}, request {}" , getHostIp ( ) , provisionRequest ) ; try { clientProxy . provision ( provisionRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to provision an agent . on completion , the specified handler is invoked .
