Is it possible to create a EBS volume from and attach it to the same instance? will boto be of some help?
|
feedback
|
|
Yes it is. Set your credentials as environment variables (
The above assumes you have only one instance started. If you know your instance id (you should!) you can simply match on the instance ids over all instances for all reservations. Eventually you can simply format your volume and mount it:
| |||
|
feedback
|
|
I think getting the instance ID dynamically is a better option. You can improve the above script with a GET request to the following URL within the instance.
Then you can write one script that'll work for all instances. Even if you just have one at a time, you can include this script in a custom AMI so each new instance can give itself a new volume if needed. | |||
|
feedback
|