public VirtualMachine findByDatastorePath ( Datacenter datacenter , String dPath ) throws InvalidDatastore , RuntimeFault , RemoteException { if ( datacenter == null ) { throw new IllegalArgumentException ( "datacenter must not be null." ) ; } ManagedObjectReference mor = getVimService ( ) . findByDatastorePath ( getMOR ( ) , datacenter . getMOR ( ) , dPath ) ; return ( VirtualMachine ) MorUtil . createExactManagedEntity ( getServerConnection ( ) , mor ) ; }
Find a VM by its location on a datastore