hashicorp / packer-plugin-tencentcloud

Packer plugin for Tencent Cloud Image Builder
https://www.packer.io/docs/builders/tencentcloud-cvm
Mozilla Public License 2.0
8 stars 12 forks source link

TencentCloudSDKError Code=InvalidPermission, Message=Bandwidth package user does not support the value `TRAFFIC_POSTPAID_BY_HOUR` in the parameter `.InternetAccessible.InternetChargeType` #48

Closed roberthluo closed 1 year ago

roberthluo commented 3 years ago

I used Packer to build the image and it errored out after 10 min.

Version 1.7.6

tencentcloud-cvm.testPacker_DS_config: output will be in this color.
==> tencentcloud-cvm.testPacker_DS_config: Trying to check image name: PackerTest_dsConfig...
    tencentcloud-cvm.testPacker_DS_config: Image name: useable
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepPreValidate'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Trying to check source image: ***...
    tencentcloud-cvm.testPacker_DS_config: Image found: Tencent Linux Release 2.2 (Final)
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepCheckSourceImage'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Not to use temporary keypair
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepConfigKeyPair'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Trying to use existing vpc: ***...
    tencentcloud-cvm.testPacker_DS_config: Vpc found: ****
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepConfigVPC'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Trying to use existing subnet: ***..
    tencentcloud-cvm.testPacker_DS_config: Subnet found: ***
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepConfigSubnet'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Trying to use existing securitygroup: ***...
    tencentcloud-cvm.testPacker_DS_config: Securitygroup found: ***
==> tencentcloud-cvm.testPacker_DS_config: Pausing after run of step 'stepConfigSecurityGroup'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Trying to create a new instance...
==> tencentcloud-cvm.testPacker_DS_config: Failed to run instance: [TencentCloudSDKError] Code=InvalidPermission, Message=Bandwidth package user does not support the value `TRAFFIC_POSTPAID_BY_HOUR`  in the parameter `.InternetAccessible.InternetChargeType`, RequestId=0e97cc45-2dd5-4de4-849d-e338570ed77a
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigSecurityGroup'. Press enter to continue.     
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigSubnet'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigVPC'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigKeyPair'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepCheckSourceImage'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepPreValidate'. Press enter to continue. 
Build 'tencentcloud-cvm.testPacker_DS_config' errored after 9 minutes 58 seconds: [TencentCloudSDKError] Code=InvalidPermission, Message=Bandwidth package user does not support the value `TRAFFIC_POSTPAID_BY_HOUR`  in the parameter `.InternetAccessible.InternetChargeType`, RequestId=0e97cc45-2dd5-4de4-849d-e338570ed77a
roberthluo commented 3 years ago

@likexian Can you help with this?

likexian commented 3 years ago

Hello @roberthluo

Please configure internet_charge_type and set to BANDWIDTH_PACKAGE.

  "builders": [
      {
        "internet_charge_type": "BANDWIDTH_PACKAGE",
        ...
      }
    ]
nicholasleeeee commented 3 years ago

@likexian Hi, I have inserted internet_charge_type = "BANDWIDTH_PACKAGE" into my source block but the same error came up.

Also tried internet_charge_type = "POSTPAID_BY_HOUR"

likexian commented 3 years ago

@likexian Hi, I have inserted internet_charge_type = "BANDWIDTH_PACKAGE" into my source block but the same error came up.

Please paste the logs.

nicholasleeeee commented 3 years ago
==> tencentcloud-cvm.testPacker_DS_config: Trying to create a new instance...
==> tencentcloud-cvm.testPacker_DS_config: Failed to run instance: [TencentCloudSDKError] Code=InvalidPermission, Message=Bandwidth package user does not support the value `TRAFFIC_POSTPAID_BY_HOUR`  in the parameter `.InternetAccessible.InternetChargeType`, RequestId=7ec8195f-a9d6-44c7-a9b5-5056a3f76995
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigSecurityGroup'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigSubnet'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigVPC'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepConfigKeyPair'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepCheckSourceImage'. Press enter to continue. 
==> tencentcloud-cvm.testPacker_DS_config: Pausing before cleanup of step 'stepPreValidate'. Press enter to continue. 
Build 'tencentcloud-cvm.testPacker_DS_config' errored after 15 seconds 444 milliseconds: [TencentCloudSDKError] Code=InvalidPermission, Message=Bandwidth package user does not support the value `TRAFFIC_POSTPAID_BY_HOUR`  in the parameter `.InternetAccessible.InternetChargeType`, RequestId=7ec8195f-a9d6-44c7-a9b5-5056a3f76995
likexian commented 3 years ago

Hello @nicholasleeeee I am sorry, I check the code and found that setting internet_charge_type is not supported, I will open a PR to implemente it.

nywilken commented 1 year ago

Closing as this was fixed by PR #49