terraform-provider-huaweicloud
terraform-provider-huaweicloud copied to clipboard
[CCE] Node attach failed when attaching a prePaid instance
Error messages below reported when I attach a prePaid ECS instance into CCE:
2022-09-22T20:09:07.651+0800 [DEBUG] provider.terraform-provider-huaweicloud_v1.40.1: API Response Code: 200: timestamp=2022-09-22T20:09:07.651+0800
2022-09-22T20:09:07.651+0800 [DEBUG] provider.terraform-provider-huaweicloud_v1.40.1: API Response Headers:
Cache-Control: no-cache, no-store, must-revalidate
Cache-Control: no-cache, no-store, must-revalidate
Connection: keep-alive
Content-Type: application/json
Date: Thu, 22 Sep 2022 12:09:07 GMT
Pragma: no-cache
Pragma: no-cache
Server: api-gateway
Set-Cookie: ingress-cfe-cluster-manager-6443=279b515f9e09a03bda2bb83619ba07ab; Path=/; Secure; HttpOnly
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Request-Id: 27624219d67fddd2f9f95d8feb25abc3
X-Xss-Protection: 1; mode=block;: timestamp=2022-09-22T20:09:07.651+0800
2022-09-22T20:09:07.652+0800 [DEBUG] provider.terraform-provider-huaweicloud_v1.40.1: API Response Body: {
"apiVersion": "v3",
"kind": "Node",
"metadata": {
"annotations": {
"kubernetes.io/node-pool.id": "DefaultPool",
"os.architecture": "amd64"
},
"creationTimestamp": "2022-09-22 12:05:47.336298 +0000 UTC",
"name": "test",
"uid": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx",
"updateTimestamp": "2022-09-22 12:08:42.705957 +0000 UTC"
},
"spec": {
"az": "cn-east-3c",
"billingMode": 1,
"dataVolumes": [
{
"hw:passthrough": true,
"metadata": {
"__system__server_id": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx",
"attached_mode": "rw",
"hw:passthrough": "true",
"orderID": "CSXXXXXXXXXXXXXXX",
"productID": "xxxxx-xxxxxx-x--x",
"readonly": "False"
},
"size": 100,
"volumetype": "SAS"
}
],
"ecsGroupId": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx",
"extendParam": {
"chargingMode": 1,
"orderID": "",
"productID": ""
},
"flavor": "c7.2xlarge.4",
"isStatic": true,
"login": {
"sshKey": "xxxxx",
"userPassword": {}
},
"nodeNicSpec": {
"primaryNic": {
"subnetId": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx"
}
},
"os": "EulerOS 2.5",
"publicIP": {
"eip": {
"bandwidth": {}
}
},
"rootVolume": {
"hw:passthrough": true,
"metadata": {
"__system__server_id": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx",
"attached_mode": "rw",
"billing": "1",
"hw:passthrough": "true",
"orderID": "CSXXXXXXXXXXXXXXX",
"productID": "xxxxx-xxxxxx-x--x",
"readonly": "False"
},
"size": 40,
"volumetype": "SAS"
},
"runtime": {
"name": "docker"
}
},
"status": {
"phase": "Active",
"privateIP": "xxx.xxx.xxx.xxx",
"serverId": "xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxxx"
}
}: timestamp=2022-09-22T20:09:07.652+0800
2022-09-22T20:09:07.654+0800 [ERROR] provider.terraform-provider-huaweicloud_v1.40.1: setting state: Invalid address to set: []string{"charging_mode"}: timestamp=2022-09-22T20:09:07.654+0800
Anyone can take a look at the issue? I have met the same issue again when I purchase a new prePaid instance:
╷
│ Error: Error setting CCE Node fields: 1 error occurred:
│ * Invalid address to set: []string{"charging_mode"}
│
│
│
│ with huaweicloud_cce_node_attach.cce_node_attach["instance-3"],
│ on cce.tf line 82, in resource "huaweicloud_cce_node_attach" "cce_node_attach":
│ 82: resource "huaweicloud_cce_node_attach" "cce_node_attach" {
│
╵
I have tested with a postPaid instance before. Everything looks pretty look. While when I switch the charging mode to prePaid, the node attaching to cce get failed which even pending my terraform script state refresh. I have to manually update the tfstate to remove the node attach section to temporarily skip the issue.
@Jason-Zhang9309 pls have a look at this
@zhenzh @niuzhenguo I have found the cause of the problem and will fix it soon
When will the fix be released?