1

Python-boto fails to create a snapshot of a running instance (python-novaclient with the same provider and the same instance does the job fine).

The output is here: the strange thing is the message "Invalid value 'i-00001e17' for instanceId."

>>> cc = EC2Connection(...)    # Normally working connection
>>>
>>> vm = cc.get_all_instances()[4].instances[0] # Get one of the running instances
send: 'POST /services/Cloud/ HTTP/1.1\r\nAccept-Encoding: ...'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/xml
header: Content-Length: 4753
header: Date: Thu, 16 Jan 2014 18:51:06 GMT
>>>
>>> vm.id  # Print the id
u'i-00001e17'
>>>
>>> cc.create_image(vm.id, "newSnapshot")  # THE PROBLEM: fails to create image
send: 'POST /services/Cloud/ HTTP/1.1\r\nAccept-Encoding:...'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Content-Type: text/xml
header: Content-Length: 303
header: Date: Thu, 16 Jan 2014 18:51:29 GMT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/boto/ec2/connection.py", line 422, in create_image
    img = self.get_object('CreateImage', params, Image, verb='POST')
  File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1139, in get_object
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0"?>
<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Invalid value &apos;i-00001e17&apos; for instanceId. Instance does not have a volume attached at root (/dev/vda)</Message></Error></Errors><RequestID>req-0fd661c5-8ab1-4520-9c95-31f22b8354f1</RequestID></Response>
>>>

System: Ubuntu 13.04, Python version: 2.7.4, boto version: 2.19.0.

I will be grateful for any ideas.

1 Answers1

0

Make sure the EBS-drive has the name /dev/vda in the Console. Are you using OpenStack or something? It doesn't look like EC2.

Rico
  • 58,485
  • 12
  • 111
  • 141