aws ec2 describe-instances
とかするとjsonのトップレベルにReservations
が出てくる。これは何なのか?
{
"Reservations": [
{
"OwnerId": "XXXXXXXXXXXX",
"ReservationId": "r-XXXXXXXX",
"Groups": [],
"Instances": [
{
"Monitoring": {
"State": "disabled"
:
:
reservation
はインスタンスを起動するアクションのこと。run-instances
を使って一度に複数のインスタンスを起動すると、(普通は)1個のreservation
が作られ、複数のインスタンスがそこに属する(ただし場合によっては複数のreservation
が作られることもあるらしい)。
普通に一度に1個のインスタンスを起動する場合は1 reservation = 1 instance。
reservation
単位でまとめて停止したりできる。
From my understanding, a reservation is an act of launching instances. Basically, a reservation is what you do, while an instance is what you get. If you launch multiple instances from one image via run_instances() you make one reservation, but get multiple instances.
run_instances together with Reservation.stop_all() allows you to run a bunch of instances, wait for them to complete the task and then stop them all at once.
http://stackoverflow.com/a/15619331/5209556