-
Notifications
You must be signed in to change notification settings - Fork 673
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
regression: Unable to create power instance using catalog image #4679
Comments
Hi @clnperez,
One more step you need to include is to add that stock image into your account first, and then run your terraform. Since the stock images is not under your account. https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_image |
i don't see how i would add the stock image to my account using that the UI, it seems, copies the stock image over under the covers when provisioning from a stock image. |
actually -- it looks like i'd use the first example? resource "ibm_pi_image" "testacc_image "{
pi_image_name = "7200-03-02"
pi_image_id = <"image id obtained from the datasource">
pi_cloud_instance_id = "<value of the cloud_instance_id>"
} |
If so -- can we update the TF doc to make this obvious since the UI behaves differently? |
Oh man. I'm now hitting another annoying error that I know is related to a "working as designed" issue, but partly needs to be made better. I deleted the boot image that the UI made, which was called the same thing as the name in the catalog (CentOS-Stream-8). IIRC, the name locally will just be the name of what it was in the catalog, and you can't change it. So now, since you can't re-create an image with the same name as an old one without waiting some amount of time, I can't test the new TF: 2023-07-12T16:40:46.223-0700 [ERROR] provider.terraform-provider-ibm_v1.49.0: Response contains error diagnostic: diagnostic_severity=ERROR tf_proto_version=5.3 @caller=github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_detail= diagnostic_summary="failed to perform Create Image Operation for cloud instance b4a9a365-9545-4c95-bf5c-d2f2132d4f87 with error [POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][400] pcloudCloudinstancesImagesPostBadRequest &{Code:0 Description:for cloud instance fbd37fc3a30c494c88f9258ff5571cc5, an image with the name CentOS-Stream-8 already exists or may have been recently deleted. Please wait or reattempt with a unique name Error:bad request Message:}" tf_provider_addr=provider tf_req_id=c26c9a0d-a87c-6e7b-0b09-0ad82225d432 tf_resource_type=ibm_pi_image tf_rpc=ApplyResourceChange @module=sdk.proto timestamp=2023-07-12T16:40:46.223-0700
2023-07-12T16:40:46.244-0700 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2023-07-12T16:40:46.244-0700 [ERROR] vertex "ibm_pi_image.image_centos8stream_lon06" error: failed to perform Create Image Operation for cloud instance b4a9a365-9545-4c95-bf5c-d2f2132d4f87 with error [POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][400] pcloudCloudinstancesImagesPostBadRequest &{Code:0 Description:for cloud instance fbd37fc3a30c494c88f9258ff5571cc5, an image with the name CentOS-Stream-8 already exists or may have been recently deleted. Please wait or reattempt with a unique name Error:bad request Message:}
╷
│ Error: failed to perform Create Image Operation for cloud instance b4a9a365-9545-4c95-bf5c-d2f2132d4f87 with error [POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][400] pcloudCloudinstancesImagesPostBadRequest &{Code:0 Description:for cloud instance fbd37fc3a30c494c88f9258ff5571cc5, an image with the name CentOS-Stream-8 already exists or may have been recently deleted. Please wait or reattempt with a unique name Error:bad request Message:}
│
│ with ibm_pi_image.image_centos8stream_lon06,
│ on main.tf line 38, in resource "ibm_pi_image" "image_centos8stream_lon06":
│ 38: resource "ibm_pi_image" "image_centos8stream_lon06" {
│
╵
╷
│ Error: failed to provision: failed to Create PVM Instance :[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][400] pcloudPvminstancesPostBadRequest &{Code:0 Description:error getting deployment image information: unable to get image f1626ad4-288a-4fc2-ade2-404c387a4fe7/a25cf2e3-6d80-485d-9f8c-2f788caa4c73: Resource not found f1626ad4-288a-4fc2-ade2-404c387a4fe7/a25cf2e3-6d80-485d-9f8c-2f788caa4c73 Error:bad request Message:}
│
│ with ibm_pi_instance.centos_instances_lon04[0],
│ on main.tf line 100, in resource "ibm_pi_instance" "centos_instances_lon04":
│ 100: resource "ibm_pi_instance" "centos_instances_lon04" { I tried renaming it: resource "ibm_pi_image" "image_centos8stream_lon04" {
provider = ibm.powervslon04
pi_image_name = "CentOS-Stream"
pi_image_id = local.centos_img_id_lon04
pi_cloud_instance_id = var.cloud_inst_id_lon04
} but that name seems to be ignored. It's still trying to name it "CentOS-Stream-8", and I keep getting that error. The only real "bug" here I think is that the name shouldn't be a required parameter since it's ignored in the stock image case. |
Yes, the UI does the copy under cover for stock images.
Yes, this how would copy a stock image. Or you can use the cli
I will have the doc update in the todo list
|
Just hit this one too... thanks for the issue - I've upvoted |
Community Note
Terraform CLI and Terraform IBM Provider Version
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
https://gist.github.com/clnperez/5ef202b04ad45a79d220c716c95e74c8
Panic Output
n/a
Expected Behavior
the instance should have created successfully. i have been able to use the catalog images with terraform in the past
Actual Behavior
it seems to be only looking for images in the service instance to verify, and fails because it can't find it there
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: