@RpcMethod public void createImage(String imageId,String datastore,AsyncMethodCallback<Host.AsyncClient.create_image_call> handler) throws RpcException {
  ensureClient();
  CreateImageRequest createImageRequest=new CreateImageRequest();
  createImageRequest.setImage_id(imageId);
  createImageRequest.setDatastore(datastore);
  clientProxy.setTimeout(CREATE_IMAGE_TIMEOUT_MS);
  logger.info("create_image target {}, request {}",getHostIp(),createImageRequest);
  try {
    clientProxy.create_image(createImageRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void createImage ( String imageId , String datastore , AsyncMethodCallback < Host . AsyncClient . create_image_call > handler ) throws RpcException { ensureClient ( ) ; CreateImageRequest createImageRequest = new CreateImageRequest ( ) ; createImageRequest . setImage_id ( imageId ) ; createImageRequest . setDatastore ( datastore ) ; clientProxy . setTimeout ( CREATE_IMAGE_TIMEOUT_MS ) ; logger . info ( "create_image target {}, request {}" , getHostIp ( ) , createImageRequest ) ; try { clientProxy . create_image ( createImageRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to create an image by moving the image file from tmp path . on completion , the specified handler is invoked .
