Sort instances by ID

Change-Id: I30aa621660f8257cd2a9d1901bf760120c408238