Skip to content

Gracefully handle newly provisioned AWS instance not being fully known yet. #10

@lorrin

Description

@lorrin

This leaves a dangling new instance (because crash before assigning name to it)

[INFO] (172.18.12.29) 15:00:10: Provisioning node(s) i-9668b5f7
[DEBUG] (172.18.12.29) 15:00:10: Waiting for i-9668b5f7 to come online. Currently 'pending'
2013-04-12 15:00:15,960 ERROR [boto] 400 Bad Request
2013-04-12 15:00:15,960 ERROR [boto] <?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidInstanceID.NotFound</Code><Message>The instance ID 'i-9668b5f7' does not exist</Message></Error></Errors><RequestID>4ec662cd-3c17-4dec-90c4-90e9b1643106</RequestID></Response>
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/main.py", line 739, in main
    *args, **kwargs
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 316, in execute
    multiprocessing
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 213, in _execute
    return task.run(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 123, in run
    return self.wrapped(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/decorators.py", line 139, in decorated
    decorated.return_value = func(*args, **kwargs)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabfile.py", line 67, in all
    provision()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 120, in __call__
    return self.run(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 123, in run
    return self.wrapped(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/decorators.py", line 139, in decorated
    decorated.return_value = func(*args, **kwargs)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabulous/cloud/strategy/rolling.py", line 44, in provision
    env.new_nodes = provision_nodes(env.num_nodes, last_id + 1)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabulous/cloud/__init__.py", line 137, in provision_nodes
    nodes = env.provider_provision_function(num, next_id)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabulous/cloud/aws.py", line 90, in _provision_ec2_nodes_
    return map(lambda node_and_id: _wait_for_ec2_provisioning_(node_and_id[0], env.platform, env.role, str(node_and_id[1])), new_nodes_with_ids)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabulous/cloud/aws.py", line 90, in <lambda>
    return map(lambda node_and_id: _wait_for_ec2_provisioning_(node_and_id[0], env.platform, env.role, str(node_and_id[1])), new_nodes_with_ids)
  File "/Users/lhn/Code/my_project/subproject/deployment/fabulous/cloud/aws.py", line 106, in _wait_for_ec2_provisioning_
    new_node.update()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/boto/ec2/instance.py", line 417, in update
    rs = self.connection.get_all_instances([self.id])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/boto/ec2/connection.py", line 471, in get_all_instances
    [('item', Reservation)], verb='POST')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/boto/connection.py", line 1042, in get_list
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidInstanceID.NotFound</Code><Message>The instance ID 'i-9668b5f7' does not exist</Message></Error></Errors><RequestID>4ec662cd-3c17-4dec-90c4-90e9b1643106</RequestID></Response>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions