'Tests live migration between two hosts.
Requires CONF.compute_feature_enabled.live_migration to be True.
:param state: The vm_state the migrated server should be in before and
after the live migration. Supported values are \'ACTIVE\'
and \'PAUSED\'.
:param volume_backed: If the instance is volume backed or not. If
volume_backed, *block* migration is not used.'

def _test_live_migration(self, state='ACTIVE', volume_backed=False):

    server_id = self.create_test_server(wait_until='ACTIVE', volume_backed=volume_backed)['id']
    source_host = self.get_host_for_server(server_id)
    destination_host = self.get_host_other_than(server_id)
    if (state == 'PAUSED'):
        self.admin_servers_client.pause_server(server_id)
        waiters.wait_for_server_status(self.admin_servers_client, server_id, state)
    LOG.info('Live    migrate    from    source    %s    to    destination    %s', source_host, destination_host)
    self._live_migrate(server_id, destination_host, state, volume_backed)
    if CONF.compute_feature_enabled.live_migrate_back_and_forth:
        LOG.info('Live    migrate    back    to    source    %s', source_host)
        self._live_migrate(server_id, source_host, state, volume_backed)
