def clean_orphaned_instances(xenapi, orphaned_instances):
    """Clean orphaned instances."""
    for vm_ref, vm_rec, instance in orphaned_instances:
        if CONF.verbose:
            print "CLEANING INSTANCE (%s)" % instance.name

        cleanup_instance(xenapi, instance, vm_ref, vm_rec)
dataset/ETHPy150Open openstack/nova/tools/xenserver/vm_vdi_cleaner.py/clean_orphaned_instances/original