Skip to content

Commit a5f1354

Browse files
jsafranek8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
Fix hyperdisk attach limits
Reserve 1 attachment for the root / OS disk when reporting nr. of attachable hyperdisks.
1 parent 3e284a2 commit a5f1354

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

pkg/common/constants.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ var Gen4MachineHyperdiskAttachLimitMap = []struct {
3939
max int64
4040
value int64
4141
}{
42-
{max: 4, value: 16},
43-
{max: 8, value: 24},
44-
{max: 16, value: 32},
45-
{max: 32, value: 48},
46-
{max: 64, value: 64},
47-
{max: 1024, value: 128},
42+
{max: 4, value: 15},
43+
{max: 8, value: 23},
44+
{max: 16, value: 31},
45+
{max: 32, value: 49},
46+
{max: 64, value: 63},
47+
{max: 1024, value: 127},
4848
}

pkg/gce-pd-csi-driver/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ const (
7474
volumeLimitSmall int64 = 15
7575
volumeLimitBig int64 = 127
7676
// doc https://cloud.google.com/compute/docs/memory-optimized-machines#x4_disks
77-
x4HyperdiskLimit int64 = 40
77+
x4HyperdiskLimit int64 = 39
7878
// doc https://cloud.google.com/compute/docs/accelerator-optimized-machines#a4-disks
79-
a4HyperdiskLimit int64 = 128
79+
a4HyperdiskLimit int64 = 127
8080
defaultLinuxFsType = "ext4"
8181
defaultWindowsFsType = "ntfs"
8282
fsTypeExt3 = "ext3"

pkg/gce-pd-csi-driver/node_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,27 +239,27 @@ func TestNodeGetVolumeLimits(t *testing.T) {
239239
{
240240
name: "c4-standard-192",
241241
machineType: "c4-standard-192",
242-
expVolumeLimit: 128,
242+
expVolumeLimit: 127,
243243
},
244244
{
245245
name: "c4-standard-48",
246246
machineType: "c4-standard-48",
247-
expVolumeLimit: 64,
247+
expVolumeLimit: 63,
248248
},
249249
{
250250
name: "c4a-standard-4",
251251
machineType: "c4a-standard-4",
252-
expVolumeLimit: 16,
252+
expVolumeLimit: 15,
253253
},
254254
{
255255
name: "n4-standard-16",
256256
machineType: "n4-standard-16",
257-
expVolumeLimit: 32,
257+
expVolumeLimit: 31,
258258
},
259259
{
260260
name: "n4-highcpu-4",
261261
machineType: "n4-highcpu-4",
262-
expVolumeLimit: 16,
262+
expVolumeLimit: 15,
263263
},
264264
{
265265
name: "invalid gen4 machine type",

0 commit comments

Comments
 (0)