'Fails over the volume back and forth.
Driver needs to update following info for failed-over volume:
1. provider_location: update serial number and lun id
2. replication_status: new status for replication-enabled volume'

def failover_host(self, context, volumes, secondary_backend_id, groups):

    volume_update_list = []
    group_update_list = []
    self.validate_backend_id(secondary_backend_id)
    if (secondary_backend_id != 'default'):
        rep_status = fields.ReplicationStatus.FAILED_OVER
        mirror_view = self.build_mirror_view(self.config, True)
    else:
        rep_status = fields.ReplicationStatus.ENABLED
        mirror_view = self.build_mirror_view(self.config, False)
    def failover_volume(volume, new_status):
        mirror_name = utils.construct_mirror_name(volume)
        provider_location = volume.provider_location
        try:
            mirror_view.promote_image(mirror_name)
        except storops_ex.VNXMirrorException as ex:
            LOG.error('Failed    to    failover    volume    %(volume_id)s    to    %(target)s:    %(error)s.', {'volume_id': volume.id, 'target': secondary_backend_id, 'error': ex})
            new_status = fields.ReplicationStatus.FAILOVER_ERROR
        else:
            secondary_client = mirror_view.secondary_client
            provider_location = utils.update_remote_provider_location(volume, secondary_client)
        model_update = {'volume_id': volume.id, 'updates': {'replication_status': new_status, 'provider_location': provider_location}}
        volume_update_list.append(model_update)
    def failover_group(group):
        is_failover_needed = False
        if ((secondary_backend_id != 'default') and (group.replication_status == fields.ReplicationStatus.ENABLED)):
            LOG.info('%(group_id)s    will    be    failed    over    to    secondary%(secondary_backend_id)s.', {'group_id': group.id, 'secondary_backend_id': secondary_backend_id})
            is_failover_needed = True
        if ((secondary_backend_id == 'default') and (group.replication_status == fields.ReplicationStatus.FAILED_OVER)):
            LOG.info('%(group_id)s    will    be    failed    over    to    primary%(secondary_backend_id)s.', {'group_id': group.id, 'secondary_backend_id': secondary_backend_id})
            is_failover_needed = True
        if is_failover_needed:
            (group_update, volume_update_list) = self.failover_replication(context, group, group.volumes, secondary_backend_id)
            return ({'group_id': group.id, 'updates': group_update}, [{'volume_id': vol_update['id'], 'updates': vol_update} for vol_update in volume_update_list])
        return ([], [])
    for group in groups:
        specs = common.ExtraSpecs.from_group(group)
        if specs.is_group_replication_enabled:
            (group_update, vols_in_group_update) = failover_group(group)
            if group_update:
                group_update_list.append(group_update)
                volume_update_list.extend(vols_in_group_update)
    group_ids = [group.id for group in groups]
    for volume in [volume for volume in volumes if (volume.group_id not in group_ids)]:
        specs = common.ExtraSpecs.from_volume(volume)
        if specs.is_replication_enabled:
            failover_volume(volume, rep_status)
    self.client = mirror_view.secondary_client
    self.active_backend_id = (None if (secondary_backend_id == 'default') else secondary_backend_id)
    return (secondary_backend_id, volume_update_list, group_update_list)
