you can eliminate the migration variable entirely  right  try objects migration get by instance and status context elevated instance uuid  status group hosts add migration source compute except exception migrationnotfoundbystatus pass