fix(region): set sku maxmem size 1024G

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
wanyaoqi
2023-05-10 10:33:45 +08:00
parent 444db7e42e
commit bed7b7483c
2 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -313,12 +313,12 @@ func (self *SServerSkuManager) ValidateCreateData(ctx context.Context, userCred
region, _ = zone.GetRegion()
}
if input.CpuCoreCount < 1 || input.CpuCoreCount > 256 {
return input, httperrors.NewOutOfRangeError("cpu_core_count should be range of 1~256")
if input.CpuCoreCount < 1 || input.CpuCoreCount > options.Options.SkuMaxCpuCount {
return input, httperrors.NewOutOfRangeError("cpu_core_count should be range of 1~%d", options.Options.SkuMaxCpuCount)
}
if input.MemorySizeMB < 512 || input.MemorySizeMB > 1024*512 {
return input, httperrors.NewOutOfRangeError("memory_size_mb, shoud be range of 512~%d", 1024*512)
if input.MemorySizeMB < 512 || input.MemorySizeMB > 1024*options.Options.SkuMaxMemSize {
return input, httperrors.NewOutOfRangeError("memory_size_mb, shoud be range of 512~%d", 1024*options.Options.SkuMaxMemSize)
}
if len(input.InstanceTypeCategory) == 0 {
+3
View File
@@ -204,6 +204,9 @@ type ComputeOptions struct {
LocalDataDiskMinSizeGB int `help:"Data disk min size when using local storage" default:"10"`
LocalDataDiskMaxSizeGB int `help:"Data disk max size when using local storage" default:"40960"`
SkuMaxMemSize int64 `help:"Sku max memory size GB" default:"1024"`
SkuMaxCpuCount int64 `help:"Sku max cpu count" default:"256"`
esxi.EsxiOptions
}