Skip to content

Commit 97127a9

Browse files
jsafranesunnylovestiramisu
authored andcommitted
Fix hyperdisk attach limits
Reserve 1 attachment for the root / OS disk when reporting nr. of attachable hyperdisks.
1 parent ad16366 commit 97127a9

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
@@ -93,9 +93,9 @@ const (
9393
volumeLimitSmall int64 = 15
9494
volumeLimitBig int64 = 127
9595
// doc https://cloud.google.com/compute/docs/memory-optimized-machines#x4_disks
96-
x4HyperdiskLimit int64 = 40
96+
x4HyperdiskLimit int64 = 39
9797
// doc https://cloud.google.com/compute/docs/accelerator-optimized-machines#a4-disks
98-
a4HyperdiskLimit int64 = 128
98+
a4HyperdiskLimit int64 = 127
9999
defaultLinuxFsType = "ext4"
100100
defaultWindowsFsType = "ntfs"
101101
fsTypeExt3 = "ext3"

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,27 +257,27 @@ func TestNodeGetVolumeLimits(t *testing.T) {
257257
{
258258
name: "c4-standard-192",
259259
machineType: "c4-standard-192",
260-
expVolumeLimit: 128,
260+
expVolumeLimit: 127,
261261
},
262262
{
263263
name: "c4-standard-48",
264264
machineType: "c4-standard-48",
265-
expVolumeLimit: 64,
265+
expVolumeLimit: 63,
266266
},
267267
{
268268
name: "c4a-standard-4",
269269
machineType: "c4a-standard-4",
270-
expVolumeLimit: 16,
270+
expVolumeLimit: 15,
271271
},
272272
{
273273
name: "n4-standard-16",
274274
machineType: "n4-standard-16",
275-
expVolumeLimit: 32,
275+
expVolumeLimit: 31,
276276
},
277277
{
278278
name: "n4-highcpu-4",
279279
machineType: "n4-highcpu-4",
280-
expVolumeLimit: 16,
280+
expVolumeLimit: 15,
281281
},
282282
{
283283
name: "invalid gen4 machine type",

0 commit comments

Comments
 (0)