'Returns a dict of all pools on all hosts HostManager knows about.'

def get_pools(self, context, filters=None):

    self._update_backend_state_map(context)
    all_pools = {}
    name = volume_type = None
    if filters:
        name = filters.pop('name', None)
        volume_type = filters.pop('volume_type', None)
    for (backend_key, state) in self.backend_state_map.items():
        for key in state.pools:
            filtered = False
            pool = state.pools[key]
            pool_key = vol_utils.append_host(backend_key, pool.pool_name)
            new_pool = dict(name=pool_key)
            new_pool.update(dict(capabilities=pool.capabilities))
            if (name and (new_pool.get('name') != name)):
                continue
            if filters:
                for (attr, value) in filters.items():
                    cap = new_pool.get('capabilities').get(attr)
                    if (not self._equal_after_convert(cap, value)):
                        filtered = True
                        break
            if (not filtered):
                all_pools[pool_key] = pool
    if volume_type:
        volume_type = volume_types.get_by_name_or_id(context, volume_type)
        all_pools = self._filter_pools_by_volume_type(context, volume_type, all_pools)
    return [dict(name=key, capabilities=value.capabilities) for (key, value) in all_pools.items()]
