Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for volume state #4

Open
e0d opened this issue Dec 9, 2013 · 2 comments
Open

Wait for volume state #4

e0d opened this issue Dec 9, 2013 · 2 comments

Comments

@e0d
Copy link
Contributor

e0d commented Dec 9, 2013

raidformer doesn't seem to wait for EBS volumes to become available before attempting to attach them. If there are not in the right state the following error occurs. I see this error nearly every time I run raidformer, even with small volumes. I can create a PR unless I'm missing something obvious.

Traceback (most recent call last):
  File "./raidformer.py", line 168, in <module>
    ec2conn.attach_volume(vol.id, instance_data['instance-id'], device)
  File "/usr/lib/python2.7/dist-packages/boto/ec2/connection.py", line 1369, in attach_volume
    return self.get_status('AttachVolume', params, verb='POST')
  File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 935, in get_status
    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>IncorrectState</Code><Message>vol-c92fa384 is not 'available'.</Message></Error></Errors><RequestID>97f9ecf4-1b41-4c58-8254-63fc725057c8</RequestID></Response>
@jsmartin
Copy link
Owner

jsmartin commented Dec 9, 2013

Hmm, interesting.. I'm ok with a pull request.. I thought I was waiting for the devices to be ready with this:

for device in attached_devices:
found = False

    while found is False:

        print "Waiting for %s to become available." % device
        if os.path.exists(device):
            print "%s has been found." % device
            break
        else:
            time.sleep(10)

But perhaps something has changed.

@e0d
Copy link
Contributor Author

e0d commented Dec 9, 2013

That waits for the device to show up upon attachment, the above error occurs when you call attach too soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants