fix(region): keep cloudpods vm empty password (#21758)

This commit is contained in:
屈轩
2024-12-06 18:09:51 +08:00
committed by GitHub
parent 96b4432a81
commit a894da86e7
+5 -1
View File
@@ -497,13 +497,17 @@ func (self *SRegion) CreateInstance(hostId, hypervisor string, opts *cloudprovid
input := api.ServerCreateInput{
ServerConfigs: &api.ServerConfigs{},
}
input.Name = opts.Name
input.GenerateName = opts.Name
input.Hostname = opts.Hostname
input.Description = opts.Description
input.InstanceType = opts.InstanceType
input.VcpuCount = opts.Cpu
input.VmemSize = opts.MemoryMB
input.Password = opts.Password
if len(input.Password) == 0 {
resetPasswd := false
input.ResetPassword = &resetPasswd
}
input.PublicIpBw = opts.PublicIpBw
input.PublicIpChargeType = string(opts.PublicIpChargeType)
input.ProjectId = opts.ProjectId