I made a script that creates snapshots of our EC2 volumes. The script looks at which instances are running, which volumes are connected to those instances, and then creates snapshots for those volumes, ignoring the rest.
describe-instances, I get reservation IDs, not instance IDs. This is confusing, but it is as it is. When an instance is started, a reservation is created for that instance.
I'm still confused about the reservation concept.
Side note: I know what reserved instances are, which is different from what I'm describing here. A "reserved instance" means that you rent an instance for a year or two or three, and you get a price cut for that. So you reserve a t2.medium for one year, and if you don't use it, you still pay, but if you do use it, it's cheaper than normal.
Now back to the "reservation ID". The AWS FAQ says:
Every instance launched by EC2 has a reservation ID. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request.
Then there is this SE question: What is the purpose of 'Reservations' in Amazon EC2
It still is not clear what a reservation ID represents exactly
If you launch one instance at a time, each instance has its own unique reservation ID.
- When or how can a single reservation ID be linked to multiple instances?
- Can it be linked to several unrelated instances? Say I have a webserver and a database server. Can I start them under one reservation ID?
- Or, can a reservation id only be linked to one instance that is started multiple times, like for load balancing purposes.
In our situation, all instances have a unique reservation ID, but I want to know in what situations this can change, for a script I'm running using