}
return result;
}
public void exportVm(String exportDir, String exportName, boolean packToOva, boolean leaveOvaFileOnly) throws Exception {
ManagedObjectReference morOvf = _context.getServiceContent().getOvfManager();
VirtualMachineRuntimeInfo runtimeInfo = getRuntimeInfo();
HostMO hostMo = new HostMO(_context, runtimeInfo.getHost());
String hostName = hostMo.getHostName();
String vmName = getVmName();
DatacenterMO dcMo = new DatacenterMO(_context, hostMo.getHyperHostDatacenter());
if(runtimeInfo.getPowerState() != VirtualMachinePowerState.POWERED_OFF) {
String msg = "Unable to export VM because it is not at powerdOff state. vmName: " + vmName + ", host: " + hostName;
s_logger.error(msg);
throw new Exception(msg);
}
ManagedObjectReference morLease = _context.getService().exportVm(getMor());
if(morLease == null) {
s_logger.error("exportVm() failed");
throw new Exception("exportVm() failed");
}