@RpcMethod public void deleteVm(String vmId,List<String> diskIdsToDetach,AsyncMethodCallback<Host.AsyncClient.delete_vm_call> handler) throws RpcException {
  ensureClient();
  DeleteVmRequest deleteVmRequest=new DeleteVmRequest(vmId);
  deleteVmRequest.setDisk_ids(diskIdsToDetach);
  clientProxy.setTimeout(DELETE_VM_TIMEOUT_MS);
  logger.info("delete_vm {}, target {}, request {}",vmId,getHostIp(),deleteVmRequest);
  try {
    clientProxy.delete_vm(deleteVmRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void deleteVm ( String vmId , List < String > diskIdsToDetach , AsyncMethodCallback < Host . AsyncClient . delete_vm_call > handler ) throws RpcException { ensureClient ( ) ; DeleteVmRequest deleteVmRequest = new DeleteVmRequest ( vmId ) ; deleteVmRequest . setDisk_ids ( diskIdsToDetach ) ; clientProxy . setTimeout ( DELETE_VM_TIMEOUT_MS ) ; logger . info ( "delete_vm {}, target {}, request {}" , vmId , getHostIp ( ) , deleteVmRequest ) ; try { clientProxy . delete_vm ( deleteVmRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to delete a vm . on completion , the specified handler is invoked .
