in compute/instances/custom-machine-type/helperClass.js [41:122]
constructor(zone, cpuSeries, coreCount, memory) {
this.zone = zone;
this.cpuSeries = cpuSeries;
this.coreCount = coreCount;
this.memory = memory;
this.N1 = 'custom';
this.N2 = 'n2-custom';
this.N2D = 'n2d-custom';
this.E2 = 'e2-custom';
this.E2Micro = 'e2-custom-micro';
this.E2Small = 'e2-custom-small';
this.E2Medium = 'e2-custom-medium';
this.CpuSeriesE2Limit = {
allowedCores: range(2, 33, 2),
minMemPerCore: 512,
maxMemPerCore: 8192,
allowExtraMemory: false,
extraMemoryLimit: 0,
};
this.CpuSeriesE2MicroLimit = {
allowedCores: [],
minMemPerCore: 1024,
maxMemPerCore: 2048,
allowExtraMemory: false,
extraMemoryLimit: 0,
};
this.CpuSeriesE2SmallLimit = {
allowedCores: [],
minMemPerCore: 2048,
maxMemPerCore: 4096,
allowExtraMemory: false,
extraMemoryLimit: 0,
};
this.CpuSeriesE2MediumLimit = {
allowedCores: [],
minMemPerCore: 4096,
maxMemPerCore: 8192,
allowExtraMemory: false,
extraMemoryLimit: 0,
};
this.CpuSeriesN2Limit = {
allowedCores: [...range(2, 33, 2), ...range(36, 129, 4)],
minMemPerCore: 512,
maxMemPerCore: 8192,
allowExtraMemory: true,
extraMemoryLimit: 624 << 10,
};
this.CpuSeriesN2DLimit = {
allowedCores: [2, 4, 8, 16, 32, 48, 64, 80, 96],
minMemPerCore: 512,
maxMemPerCore: 8192,
allowExtraMemory: true,
extraMemoryLimit: 768 << 10,
};
this.CpuSeriesN1Limit = {
allowedCores: [1, range(2, 97, 2)],
minMemPerCore: 922,
maxMemPerCore: 6656,
allowExtraMemory: true,
extraMemoryLimit: 624 << 10,
};
this.TYPE_LIMITS = {
[this.N1]: this.CpuSeriesN1Limit,
[this.N2]: this.CpuSeriesN2Limit,
[this.N2D]: this.CpuSeriesN2DLimit,
[this.E2]: this.CpuSeriesE2Limit,
[this.E2Micro]: this.CpuSeriesE2MicroLimit,
[this.E2Small]: this.CpuSeriesE2SmallLimit,
[this.E2Medium]: this.CpuSeriesE2MediumLimit,
};
this.typeLimit = this.TYPE_LIMITS[this.cpuSeries];
}