I think for the evacuate case (as well as migration/resize and live-migration) we'd want to do something like:
compare_instances = [i for i in instance_group.members if (i.id < instance_id or (i.id > instance_id and (instance has passed late-state group policy validation)))]
hostlist = list(set([i.host for i in compare_instances if i.host]))
migration_hostlist = (set of source and dest hosts for all instances in compare_instances that are currently migrating/live-migrating/evacuating/resizing)
Then combine the two lists of hosts and use that for checking against in the late-stage validation.
I think for the evacuate case (as well as migration/resize and live-migration) we'd want to do something like:
compare_instances = [i for i in instance_ group.members if (i.id < instance_id or (i.id > instance_id and (instance has passed late-state group policy validation)))]
hostlist = list(set([i.host for i in compare_instances if i.host]))
migration_hostlist = (set of source and dest hosts for all instances in compare_instances that are currently migrating/ live-migrating/ evacuating/ resizing)
Then combine the two lists of hosts and use that for checking against in the late-stage validation.