def fix_post_cobalt_ephemeral_disk(config, instance):
    """
    Merge ephemeral disk chain if it was broken by cobalt migrate
    :param config: cloud configuration
    :param instance: VM instance (as returned by NovaClient)
    """

    host = getattr(instance, INSTANCE_HOST_ATTRIBUTE)
    instance_name = getattr(instance, INSTANCE_NAME_ATTRIBUTE)

    ssh_user = config.cloud.ssh_user
    ssh_password = config.cloud.ssh_sudo_password
    runner = remote_runner.RemoteRunner(host, ssh_user,
                                        password=ssh_password,
                                        sudo=True)
    blkinfo = runner.run('virsh domblklist {name}', name=instance_name)
    for line in blkinfo.splitlines():
        if instance.id not in line:
            continue
        tokens = line.split()
        if len(tokens) < 2:
            continue
        _, path = tokens[:2]
        if instance.id not in path:
            continue
        cobalt_base_path = path + '.base'
        info = runner.run('qemu-img info {input}', input=path)
        if cobalt_base_path not in info:
            continue
        merge_path = path + '.merge'
        runner.run('qemu-img convert -f qcow2 -O qcow2 {input} {output} &&'
                   'mv {output} {input}',
                   input=path, output=merge_path)
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/compute/cold_evacuate.py/fix_post_cobalt_ephemeral_disk/original