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

Cannot provision IBP using ibm_resource_instance #1186

Closed
rolivieri opened this issue Mar 13, 2020 · 16 comments
Closed

Cannot provision IBP using ibm_resource_instance #1186

rolivieri opened this issue Mar 13, 2020 · 16 comments
Assignees

Comments

@rolivieri
Copy link

Hello, our environment is IBM Cloud Schematics, Terraform version v0.11.14.

Using Schematics/Terraform, we can successfully provision services on the IBM Cloud such as LogDNA, Sysdig, IBM Cloud Object Storage, and others... however, attempting to provision an instance of IBM Blockchain Platform always fails with the following error:

2020/03/12 22:26:54 Terraform apply | ibm_resource_instance.mos-ibp: Creating...
 2020/03/12 22:26:54 Terraform apply |   crn:                     "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   guid:                    "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   location:                "" => "us-south"
 2020/03/12 22:26:54 Terraform apply |   name:                    "" => "IBP-MOS"
 2020/03/12 22:26:54 Terraform apply |   plan:                    "" => "standard"
 2020/03/12 22:26:54 Terraform apply |   resource_controller_url: "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   resource_crn:            "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   resource_group_id:       "" => "b224fe972aab45daa787ac21bf86cd2a"
 2020/03/12 22:26:54 Terraform apply |   resource_group_name:     "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   resource_name:           "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   resource_status:         "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   service:                 "" => "blockchain"
 2020/03/12 22:26:54 Terraform apply |   status:                  "" => "<computed>"
 2020/03/12 22:26:54 Terraform apply |   tags.#:                  "" => "<computed>"
 2020/03/12 22:26:55 Terraform apply | 
 2020/03/12 22:26:55 Terraform apply | Error: Error applying plan:
 2020/03/12 22:26:55 Terraform apply | 
 2020/03/12 22:26:55 Terraform apply | 1 error occurred:
 2020/03/12 22:26:55 Terraform apply | 	* ibm_resource_instance.mos-ibp: 1 error occurred:
 2020/03/12 22:26:55 Terraform apply | 	* ibm_resource_instance.mos-ibp: Cannot create instance of resource blockchain
 2020/03/12 22:26:55 Terraform apply | Use 'ibm_service_instance' if the resource is a Cloud Foundry service

Here's the block of code from our terraform script:

resource "ibm_resource_instance" "mos-ibp" {
  name              = "IBP-MOS"
  service           = "blockchain"
  plan              = "standard"
  location          = "${var.ibm_region}"
  resource_group_id = "${data.ibm_resource_group.mos_rg.id}"
}

And looking at the source code for terraform-provider-ibm, we can see that this is the line where it fails:

https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/ibm/resource_ibm_resource_instance.go#L180

IBM Blockchain Platform (v2) is not a Cloud Foundry service; therefore using ibm_service_instance is not the solution. The error message is not quite useful so not sure what is wrong. Looking at the terraform-provider-ibm source code, it looks like there could be some metadata missing on the IBM Blockchain Platform service definition?

Could you please advice? Thanks.

@albee-jhoney
Copy link

Refer to the docs for resource_instance (https://cloud.ibm.com/docs/terraform?topic=terraform-resource-mgmt-resources#resource-instance).

You must pass the correct parameters json data, to successfully provision the Blockchain resource, it cannot be blank.. We have not yet tested the resource_instance for IBM Blockchain. Pls connect with the blockchain service team to get a sample request payload / parameters, to provision the Blockchain resource instance on IBM Cloud.

@tnakajo
Copy link

tnakajo commented Mar 16, 2020

@hkantare, I will wait for an update as the terraform provider issue in here.

@tnakajo
Copy link

tnakajo commented Mar 16, 2020

Let me know if you need to engage with the blockchain service team to discuss.

@hkantare
Copy link
Collaborator

We identified the issue ..We need to make changes in reading Metadata to check if the service can be provisioned using service-instance or resource-instance.
It will be available part of next release...(early next release)

@hkantare hkantare self-assigned this Mar 16, 2020
@rolivieri
Copy link
Author

@hkantare Thanks for the update. When will this next release be available? Can you provide an ETA?

@tnakajo
Copy link

tnakajo commented Mar 16, 2020

@hkantare Thank you. We'll wait for your update about the ETA for the next release.

@hkantare
Copy link
Collaborator

ETA will be mostly on 26th or 27th March..We will update the issue once we fix Terraform and update Schematics

@rolivieri
Copy link
Author

@hkantare Hello, just following up. Is the issue resolved or do you guys have a new ETA that you could share with us?

@hkantare
Copy link
Collaborator

The issue is resolved..Can you please try with latest relelases v1.2.6 or v1.2.5

@rolivieri
Copy link
Author

@hkantare It is working! Thanks for your help!

@uhaller
Copy link

uhaller commented May 13, 2020

hi,
I'm trying to create an IBM Blockchain instance via following command:

ibmcloud resource service-instance-create blockchain-test-uh blockchain standard eu-de -g default

With this command I'm getting following output:

Creating service instance blockchain-test-uh in resource group default of account IBM as uhaller@de.ibm.com...
FAILED
Error parsing JSON: json: cannot unmarshal array into Go struct field ServiceResourceMetadata.service of type resource.ServiceParameters

Can you please advice whether this behavior is related to the closed issue or whether I have to open a new issue.
Thanks in advance.

@hkantare
Copy link
Collaborator

@uhaller Are you using Terraform provider or IBM cloud cli to provision resource

@uhaller
Copy link

uhaller commented May 13, 2020

When running the ibmcloud command I'm assuming this is the IBM cloud cli. I'm not sure whether the Terraform provider is used under the hood to provision resources.

@hkantare
Copy link
Collaborator

Yes its an issue from ibmcloud cli it doesn't use the Terraform provider ..From our terraform provider we can provision the resource successfully

resource "ibm_resource_instance" "mos-ibp" {
  name              = "IBP-MOS"
  service           = "blockchain"
  plan              = "standard"
  location          = "${var.ibm_region}"
  resource_group_id = "${data.ibm_resource_group.mos_rg.id}"
}

You can open cloud support ticket or https://github.ibm.com/Bluemix/bluemix-cli/issues open an issue here..

@uhaller
Copy link

uhaller commented May 13, 2020

ok, thanks.

@y0zg
Copy link

y0zg commented Jul 15, 2020

Hi @rolivieri ,

After IBP resource creation how do you link it with IKS cluster? I see this is a manual step in IBM cloud console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants