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

[Bug Fix] Fix hanging after name update when vm shutdown, fix null po… #5881

Merged

Conversation

Alexander-Kita
Copy link
Collaborator

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Description:

  • Fixes bug where pi_instance hangs when name is updated while instance is shutdown
  • Fixes null pointer exception when updating virtual optic device
  • Adds new wait for update function, waits for both shutdown and active status, used when name/VOD is updated and when memory/cores are updated.

Output from acceptance testing:

pi_instance (r)

=== RUN   TestAccIBMPIInstanceBasic
--- PASS: TestAccIBMPIInstanceBasic (593.46s)
PASS

=== RUN   TestAccIBMPIInstanceUpdateActiveState
--- PASS: TestAccIBMPIInstanceUpdateActiveState (1498.25s)
PASS

=== RUN   TestAccIBMPIInstanceUpdateStoppedState
--- PASS: TestAccIBMPIInstanceUpdateStoppedState (2648.59s)
PASS

ismirlia
ismirlia previously approved these changes Dec 17, 2024
Comment on lines +681 to +685
if d.HasChange(Arg_InstanceName) && d.HasChange(Arg_VirtualOpticalDevice) {
oldVOD, _ := d.GetChange(Arg_VirtualOpticalDevice)
d.Set(Arg_VirtualOpticalDevice, oldVOD)
return diag.Errorf("updates to %s and %s are mutually exclusive", Arg_InstanceName, Arg_VirtualOpticalDevice)
}
Copy link
Collaborator Author

@Alexander-Kita Alexander-Kita Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates are mutually exclusive for name/active vm resources and cloud initialization, so an error is thrown here (clarification comment).

if err != nil {
return nil, "", err
}
if strings.ToLower(*pvm.Status) == State_Active && pvm.Health.Status == OK {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would also need to check the Arg_HealthStatus

Copy link
Collaborator Author

@Alexander-Kita Alexander-Kita Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added only to active block. Kept shutoff the same since the other update function also only checks for "OK" health status when checking for shutdown (keeps behavior the same).

@Alexander-Kita Alexander-Kita force-pushed the pi-instance-shutdown-name-change-bug branch from f9ff13c to 4bb2d85 Compare December 18, 2024 17:32
@yussufsh yussufsh merged commit 327a7c7 into IBM-Cloud:master Dec 23, 2024
1 check passed
@yussufsh yussufsh deleted the pi-instance-shutdown-name-change-bug branch December 23, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants