diff --git a/pkg/compute/models/guests.go b/pkg/compute/models/guests.go index c8ce37e71b..791d8195a7 100644 --- a/pkg/compute/models/guests.go +++ b/pkg/compute/models/guests.go @@ -4292,8 +4292,11 @@ func (self *SGuest) SaveDeployInfo(ctx context.Context, userCred mcclient.TokenC driver := self.GetDriver() if len(deployInfo.Account) > 0 { info["login_account"] = deployInfo.Account - if len(deployInfo.Key) > 0 && driver.IsSupportdDcryptPasswordFromSecretKey() { + if len(deployInfo.Key) > 0 { info["login_key"] = deployInfo.Key + if len(self.KeypairId) > 0 && !driver.IsSupportdDcryptPasswordFromSecretKey() { // Tencent Cloud does not support simultaneous setting of secret keys and passwords + info["login_key"], _ = seclib2.EncryptBase64(self.GetKeypairPublicKey(), "") + } info["login_key_timestamp"] = timeutils.UtcNow() } else { info["login_key"] = "none"