I ran into the same problem with EC2 instances, but accessed it differently - instead of tracking instances, I automatically killed them after a certain amount of time. From your description, it sounds like it might not be practical in your environment, but I thought I would share it just in case it helps. My AMI was based on Fedora, so I created the following bash script, registered it as a service, and ran it at startup:
#!/bin/bash
You might consider doing something similar to suit your needs. If you do, be especially careful to stop the service before changing the image so that the instance does not turn off before you can repack.
If you wanted, you could turn off instances at a specific time (after everyone leaves work?), Or you can pass the keep-alive duration / shutdown time using the -d or -f options to ec2-run-instances and parse it in a script.
Justin garrick
source share