From d8a2a71d53e6a67b598e6a45dfb99b5f98634201 Mon Sep 17 00:00:00 2001 From: mikatong Date: Wed, 21 May 2025 11:22:33 +0800 Subject: [PATCH 1/2] support concurrent --- builder/tencentcloud/cvm/run_config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index d7cc171..2a359e3 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -116,7 +116,8 @@ var ValidCBSType = []string{ } func (cf *TencentCloudRunConfig) Prepare(ctx *interpolate.Context) []error { - packerId := fmt.Sprintf("packer_%s", uuid.TimeOrderedUUID()[:8]) + uuid := uuid.TimeOrderedUUID() + packerId := fmt.Sprintf("packer_%s_%s", uuid[:8], uuid[9:13]) if cf.Comm.SSHKeyPairName == "" && cf.Comm.SSHTemporaryKeyPairName == "" && cf.Comm.SSHPrivateKeyFile == "" && cf.Comm.SSHPassword == "" && cf.Comm.WinRMPassword == "" { //tencentcloud support key pair name length max to 25 From 43985923ec22069486334915feda83609ec6f3d0 Mon Sep 17 00:00:00 2001 From: mikatong Date: Wed, 21 May 2025 11:33:04 +0800 Subject: [PATCH 2/2] update --- builder/tencentcloud/cvm/run_config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index 2a359e3..82df220 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -116,8 +116,8 @@ var ValidCBSType = []string{ } func (cf *TencentCloudRunConfig) Prepare(ctx *interpolate.Context) []error { - uuid := uuid.TimeOrderedUUID() - packerId := fmt.Sprintf("packer_%s_%s", uuid[:8], uuid[9:13]) + timeOrderedUUID := uuid.TimeOrderedUUID() + packerId := fmt.Sprintf("packer_%s_%s", timeOrderedUUID[:8], timeOrderedUUID[9:13]) if cf.Comm.SSHKeyPairName == "" && cf.Comm.SSHTemporaryKeyPairName == "" && cf.Comm.SSHPrivateKeyFile == "" && cf.Comm.SSHPassword == "" && cf.Comm.WinRMPassword == "" { //tencentcloud support key pair name length max to 25