# ec2 spot instance fails with ResutSet object has no attribute instances

**URL:** <https://forum.ansible.com/t/ec2-spot-instance-fails-with-resutset-object-has-no-attribute-instances/19696>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [November 5, 2015, 4:44pm UTC](https://forum.ansible.com/t/ec2-spot-instance-fails-with-resutset-object-has-no-attribute-instances/19696 "2015-11-05T16:44:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kesten\_Broughton2](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kesten\_Broughton2](https://forum.ansible.com/u/Kesten_Broughton2)\
**Post date:** [November 5, 2015, 4:44pm UTC](https://forum.ansible.com/t/ec2-spot-instance-fails-with-resutset-object-has-no-attribute-instances/19696/1 "2015-11-05T16:44:43Z")

</div>

We had ec2 spot instnaces working previously.  
Today we started getting the following stack trace.  
We monitored ec2 instances UI in amazon and as soon as the ec2 instance being created status went from pending to active ansible returned with the error.

Removing the spot instance price fixed the problem.  
Can anyone else reproduce?

ansible-cloud errors with spot instance

failed: [localhost] =\> (item={‘count’: u’1’, ‘Name’: u’sid-test-master’, ‘volumes’: [{‘volume\_size’: 100, ‘delete\_on\_termination’: True, ‘device\_type’: ‘gp2’, ‘device\_name’: ‘/dev/sda1’}, {‘volume\_size’: 300, ‘delete\_on\_termination’: True, ‘device\_type’: ‘gp2’, ‘device\_name’: ‘/dev/sdb’}, {‘volume\_size’: 300, ‘delete\_on\_termination’: True, ‘device\_type’: ‘gp2’, ‘device\_name’: ‘/dev/sdc’}, {‘volume\_size’: 300, ‘delete\_on\_termination’: True, ‘device\_type’: ‘gp2’, ‘device\_name’: ‘/dev/sdd’}, {‘volume\_size’: 300, ‘delete\_on\_termination’: True, ‘device\_type’: ‘gp2’, ‘device\_name’: ‘/dev/sde’}], ‘tags’: {‘role’: ‘mesos\_master,hdfs\_namenode,consul\_bootstrap,zk’, ‘Name’: u’sid-test-master’, ‘galaxy’: u’sid-test’}}) =\> {“failed”: true, “item”: {“Name”: “sid-test-master”, “count”: “1”, “tags”: {“Name”: “sid-test-master”, “galaxy”: “sid-test”, “role”: “mesos\_master,hdfs\_namenode,consul\_bootstrap,zk”}, “volumes”: [{“delete\_on\_termination”: true, “device\_name”: “/dev/sda1”, “device\_type”: “gp2”, “volume\_size”: 100}, {“delete\_on\_termination”: true, “device\_name”: “/dev/sdb”, “device\_type”: “gp2”, “volume\_size”: 300}, {“delete\_on\_termination”: true, “device\_name”: “/dev/sdc”, “device\_type”: “gp2”, “volume\_size”: 300}, {“delete\_on\_termination”: true, “device\_name”: “/dev/sdd”, “device\_type”: “gp2”, “volume\_size”: 300}, {“delete\_on\_termination”: true, “device\_name”: “/dev/sde”, “device\_type”: “gp2”, “volume\_size”: 300}]}, “parsed”: false}

Traceback (most recent call last):

File “/Users/wtsidney/.ansible/tmp/ansible-tmp-1446741090.74-68720537801589/ec2”, line 2962, in

main()

File “/Users/wtsidney/.ansible/tmp/ansible-tmp-1446741090.74-68720537801589/ec2”, line 1194, in main

(instance\_dict\_array, new\_instance\_ids, changed) = create\_instances(module, ec2)

File “/Users/wtsidney/.ansible/tmp/ansible-tmp-1446741090.74-68720537801589/ec2”, line 932, in create\_instances

terminated\_instances = [str([instance.id](http://instance.id)) for instance in res.instances

AttributeError: ‘ResultSet’ object has no attribute ‘instances’
