huaweicloud / packer-plugin-huaweicloud

Mozilla Public License 2.0
16 stars 19 forks source link

Failure with GET /v1/{project_id}/cloudservers/{server_id}/os-interface #95

Closed opnmind closed 7 months ago

opnmind commented 1 year ago

Hello,

during some tests on newer regions, we realized the command for requesting the nic's for the created server failed everytime.

2023/07/20 15:36:13 [DEBUG] API Request URL: GET https://ecs.xxxxxxxxxxxxxx/v1/b22fdbc9937645978e05be942d15c452/cloudservers/d0d2a1f5-2cf7-403a-8dcc-a00be212ddd4/os-interface

2023/07/20 15:36:13 machine readable: huaweicloud-ecs.basic-example,error []string{"{\"status_code\":404,\"request_id\":\"28a71659a2d8bcf184baa2e14f232202\",\"error_code\":\"APIGW.0101\",\"error_message\":\"The API does not exist or has not been published in the environment\",\"encoded_authorization_message\":\"\"}\n"}

For newer regions the docs finger pointing to a different request (https://support.huaweicloud.com/intl/zh-cn/api-ecs/ecs_06_0009.html)

From:

GET /v1/{project_id}/cloudservers/{server_id}/os-interface

with:

GET /v2.1/{project_id}/servers/{server_id}/os-interface

and then the plugin works fine.

https://github.com/huaweicloud/packer-plugin-huaweicloud/blob/8fbf73bc12096db9415c77b5277039af3be6f5eb/builder/ecs/step_run_source_server.go#L163C32-L163C32

Please update to the latest huaweicloud-sdk-go-v3 and switch there https://github.com/huaweicloud/huaweicloud-sdk-go-v3/blob/1cde6ad8843a5a17009446497fbf82cfdad75172/services/ecs/v2/ecs_meta.go#L638 the above described API path.

ShiChangkuo commented 1 year ago

@opnmind In which region are you experiencing this issue?

ShiChangkuo commented 7 months ago

I will close it temporarily, If you have found a problem that seems similar to this, please open a new issue and show more infos, so we can capture all the details necessary to investigate further.