code: func hostsWithDatastore(hosts []types.ManagedObjectReference, path string) []types.ManagedObjectReference {
  	attached := hosts[:0]
  	var p object.DatastorePath
  	p.FromString(path)
  
  	for _, host := range hosts {
  		h := Map.Get(host).(*HostSystem)
  		if Map.FindByName(p.Datastore, h.Datastore) != nil {
  			attached = append(attached, host)
  		}
  	}
  
  	return attached
  }
docs: // hostsWithDatastore returns hosts that have access to the given datastore path