'Find a backend that can accept the volume with its new type.'

def find_retype_backend(self, context, request_spec, filter_properties=None, migration_policy='never'):

    filter_properties = (filter_properties or {})
    backend = (request_spec['volume_properties'].get('cluster_name') or request_spec['volume_properties']['host'])
    filter_properties['vol_exists_on'] = backend
    weighed_backends = self._get_weighted_candidates(context, request_spec, filter_properties)
    if (not weighed_backends):
        raise exception.NoValidBackend(reason=(_('No    valid    backends    for    volume    %(id)s    with    type    %(type)s') % {'id': request_spec['volume_id'], 'type': request_spec['volume_type']}))
    for weighed_backend in weighed_backends:
        backend_state = weighed_backend.obj
        if (backend_state.backend_id == backend):
            return backend_state
    if (utils.extract_host(backend, 'pool') is None):
        for weighed_backend in weighed_backends:
            backend_state = weighed_backend.obj
            new_backend = utils.extract_host(backend_state.backend_id, 'backend')
            if (new_backend == backend):
                return backend_state
    if (migration_policy == 'never'):
        raise exception.NoValidBackend(reason=(_('Current    backend    not    valid    for    volume    %(id)s    with    type    %(type)s,    migration    not    allowed') % {'id': request_spec['volume_id'], 'type': request_spec['volume_type']}))
    top_backend = self._choose_top_backend(weighed_backends, request_spec)
    return top_backend.obj
