-
Notifications
You must be signed in to change notification settings - Fork 107
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
Check instance exists before getting status during provisioning #604
Check instance exists before getting status during provisioning #604
Conversation
👍 |
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.
Nice catch! Couple of comments
status = instance.state.name.to_sym | ||
return true if status == :running | ||
return false, status | ||
if instance.exists? |
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.
return false unless instance.exists?
status = instance.state.name.to_sym
return true if status == :running
return false, status
would look a little cleaner
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.
That does look much cleaner - thanks for the suggestion! I will update the PR.
I still want to return a state, just so the log message here will continue to be useful.
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.
👍 You're right return false, :pending if yadda yadda
then
return true if status == :running | ||
return false, status | ||
if instance.exists? | ||
status = instance.state.name.to_sym |
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.
Don't need the extra padding if this isn't following https://github.com/ManageIQ/manageiq-providers-amazon/pull/604/files#diff-d41a9db602874dbc463a106f2cd10f97R4
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
Checked commits A-Beck/manageiq-providers-amazon@195e03f~...ca0d2e0 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.20.0, and yamllint |
Thanks @A-Beck ! |
…etting-status Check instance exists before getting status during provisioning (cherry picked from commit 262d51c) https://bugzilla.redhat.com/show_bug.cgi?id=1830305
Jansa backport details:
|
…etting-status Check instance exists before getting status during provisioning (cherry picked from commit 262d51c) https://bugzilla.redhat.com/show_bug.cgi?id=1830305
Ivanchuk backport details:
|
During AWS provisioning, I have been experiencing intermittent errors indicating invalid instance IDs ( longer trace attached ):
MIQ(ManageIQ::Providers::Amazon::CloudManager::Provision#provision_error) [[Aws::EC2::Errors::InvalidInstanceIDNotFound]: The instance ID 'i-xxxxxxxxxxxx' does not exist] encountered during phase [poll_clone_complete]
These requests did not include additional network interfaces. The solution posted to a similar issue - https://access.redhat.com/solutions/3638601 - did not help in my case.
This appears to be because the clone_task_check did not check if the instance existed before getting instance status. Since implementing this PR in my environment, I have not encountered errors during AWS provisioning.
aws-prov-trace-20200228-1258.log
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1830305