1

I am trying to attach a volume to an instance using the cli:

ec2-attach-volume 'vol-id' -i `curl http://169.254.169.254/2008-09-01/meta-data/instance-id` -d /dev/sdh

But this fails with the message:

+----------------------------+---------------------------------------------+
|            Code            |                   Message                   |
+----------------------------+---------------------------------------------+
| InvalidInstanceID.NotFound | The instance ID 'i-myid' does not exist |
+----------------------------+---------------------------------------------+

The instance id is actually the correct id for that instance so I am not sure what it is complaining about.

My ami is based off the jaunty image and is running in the same availability zone as my volume (eu-west-1a).

1 Answer 1

3

Because I was using the EU data centre I needed to specify the region:

ec2-attach-volume 'vol-id' -i curl http://169.254.169.254/2008-09-01/meta-data/instance-id -d /dev/sdh --region eu-west-1

Also I was using this tool http://www.timkay.com/aws/ which proxies calls to ec2-attach-volume. In doing that it also changes the way --region works. The correct syntax in this case is to use --region=eu

Hope this helps someone else!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .