'Get all the hosts to which the datastore is connected and usable.
The datastore is considered to be usable for a host only if it is
writable, mounted and accessible.
:param datastore: Reference to the datastore entity
:return: List of managed object references of all connected
hosts'

def get_connected_hosts(self, datastore):

    summary = self.get_summary(datastore)
    if (not summary.accessible):
        return []
    host_mounts = self._session.invoke_api(vim_util, 'get_object_property', self._session.vim, datastore, 'host')
    if (not hasattr(host_mounts, 'DatastoreHostMount')):
        return []
    connected_hosts = []
    for host_mount in host_mounts.DatastoreHostMount:
        if self._is_usable(host_mount.mountInfo):
            connected_hosts.append(host_mount.key.value)
    return connected_hosts
