'Find the volume by name or instanceId.
We check if we can use provider_id before using it. If so then
we expect to find it by provider_id.
We also conclude our failover at this point. If we are failed over we
run _import_one to rename the volume.
:param name: Volume name.
:param provider_id: instanceId of the volume if known.
:param islivevol: Is this a live volume.
:return: sc volume object or None.
:raises VolumeBackendAPIException: if unable to import.'

def find_volume(self, name, provider_id, islivevol=False):

    LOG.debug('find_volume:    name:%(name)r    provider_id:%(id)r    islv:%(lv)r', {'name': name, 'id': provider_id, 'lv': islivevol})
    scvolume = None
    if islivevol:
        primary_id = self._find_volume_primary(provider_id, name)
        scvolume = self.get_volume(primary_id)
    elif self._use_provider_id(provider_id):
        scvolume = self.get_volume(provider_id)
        if self.failed_over:
            if (scvolume['name'] == self._repl_name(name)):
                scvolume = self._import_one(scvolume, name)
                if (not scvolume):
                    msg = (_('Unable    to    complete    failover    of    %s.') % name)
                    raise exception.VolumeBackendAPIException(data=msg)
                LOG.info('Imported    %(fail)s    to    %(guid)s.', {'fail': self._repl_name(name), 'guid': name})
    else:
        scvolume = self._search_for_volume(name)
    return scvolume
