fix: vmware change config with cpu sockets (#19375)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2024-01-31 15:04:47 +08:00
committed by GitHub
co-authored by Qiu Jian
parent cd45fd7e6b
commit c7c6477798
2 changed files with 5 additions and 2 deletions
+1 -2
View File
@@ -782,8 +782,7 @@ type ServerChangeConfigInput struct {
// cpu卡槽数
// vmware 若开机调整配置时,需要保证调整前及调整后 vcpu_count / cpu_sockets 保持不变
// vmware开机调整配置同样需要注意 https://kb.vmware.com/s/article/2008405
// swagger: ignore
// CpuSockets *int `json:"cpu_sockets"`
CpuSockets *int `json:"cpu_sockets"`
// cpu大小
VcpuCount *int `json:"vcpu_count"`
+4
View File
@@ -869,6 +869,10 @@ func (esxi *SESXiGuestDriver) ValidateGuestChangeConfigInput(ctx context.Context
return nil, errors.Wrap(err, "SBaseGuestDriver.ValidateGuestChangeConfigInput")
}
if input.CpuSockets != nil && *input.CpuSockets > 0 {
confs.CpuSockets = *input.CpuSockets
}
defaultStorageId := ""
if root, _ := guest.GetSystemDisk(); root != nil {
defaultStorageId = root.StorageId