'Failover a full backend.
Fails over the volume back and forth, if secondary_id is \'default\',
volumes will be failed back, otherwize failed over.
Note that the resulting status depends on the direction:
in case of failover it will be \'failed-over\' and in case of
failback it will be \'available\''

@proxy._trace_time
def failover_host(self, context, volumes, secondary_id, groups=None):

    volume_update_list = []
    LOG.info('failover_host:    from    %(active)s    to    %(id)s', {'active': self.active_backend_id, 'id': secondary_id})
    if (secondary_id == strings.PRIMARY_BACKEND_ID):
        if self._using_default_backend():
            LOG.info('Host    has    been    failed    back.    No    need    to    fail    back    again.')
            return (self.active_backend_id, volume_update_list, [])
        pool_slave = self.storage_info[storage.FLAG_KEYS['storage_pool']]
        pool_master = self._get_target_params(self.active_backend_id)['san_clustername']
        goal_status = 'available'
    else:
        if (not self._using_default_backend()):
            LOG.info('Already    failed    over.    No    need    to    failover    again.')
            return (self.active_backend_id, volume_update_list, [])
        secondary_id = self.get_secondary_backend_id(secondary_id)
        pool_master = self.storage_info[storage.FLAG_KEYS['storage_pool']]
        try:
            pool_slave = self._get_target_params(secondary_id)['san_clustername']
        except Exception:
            msg = _("Invalid    target    information.    Can't    perform    failover")
            LOG.error(msg)
            raise self.meta['exception'].VolumeBackendAPIException(data=msg)
        pool_master = self.storage_info[storage.FLAG_KEYS['storage_pool']]
        goal_status = fields.ReplicationStatus.FAILED_OVER
    self.ibm_storage_remote_cli = self._init_xcli(secondary_id)
    if len(volumes):
        self.check_for_splitbrain(volumes, pool_master, pool_slave)
    for volume in volumes:
        LOG.debug("Attempting    to    failover    '%(vol)s'", {'vol': volume['name']})
        (result, details) = repl.VolumeReplication(self).failover(volume, failback=(secondary_id == strings.PRIMARY_BACKEND_ID))
        if result:
            status = goal_status
        else:
            status = 'error'
        updates = {'status': status}
        if (status == 'error'):
            updates['replication_extended_status'] = details
        volume_update_list.append({'volume_id': volume['id'], 'updates': updates})
    self._replace_xcli_to_remote_xcli()
    self.active_backend_id = secondary_id
    return (secondary_id, volume_update_list, [])
