def find_orphaned_vdi_uuids(xenapi):
 connected_vdi_uuids = set()
 _find_vdis_connected_to_vm(xenapi, connected_vdi_uuids)
 all_vdi_uuids = set()
 _find_all_vdis_and_system_vdis(xenapi, all_vdi_uuids, connected_vdi_uuids)
 orphaned_vdi_uuids = (all_vdi_uuids - connected_vdi_uuids)
 return orphaned_vdi_uuids

def find_orphaned_vdi_uuids ( xenapi ) : connected_vdi_uuids = set ( ) _find_vdis_connected_to_vm ( xenapi , connected_vdi_uuids ) all_vdi_uuids = set ( ) _find_all_vdis_and_system_vdis ( xenapi , all_vdi_uuids , connected_vdi_uuids ) orphaned_vdi_uuids = ( all_vdi_uuids - connected_vdi_uuids ) return orphaned_vdi_uuids
walk vm -> vbd -> vdi change and accumulate connected vdis .