-
Notifications
You must be signed in to change notification settings - Fork 668
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
attempt to modify the number of processors in a Power VS LPAR fails with message "cloud-instance does not have the capability to set custom virtual cores" #2939
Comments
Thanks for creating the issue. As per discussion with the service broker team one thing is clear that updating processors does not need additional capabilities on the service instance. Everyone should be able to increase/decrease the processors and is enabled by default. However setting custom virtual cores needs additional capability that is not enabled by default. As per the error message it seems the Terraform code is trying to change the virtual cores in case of change in the processor. I found the below code that is introducing this bug. terraform-provider-ibm/ibm/resource_ibm_pi_instance.go Lines 670 to 676 in f87de95
@surajibm @surajsub is setting virtual core needed while updating the processor and memory? If yes then we can check if there is change in the virtual core resource data OR we could simply remove it if not needed. Let me know your thoughts, I can work on implementing the fix. |
…date Fixes IBM-Cloud#2939 Signed-off-by: Yussuf Shaikh <[email protected]>
@yussufsh Agree with your comment - it looks like the issue is that the provider code is attempting to post an update (to the same value) the virtual cores when the user didn't actually change it - they were just changing the processors, which should be allowed. Looks like the code that determines which fields changed needs to be updated and only update the appropriate fields in the PowerVS API call. |
There is a change that's already available in my local provider was not pushed to the ibm cloud provider. I'll work with @yussufsh to pull that in. |
After discussing with Suraj and running some tests found that the virtual cores are needed to be set along with the processors. So the current PR needs to be updated to include virtual cores only when the capability is enabled for the service instance. |
…date Fixes #2939 Signed-off-by: Yussuf Shaikh <[email protected]>
Community Note
Terraform CLI and Terraform IBM Provider Version
terraform -v
Terraform v1.0.2
on linux_amd64
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
These files were used successfully to create a Power VS LPAR. Then the processor value (pi_processors = var.processors) was changed from "1" to "2", but the apply failed. The expectation was that the number of processors would have been altered.
Actual Behavior
terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
ibm_pi_instance.pvminstance will be updated in-place
~ resource "ibm_pi_instance" "pvminstance" {
id = "8336a0a7-2d20-49f0-a653-22355b3c1bf8/b2d0e34c-2f71-4fcc-8524-84f7b2beb882"
~ pi_image_id = "f9f8b757-7200-4e0c-9dcc-cd2277669140" -> "193d584a-31dc-449b-970a-f2e56548fd3b"
~ pi_migratable = false -> true
~ pi_processors = 1 -> 2
# (29 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
ibm_pi_instance.pvminstance: Modifying... [id=8336a0a7-2d20-49f0-a653-22355b3c1bf8/b2d0e34c-2f71-4fcc-8524-84f7b2beb882]
ibm_pi_instance.pvminstance: Still modifying... [id=8336a0a7-2d20-49f0-a653-22355b3c1bf8/b2d0e34c-2f71-4fcc-8524-84f7b2beb882, 10s elapsed]
╷
│ Error: failed to update the lpar with the change Failed to Update PVM Instance b2d0e34c-2f71-4fcc-8524-84f7b2beb882 :[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][400] pcloudPvminstancesPutBadRequest &{Code:0 Description:bad request: cloud-instance 93882c0135004de0a7fa1a4861a16ad9 does not have the capability to set custom virtual cores Error:bad request Message:}
│
│ with ibm_pi_instance.pvminstance,
│ on main.tf line 45, in resource "ibm_pi_instance" "pvminstance":
│ 45: resource "ibm_pi_instance" "pvminstance" {
│
╵
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: