我正在使用 boto 2.5.1、Python 2.7、Ubuntu Precise。我想在 EC2 实例上挂载快照。我已经从快照创建了一个卷,但是我不知道如何附加它。如果我做:
[setup stuff elided]
c = EC2Connection()
print volume
print instance
c.attach_volume(volume, instance, "/dev/snap")
我得到了一个非常无益的例外:
vol-2df00677
i-1509d364
Traceback (most recent call last):
File "./mongo_pulldown.py", line 48, in <module>
main()
File "./mongo_pulldown.py", line 28, in main
c.attach_volume(volume, instance, "/dev/snap")
File "/home/roy/deploy/current/python/local/lib/python2.7/site-packages/boto/ec2/connection.py", line 1530, in attach_volume
return self.get_status('AttachVolume', params, verb='POST')
File "/home/roy/deploy/current/python/local/lib/python2.7/site-packages/boto/connection.py", line 985, in get_status
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
不知道我做错了什么。我假设设备名称是任意的,并且附加调用将创建设备作为过程的一部分?还是该设备已经存在?
我怎样才能获得比“错误请求”更有用的诊断信息?