From 6cefc8ffcb670d3d670b1a896cd4aa4949307774 Mon Sep 17 00:00:00 2001 From: hellertang Date: Wed, 14 Aug 2024 17:47:47 +0800 Subject: [PATCH 1/6] add more disk type --- .web-docs/components/builder/cvm/README.md | 2 +- builder/tencentcloud/cvm/run_config.go | 4 ++-- .../tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.web-docs/components/builder/cvm/README.md b/.web-docs/components/builder/cvm/README.md index 227bbb61..798abdc3 100644 --- a/.web-docs/components/builder/cvm/README.md +++ b/.web-docs/components/builder/cvm/README.md @@ -134,7 +134,7 @@ a [communicator](/packer/docs/templates/legacy_json_templates/communicator) can type for all data disks, and each data disk size will use the origin value in source image. The data disks allow for the following argument: - - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`. + - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM`, `CLOUD_SSD`, `CLOUD_BSSD`, `CLOUD_HSSD` and `CLOUD_TSSD`. - `disk_size` - Size of the data disk. - `disk_snapshot_id` - Id of the snapshot for a data disk. diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index e4a45e11..753d7961 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -57,7 +57,7 @@ type TencentCloudRunConfig struct { // type for all data disks, and each data disk size will use the origin // value in source image. // The data disks allow for the following argument: - // - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`. + // - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM`, `CLOUD_SSD`, `CLOUD_BSSD`, `CLOUD_HSSD` and `CLOUD_TSSD`. // - `disk_size` - Size of the data disk. // - `disk_snapshot_id` - Id of the snapshot for a data disk. DataDisks []tencentCloudDataDisk `mapstructure:"data_disks"` @@ -110,7 +110,7 @@ type TencentCloudRunConfig struct { } var ValidCBSType = []string{ - "LOCAL_BASIC", "LOCAL_SSD", "CLOUD_BASIC", "CLOUD_SSD", "CLOUD_PREMIUM", + "LOCAL_BASIC", "LOCAL_SSD", "CLOUD_BASIC", "CLOUD_PREMIUM", "CLOUD_BSSD", "CLOUD_SSD", "CLOUD_HSSD", "CLOUD_TSSD", } func (cf *TencentCloudRunConfig) Prepare(ctx *interpolate.Context) []error { diff --git a/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx b/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx index 7d1fabb9..c17d6aed 100644 --- a/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx +++ b/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx @@ -28,7 +28,7 @@ type for all data disks, and each data disk size will use the origin value in source image. The data disks allow for the following argument: - - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`. + - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM`, `CLOUD_SSD`, `CLOUD_BSSD`, `CLOUD_HSSD` and `CLOUD_TSSD`. - `disk_size` - Size of the data disk. - `disk_snapshot_id` - Id of the snapshot for a data disk. From 9da8cc80042f392c511913a0502f0ff505658ddf Mon Sep 17 00:00:00 2001 From: arunma Date: Mon, 6 Jan 2025 19:13:05 +0800 Subject: [PATCH 2/6] feat: support cdc --- builder/tencentcloud/cvm/builder.go | 2 ++ builder/tencentcloud/cvm/run_config.go | 2 ++ builder/tencentcloud/cvm/step_config_subnet.go | 2 ++ builder/tencentcloud/cvm/step_run_instance.go | 6 ++++++ go.mod | 6 +++--- go.sum | 10 ++++++++-- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/builder/tencentcloud/cvm/builder.go b/builder/tencentcloud/cvm/builder.go index cda74a0c..55f44834 100644 --- a/builder/tencentcloud/cvm/builder.go +++ b/builder/tencentcloud/cvm/builder.go @@ -109,6 +109,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) SubnetCidrBlock: b.config.SubnectCidrBlock, SubnetName: b.config.SubnetName, Zone: b.config.Zone, + CdcId: b.config.CdcId, }, &stepConfigSecurityGroup{ SecurityGroupId: b.config.SecurityGroupId, @@ -132,6 +133,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) AssociatePublicIpAddress: b.config.AssociatePublicIpAddress, CamRoleName: b.config.CamRoleName, Tags: b.config.RunTags, + CdcId: b.config.CdcId, }, &communicator.StepConnect{ Config: &b.config.TencentCloudRunConfig.Comm, diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index e4a45e11..3634650a 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -103,6 +103,8 @@ type TencentCloudRunConfig struct { // [`dynamic_block`](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks) // will allow you to create those programatically. RunTag config.KeyValues `mapstructure:"run_tag" required:"false"` + // Support for local dedicated cluster CDC + CdcId string `mapstructure:"cdc_id" required:"false"` // Communicator settings Comm communicator.Config `mapstructure:",squash"` diff --git a/builder/tencentcloud/cvm/step_config_subnet.go b/builder/tencentcloud/cvm/step_config_subnet.go index 085ada76..b93eeeb0 100644 --- a/builder/tencentcloud/cvm/step_config_subnet.go +++ b/builder/tencentcloud/cvm/step_config_subnet.go @@ -17,6 +17,7 @@ type stepConfigSubnet struct { SubnetName string Zone string isCreate bool + CdcId string } func (s *stepConfigSubnet) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { @@ -57,6 +58,7 @@ func (s *stepConfigSubnet) Run(ctx context.Context, state multistep.StateBag) mu req.SubnetName = &s.SubnetName req.CidrBlock = &s.SubnetCidrBlock req.Zone = &s.Zone + req.CdcId = &s.CdcId var resp *vpc.CreateSubnetResponse err := Retry(ctx, func(ctx context.Context) error { var e error diff --git a/builder/tencentcloud/cvm/step_run_instance.go b/builder/tencentcloud/cvm/step_run_instance.go index 943eabf6..774a76c3 100644 --- a/builder/tencentcloud/cvm/step_run_instance.go +++ b/builder/tencentcloud/cvm/step_run_instance.go @@ -32,6 +32,7 @@ type stepRunInstance struct { AssociatePublicIpAddress bool Tags map[string]string DataDisks []tencentCloudDataDisk + CdcId string } func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { @@ -66,9 +67,13 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul if instanceChargeType == "" { instanceChargeType = "POSTPAID_BY_HOUR" } + if s.CdcId != "" { + instanceChargeType = "CDCPAID" + } req.InstanceChargeType = &instanceChargeType req.ImageId = source_image.ImageId req.InstanceType = &s.InstanceType + req.DedicatedClusterId = &s.CdcId // TODO: Add check for system disk size, it should be larger than image system disk size. req.SystemDisk = &cvm.SystemDisk{ DiskType: &s.DiskType, @@ -157,6 +162,7 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul }, } } + Message(state, req.ToJsonString(), "[DEBUG] request data") var resp *cvm.RunInstancesResponse err = Retry(ctx, func(ctx context.Context) error { diff --git a/go.mod b/go.mod index 4004da58..b5dc20d6 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( github.com/hashicorp/hcl/v2 v2.19.1 github.com/hashicorp/packer-plugin-sdk v0.5.2 github.com/pkg/errors v0.9.1 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.799 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.799 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1072 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1072 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts v1.0.797 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.799 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1072 github.com/zclconf/go-cty v1.13.3 ) diff --git a/go.sum b/go.sum index 2d636fbc..2b448358 100644 --- a/go.sum +++ b/go.sum @@ -145,9 +145,9 @@ github.com/hashicorp/go-getter/s3/v2 v2.2.1/go.mod h1:KDqfEPgpwZIy+1sAplFX231CE+ github.com/hashicorp/go-getter/v2 v2.2.1 h1:2JXqPZs1Jej67RtdTi0YZaEB2hEFB3fkBA4cPYKQwFQ= github.com/hashicorp/go-getter/v2 v2.2.1/go.mod h1:EcJx6oZE8hmGuRR1l38QrfnyiujQbwsEAn11eHv6l2M= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -329,11 +329,15 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.797 h1:jDSf github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.797/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.799 h1:jAMelFh7c+sBrR2kzdNB2zfmkhsEXLIR9YFQcBuTnzI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.799/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1072 h1:zoo8LhsH0kC3ysBCMDmgOCVzyQKTpw7foOzNoxAXcGE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1072/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.366 h1:NJm4RjeL2btX3alWLQvyzObmlDtGC0pCFCoeqWw2Veg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.366/go.mod h1:x9QV7qu6FpnSdVyGQoirhjKsPd1dEpWnr9RL75DpgJ4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.799 h1:FnXNkHQhPX7sNvxKNYyMB6PGpbMCce6bfXkzRwGHS74= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.799/go.mod h1:bNuzbq27CiymhqONoqE1CnhK6aJJjWWcZG8J3ragVfs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1072 h1:BO6eEqw2CxeP73AnOfkq99mJAPccP+w3exmVuBDMvAc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1072/go.mod h1:Ot4h9BuqIbyOPotq8cIT3vCCMDdn6LXkc37jU2teHnQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts v1.0.797 h1:Z9rTZBoR4arEXA9gYLu8AQnMInG1scb+WnlIWczLH2A= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts v1.0.797/go.mod h1:IugQh1ZI86ZeEUBYf+u/REwTeKZcneP449FPU8BbLxA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.366 h1:7wbTvCCJ41Hx9KWO9pcmvOFWFS1A9iPs0jtQJLwe++U= @@ -342,6 +346,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.779 h1:4NpjQiF github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.779/go.mod h1:kYBG2jgpjL7CuhYM+K1fkEtbWvNXrtt7NSLwXVCqmKA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.799 h1:6M8TGTEvrLAjxaKl53RyDIktCmF8kPuL0swJeKsbR/E= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.799/go.mod h1:jq1PLPim6gB9soBqQ/H6fRAI/NYlj/Qtn8JZfOK+eWw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1072 h1:qG5L/VZcw4PC+OSMjxM1BNXlOfJ9vvDfToItgmCxfLE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1072/go.mod h1:fynFW8ciFiCFLVyIKyQKENQ6g+Tm7mXw687lFgPmU/Y= github.com/tencentcloudstack/terraform-provider-tencentcloud v1.81.47 h1:6e9miVImuKP6g2HDDyNNTGrh/UnCmgkqJ+CInE6kZ7s= github.com/tencentcloudstack/terraform-provider-tencentcloud v1.81.47/go.mod h1:YuYFm1AJbAELr9L799QJdLkZVkBaeFHokCeBG4J02Lc= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -350,12 +356,12 @@ github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1 h1:q6c//IMJug6THoqsseZ+Z/zq53HQvADPh5a66E9hb+I= github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1/go.mod h1:Rl8MvKI/yVRGN91gMEZAIf/92QtFQBSG/QFRHWQZtmo= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= From 1a9ea3656d92b70e2ba9c0ec6a7ba02e8746c1e4 Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 8 Jan 2025 10:52:39 +0800 Subject: [PATCH 3/6] fix: modify print --- builder/tencentcloud/cvm/step_run_instance.go | 1 - 1 file changed, 1 deletion(-) diff --git a/builder/tencentcloud/cvm/step_run_instance.go b/builder/tencentcloud/cvm/step_run_instance.go index 774a76c3..183d54e5 100644 --- a/builder/tencentcloud/cvm/step_run_instance.go +++ b/builder/tencentcloud/cvm/step_run_instance.go @@ -162,7 +162,6 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul }, } } - Message(state, req.ToJsonString(), "[DEBUG] request data") var resp *cvm.RunInstancesResponse err = Retry(ctx, func(ctx context.Context) error { From 4cc9db29bfe5965081d16db2eeb99fc6c2c8b80b Mon Sep 17 00:00:00 2001 From: arunma Date: Mon, 20 Jan 2025 21:03:21 +0800 Subject: [PATCH 4/6] fix: generate doc --- .web-docs/components/builder/cvm/README.md | 2 ++ builder/tencentcloud/cvm/builder.hcl2spec.go | 2 ++ .../tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.web-docs/components/builder/cvm/README.md b/.web-docs/components/builder/cvm/README.md index 227bbb61..be2299bf 100644 --- a/.web-docs/components/builder/cvm/README.md +++ b/.web-docs/components/builder/cvm/README.md @@ -180,6 +180,8 @@ a [communicator](/packer/docs/templates/legacy_json_templates/communicator) can [`dynamic_block`](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks) will allow you to create those programatically. +- `cdc_id` (string) - Support for local dedicated cluster CDC + - `ssh_private_ip` (bool) - SSH Private Ip diff --git a/builder/tencentcloud/cvm/builder.hcl2spec.go b/builder/tencentcloud/cvm/builder.hcl2spec.go index 51eadf70..13988ba1 100644 --- a/builder/tencentcloud/cvm/builder.hcl2spec.go +++ b/builder/tencentcloud/cvm/builder.hcl2spec.go @@ -62,6 +62,7 @@ type FlatConfig struct { CamRoleName *string `mapstructure:"cam_role_name" required:"false" cty:"cam_role_name" hcl:"cam_role_name"` RunTags map[string]string `mapstructure:"run_tags" required:"false" cty:"run_tags" hcl:"run_tags"` RunTag []config.FlatKeyValue `mapstructure:"run_tag" required:"false" cty:"run_tag" hcl:"run_tag"` + CdcId *string `mapstructure:"cdc_id" required:"false" cty:"cdc_id" hcl:"cdc_id"` Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` @@ -178,6 +179,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "cam_role_name": &hcldec.AttrSpec{Name: "cam_role_name", Type: cty.String, Required: false}, "run_tags": &hcldec.AttrSpec{Name: "run_tags", Type: cty.Map(cty.String), Required: false}, "run_tag": &hcldec.BlockListSpec{TypeName: "run_tag", Nested: hcldec.ObjectSpec((*config.FlatKeyValue)(nil).HCL2Spec())}, + "cdc_id": &hcldec.AttrSpec{Name: "cdc_id", Type: cty.String, Required: false}, "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, diff --git a/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx b/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx index 7d1fabb9..1e5b5f52 100644 --- a/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx +++ b/docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx @@ -74,6 +74,8 @@ [`dynamic_block`](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks) will allow you to create those programatically. +- `cdc_id` (string) - Support for local dedicated cluster CDC + - `ssh_private_ip` (bool) - SSH Private Ip From 893785b46199d146e3b9095fdabcb55031f24d2e Mon Sep 17 00:00:00 2001 From: arunma Date: Thu, 6 Feb 2025 17:58:33 +0800 Subject: [PATCH 5/6] fix: modify cdcid --- builder/tencentcloud/cvm/step_run_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/tencentcloud/cvm/step_run_instance.go b/builder/tencentcloud/cvm/step_run_instance.go index 183d54e5..df2afd03 100644 --- a/builder/tencentcloud/cvm/step_run_instance.go +++ b/builder/tencentcloud/cvm/step_run_instance.go @@ -69,11 +69,11 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul } if s.CdcId != "" { instanceChargeType = "CDCPAID" + req.DedicatedClusterId = &s.CdcId } req.InstanceChargeType = &instanceChargeType req.ImageId = source_image.ImageId req.InstanceType = &s.InstanceType - req.DedicatedClusterId = &s.CdcId // TODO: Add check for system disk size, it should be larger than image system disk size. req.SystemDisk = &cvm.SystemDisk{ DiskType: &s.DiskType, From 7c5b644efd440ca5d04af65d2146dfa9bf16ab9c Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 12 Feb 2025 16:03:55 +0800 Subject: [PATCH 6/6] fix: Optimize subnet creation --- builder/tencentcloud/cvm/step_config_subnet.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/tencentcloud/cvm/step_config_subnet.go b/builder/tencentcloud/cvm/step_config_subnet.go index b93eeeb0..855512f4 100644 --- a/builder/tencentcloud/cvm/step_config_subnet.go +++ b/builder/tencentcloud/cvm/step_config_subnet.go @@ -58,7 +58,9 @@ func (s *stepConfigSubnet) Run(ctx context.Context, state multistep.StateBag) mu req.SubnetName = &s.SubnetName req.CidrBlock = &s.SubnetCidrBlock req.Zone = &s.Zone - req.CdcId = &s.CdcId + if s.CdcId != "" { + req.CdcId = &s.CdcId + } var resp *vpc.CreateSubnetResponse err := Retry(ctx, func(ctx context.Context) error { var e error pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy