diff --git a/pkg/common/constants.go b/pkg/common/constants.go index 2ab74b778..94c7f5a67 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -67,10 +67,10 @@ var Gen4MachineHyperdiskAttachLimitMap = []struct { max int64 value int64 }{ - {max: 4, value: 16}, - {max: 8, value: 24}, - {max: 16, value: 32}, - {max: 32, value: 48}, - {max: 64, value: 64}, - {max: 1024, value: 128}, + {max: 4, value: 15}, + {max: 8, value: 23}, + {max: 16, value: 31}, + {max: 32, value: 49}, + {max: 64, value: 63}, + {max: 1024, value: 127}, } diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index c1fd96e3c..3194c4785 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -99,9 +99,9 @@ const ( volumeLimitSmall int64 = 15 volumeLimitBig int64 = 127 // doc https://cloud.google.com/compute/docs/memory-optimized-machines#x4_disks - x4HyperdiskLimit int64 = 40 + x4HyperdiskLimit int64 = 39 // doc https://cloud.google.com/compute/docs/accelerator-optimized-machines#a4-disks - a4HyperdiskLimit int64 = 128 + a4HyperdiskLimit int64 = 127 defaultLinuxFsType = "ext4" defaultWindowsFsType = "ntfs" fsTypeExt3 = "ext3" diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 2de924470..63add2b08 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -271,27 +271,27 @@ func TestNodeGetVolumeLimits(t *testing.T) { { name: "c4-standard-192", machineType: "c4-standard-192", - expVolumeLimit: 128, + expVolumeLimit: 127, }, { name: "c4-standard-48", machineType: "c4-standard-48", - expVolumeLimit: 64, + expVolumeLimit: 63, }, { name: "c4a-standard-4", machineType: "c4a-standard-4", - expVolumeLimit: 16, + expVolumeLimit: 15, }, { name: "n4-standard-16", machineType: "n4-standard-16", - expVolumeLimit: 32, + expVolumeLimit: 31, }, { name: "n4-highcpu-4", machineType: "n4-highcpu-4", - expVolumeLimit: 16, + expVolumeLimit: 15, }, { name: "invalid gen4 machine type",