code: public ManagedEntity findByIp(Datacenter datacenter, String ip, boolean vmOnly) throws RuntimeFault, RemoteException {
          ManagedObjectReference mor = getVimService().findByIp(getMOR(), datacenter == null ? null : datacenter.getMOR(), ip, vmOnly);
          return MorUtil.createExactManagedEntity(getServerConnection(), mor);
      }
docs: Find a Virtual Machine or Host System by its IP address.
  
  @param datacenter The datacenter within which it searches. If null is passed, all inventory is searched.
  @param ip         The IP address of the VM or Host.
  @param vmOnly     When set true only searches for VM; otherwise only for Host.
  @return A ManagedEntity to either HostSystem or VirtualMachine having the IP address.
  @throws RuntimeFault
  @throws RemoteException