FlexibleEngineCloud / terraform-provider-flexibleengine

Terraform flexibleengine provider
https://www.terraform.io/docs/providers/flexibleengine/
Mozilla Public License 2.0
30 stars 53 forks source link

Error on flexibleengine_cce_cluster_v3 argument : subnet_id #176

Closed antonin-a closed 1 year ago

antonin-a commented 5 years ago

Hello,

It seems that there is an error with "subnet_id" argument on flexibleengine_cce_cluster_v3. Network id is waited instead.

Terraform Version

Terraform v0.11.13

Affected Resource(s)

flexibleengine_cce_cluster_v3

Terraform Configuration Files

` resource "flexibleengine_cce_cluster_v3" "cce_cluster" { name = "${var.cluster_name}" cluster_type= "${var.cluster_type}" cluster_version = "${var.cluster_version}" flavor_id= "${var.flavor_id}" vpc_id= "${var.vpc_id}" subnet_id= "${var.subnet_id}" container_network_type= "${var.container_network_type}" description= "${var.cluster_desc}" }

Expected Behavior

CCE cluster creation

Actual Behavior

TF error message: "internal server error"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply using existing subnet_id

Important Factoids

It seems that value that we should use is network_id and not subnet_id. Actual workaround is to use "data "flexibleengine_networking_network_v2"" to get the network_id but it is quite dirty.

niuzhenguo commented 5 years ago

@antonin-a Just as you said subnet_id here is network id instead. I also don't like these vpc/subnet and router/network/subnet things, so just keep the name consistent with the API argument.

antonin-a commented 5 years ago

Hello @niuzhenguo , not sure to understand your conclusion, do you plan to change "network_id" to "subnet_id" ? . On the official API documentation the parameter used is "subnet" (https://docs.prod-cloud-ocb.orange-business.com/en-us/api2/cce/cce_02_0236.html).

niuzhenguo commented 5 years ago

@antonin-a do you mean to change subnet_id to network_id? I can deprecate subnet_id and add network_id if you would like it.

antonin-a commented 5 years ago

No, just use "subnet_id" with the subnet_id value as on the API documentation. Just to correct the fact the "subnet_id here is network id instead" which look like a .... non sense.

niuzhenguo commented 5 years ago

@antonin-a API requires us to use network ID instead of subnet ID, you can have a try, so we can't make that change on our side.

antonin-a commented 5 years ago

Do you mean that Online documentation is currently wrong ? If this is the case I suggest to add a warning on the documentation here and push on Platform/CCE R&D team to fix the id to subnet (as "network" seems to be a "non-standard" resource on Flexible Engine).

niuzhenguo commented 5 years ago

@antonin-a If you would like to fix the id to subnet, that's not the docs issue but API itself instead, you need to call R&D team to make a change on the code level.

antonin-a commented 5 years ago

So you confirm that if I want to use the FE APIs there is also an error on the FE documentation ? I should use network instead of subnet ? If it is the case we are inline, that's why I suggest to add an warning on FlexibleEngine TF provider documentation for the subnet_id argument saying that user should use "network_id" for now. Let's investigate the fix on API/platform level in parallel.

niuzhenguo commented 5 years ago

OK, I will working on the docs side.

On Mon, May 13, 2019 at 7:22 PM Antonin notifications@github.com wrote:

So you confirm that if I wan't to use the FE APIs there is also an error on the FE documentation ? I should use network instead of subnet ? If it is the case we are inline, that's why I suggest to add an warning on FlexibleEngine TF provider documentation for the subnet_id argument saying that user should use "network_id" for now. Let's investigate the fix on API/platform level in parallel.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terraform-providers/terraform-provider-flexibleengine/issues/176#issuecomment-491782845, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5JQHV2QU6KEL4D5PXLOODPVFFP5ANCNFSM4HMEFVEQ .

-- Best Regards, Zhenguo Niu

antonin-a commented 5 years ago

Thanks a lot. Can you also answer to my questions ?

niuzhenguo commented 5 years ago

@antonin-a Yes, you should use network instead when using API.

antonin-a commented 4 years ago

hello @niuzhenguo can we please re-open this one ? API documentation is still indicating "subnet_id" (https://docs.prod-cloud-ocb.orange-business.com/api/cce/en-us_topic_0053608536.html) "Subnet ID of the container cluster".

Can you confirm that on APIs side, the network_id is expected ?

If it is the case @DafuSHI can you check with R&D how to correct this ?

duthifree commented 4 years ago

Hello here !

@antonin-a is right, CCE cluster ressource need a subnet_id...

Error: Error creating flexibleengine Cluster: Bad request with: [POST https://cce.eu-west-0.prod-cloud-ocb.orange-business.com/api/v3/projects/XXX/clusters], error message: {"error_code":"CCE_CM.0410","error_msg":"Subnet is not found in VPC","errorCode":"E.CFE.4000410","reason":"Subnet is not found in VPC"}

I have this issue because, i create network and subnet with networking ressource (not vpc ressource) so terraform check if my network ressource is up but not the subnet... i need to add "depends_on" or re-apply to make it work....

if CCE Cluster ressource use subnet_id instead of networ_id, terraform will check if this ressource is up and no need to "depends_on" or reapply

We don't have this issue when we use vpc ressource, because when you create vpc_subnet, vpc_subnet create at the same time an hide network, and cce_cluster check if the complete ressource is up.

niuzhenguo commented 4 years ago

@antonin-a @duthifree Thanks for raising this, but the CCE cluster API requires Network ID indeed! @DafuSHI Can we check with the R&D team of CCE service?

DafuSHI commented 4 years ago

Yes. I'm discussing this issue with R&D right now. Need to solve it once and for all

duthifree commented 4 years ago

On the API documentation, he needs both ...

We see that the arguments VPC_ID and SUBNET_ID are mandatory,

https://docs.prod-cloud-ocb.orange-business.com/api/cce/en-us_topic_0053608536.html

I think then just need to add a SUBNET_ID mandatory argument for creating a CCE cluster with Terraform

antonin-a commented 4 years ago

Hello @duthifree, on the doc it is not really "both", it's VPC and Subnet_it but there is no mentions of network_id. Network_id usage is quite strange as on Huawei solution (at least on the web ui) networks are "masked" and are not objects that users is suposed to be aware of (ex: you can't create a standalone network on the console, only a VPC + subnet that will automatically create a network and set network_name = vpc/router_id ).

@DafuSHI thanks a lot for your help. It seems to be an "issue" on APIs side. The cleanest way would be to change API in order to request subnet_id and not network (be carreful here, in case of change we will have to inform customers before any changes on API side). Another way would be to change the doc (change subnet_id for network_id) but it is not that clean. We are waiting your feedbacks from R&D. Regards

duthifree commented 4 years ago

Yes thank @antonin-a for the clarification concerning the network and vpc, I'm still a little confused with this two resources

antonin-a commented 4 years ago

Hello @DafuSHI any news on your side ?

antonin-a commented 4 years ago

@niuzhenguo can you please assign @DafuSHI on this one ?

niuzhenguo commented 4 years ago

@antonin-a sure

qukuijin1989 commented 3 years ago

hi @antonin-a doest this issues has been resolved?

antonin-a commented 3 years ago

Hello @qukuijin1989 , no, status is still the same : CCE APIs are asking a "subnet_id" but in reality we have to pass a "network_id". Regards

ShiChangkuo commented 1 year ago

closed by #857