-
Notifications
You must be signed in to change notification settings - Fork 34
feat(ibm): improve ibm vpc baremetal behaviour #375
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
Conversation
ae2328b
to
179790e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @a-dubs, for improving this!
LGTM, could you please fix the inline commnets, the pylint error and would you mind adding a bit of context in the commit message explaining what we are improving?
""" | ||
if self._instance["status"] == _Status.FAILED.value: | ||
if any( | ||
"capacity" in reason["code"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a link pointing for docs covering this? If so, would you mind adding it for reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any docs for this. I discovered this by manually launching and inspecting instance status via the API/SDK.
da663a7
to
a129908
Compare
Previously, if baremetal instances could not be launched due to lack of capacity on the IBM Cloud, pycloudlib would fail to detect this and just assume that the instance booted correctly. Now, pycloudlib will return a capacity exception once this is detected, allowing for consumers of pycloudlib to properly implement retries for BM instances on IBM VPC.
a129908
to
85db81a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
# if self.b | ||
self._wait_for_status( | ||
_Status.RUNNING, | ||
sleep_seconds=900, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good for now. But, the 900
should be configurable from a consumer POV, as it might be not flexible enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I'll look at adding this sometime soon. Thanks!!
Commit Description
Previously, if baremetal instances could not be launched due to
lack of capacity on the IBM Cloud, pycloudlib would fail to detect
this and just assume that the instance booted correctly.
Now, pycloudlib will return a capacity exception once this is
detected, allowing for consumers of pycloudlib to properly
implement retries for BM instances on IBM VPC.
Description of Testing:
This was tested both through an external program that leverages pycloudlib, and through a modified version of the ibm example script. The external program validated the use case of implementing retries for baremetal.