Skip to content

csi: adjust CSI pods CPU requests on IBM Z#646

Open
malayparida2000 wants to merge 1 commit into
red-hat-storage:mainfrom
malayparida2000:ibm_z_csi_adjustment
Open

csi: adjust CSI pods CPU requests on IBM Z#646
malayparida2000 wants to merge 1 commit into
red-hat-storage:mainfrom
malayparida2000:ibm_z_csi_adjustment

Conversation

@malayparida2000

@malayparida2000 malayparida2000 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Halve default CSI controller and node plugin CPU requests when the operator runs on s390x, matching the IBM Z resource adjustment in ocs-operator. The reason for this is individual CPU cores on IBM Z are more than 2X powerful than the ones on other archs.
Ref-https://redhat.atlassian.net/browse/RHSTOR-9444

@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: malayparida2000
Once this PR has been reviewed and has the lgtm label, please assign nb-ohad for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@malayparida2000

malayparida2000 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Got it tested on a IBM Z cluster, works fine, The csi pods restarted to take the values

[root@m4204001 ~]# oc get pod
NAME                                                              READY   STATUS      RESTARTS      AGE
ceph-csi-controller-manager-7d7f9454d8-98zm5                      1/1     Running     0             35h
cnpg-controller-manager-7db6c7d99d-8thmk                          1/1     Running     0             35h
csi-addons-controller-manager-69d7d6f4-bp5qj                      1/1     Running     0             35h
noobaa-core-0                                                     2/2     Running     0             23h
noobaa-db-pg-cluster-1                                            1/1     Running     0             23h
noobaa-db-pg-cluster-2                                            1/1     Running     0             23h
noobaa-endpoint-674657c486-mchqs                                  1/1     Running     0             23h
noobaa-operator-59895477b4-grwhl                                  1/1     Running     0             35h
ocs-client-operator-console-888f56d4c-qjrxj                       1/1     Running     0             35h
ocs-client-operator-controller-manager-b468f89d7-bdffg            1/1     Running     0             2m58s
ocs-metrics-exporter-775bfc786c-6v7n6                             1/1     Running     0             23h
ocs-operator-fdc7f8df9-mdsv7                                      1/1     Running     0             45m
ocs-provider-server-84cd8f7f7f-74mp2                              1/1     Running     0             23h
odf-blackbox-exporter-6b77c57c6f-75f9k                            1/1     Running     0             23h
odf-console-6498bc56f7-4fnkw                                      1/1     Running     0             36h
odf-external-snapshotter-operator-6fbdd75675-5kzw4                1/1     Running     0             35h
odf-external-snapshotter-operator-6fbdd75675-xtdtw                1/1     Running     0             35h
odf-operator-controller-manager-744cfbddb6-npr2n                  1/1     Running     0             36h
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd   9/9     Running     0             2m5s
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv   9/9     Running     0             2m5s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-5cn4d            3/3     Running     0             92s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-bvlhw            3/3     Running     0             2m5s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon79rpn   2/2     Running     0             2m5s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon95hlf   2/2     Running     0             92s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addongcbcl   2/2     Running     0             59s
openshift-storage.cephfs.csi.ceph.com-nodeplugin-tpgmf            3/3     Running     0             59s
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs    8/8     Running     0             2m5s
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz    8/8     Running     0             2m5s
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-5pkmv    2/2     Running     0             91s
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-mvr94    2/2     Running     0             58s
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-xsg4x    2/2     Running     0             2m5s
openshift-storage.rbd.csi.ceph.com-nodeplugin-fqx26               3/3     Running     0             2m33s
openshift-storage.rbd.csi.ceph.com-nodeplugin-hr9sk               3/3     Running     0             2m36s
openshift-storage.rbd.csi.ceph.com-nodeplugin-zmmb9               3/3     Running     0             2m32s
rook-ceph-crashcollector-worker-0.m4204001.test.ocs-599d66fsdn4   1/1     Running     0             23h
rook-ceph-crashcollector-worker-1.m4204001.test.ocs-7bf685wbsn7   1/1     Running     0             23h
rook-ceph-crashcollector-worker-2.m4204001.test.ocs-754dc5dc25x   1/1     Running     0             23h
rook-ceph-exporter-worker-0.m4204001.test.ocs-5f6755f6c6-vbjkp    2/2     Running     0             23h
rook-ceph-exporter-worker-1.m4204001.test.ocs-ffd8fcc4c-bwkqf     2/2     Running     0             23h
rook-ceph-exporter-worker-2.m4204001.test.ocs-574ff85d5d-mrkdt    2/2     Running     0             23h
rook-ceph-mds-ocs-storagecluster-cephfilesystem-a-f86d74b6vsr4w   2/2     Running     0             23h
rook-ceph-mds-ocs-storagecluster-cephfilesystem-b-8f55d7494wld8   2/2     Running     0             23h
rook-ceph-mgr-a-6b688997c9-jrjf7                                  3/3     Running     0             23h
rook-ceph-mgr-b-7499b57dc4-28fr8                                  3/3     Running     0             23h
rook-ceph-mon-a-8476c94d7c-2hjv4                                  2/2     Running     0             23h
rook-ceph-mon-b-b7bdfcc77-6k8x4                                   2/2     Running     0             23h
rook-ceph-mon-c-6d5c6f5d78-r4zv4                                  2/2     Running     0             23h
rook-ceph-operator-5c6dff5f84-xlb8d                               1/1     Running     0             45m
rook-ceph-osd-0-6849fb6ccc-258qh                                  2/2     Running     0             23h
rook-ceph-osd-1-6f85486db6-j4ksj                                  2/2     Running     0             23h
rook-ceph-osd-2-7d6f79fddf-z2fdp                                  2/2     Running     0             23h
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-06bsjd665   0/1     Completed   0             23h
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-1rqb75r82   0/1     Completed   0             23h
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-26qgbp5w4   0/1     Completed   0             23h
rook-ceph-rgw-ocs-storagecluster-cephobjectstore-a-df547c5k8lfk   2/2     Running     0             23h
storageclient-737342087af10580-status-reporter-29714884-5ggvw     0/1     Completed   0             6s
ux-backend-server-5956fbcdf-tjh9g                                 2/2     Running     1 (36h ago)   36h

@malayparida2000

Copy link
Copy Markdown
Contributor Author
[root@m4204001 ~]# oc get storagecluster -o yaml | grep -i profile
    resourceProfile: balanced
    lastAppliedResourceProfile: balanced
[root@m4204001 ~]#
[root@m4204001 ~]# oc get storagecluster
NAME                 AGE     PHASE   EXTERNAL   CREATED AT             VERSION
ocs-storagecluster   8m31s   Ready              2026-07-01T08:47:35Z   4.23.0
[root@m4204001 ~]#
[root@m4204001 ~]# (   echo -e "Pod\tContainer\tCPU_Request\tCPU_Limit";   oc get pods -o json | jq -r '
    .items[] |
    .metadata.name as $pod |
    .spec.containers[] |
    [
      $pod,
      .name,
      (.resources.requests.cpu // "-"),
      (.resources.limits.cpu // "-")
    ] | @tsv
  '; ) | column -t
Pod                                                              Container                          CPU_Request  CPU_Limit
ceph-csi-controller-manager-7d7f9454d8-98zm5                     manager                            10m          500m
cluster-cleanup-job-worker-0.m4204001.test.ocs-j6wzp             host-cleanup                       -            -
cluster-cleanup-job-worker-1.m4204001.test.ocs-x6xh4             host-cleanup                       -            -
cluster-cleanup-job-worker-2.m4204001.test.ocs-mxrg7             host-cleanup                       -            -
cnpg-controller-manager-7db6c7d99d-8thmk                         manager                            100m         100m
csi-addons-controller-manager-69d7d6f4-bp5qj                     manager                            10m          1
noobaa-core-0                                                    core                               499m         999m
noobaa-core-0                                                    noobaa-log-processor               200m         200m
noobaa-db-pg-cluster-1                                           postgres                           250m         500m
noobaa-db-pg-cluster-2                                           postgres                           250m         500m
noobaa-endpoint-7db75444d5-pg6vt                                 endpoint                           499m         999m
noobaa-operator-59895477b4-grwhl                                 noobaa-operator                    100m         250m
ocs-client-operator-console-888f56d4c-qjrxj                      ocs-client-operator-console        50m          250m
ocs-client-operator-controller-manager-b468f89d7-bdffg           manager                            10m          500m
ocs-metrics-exporter-775bfc786c-lhl27                            ocs-metrics-exporter               50m          1
ocs-operator-fdc7f8df9-mdsv7                                     ocs-operator                       50m          250m
ocs-provider-server-84cd8f7f7f-dbzxc                             ocs-provider-api-server            5m           50m
odf-blackbox-exporter-6b77c57c6f-jmp7s                           odf-blackbox-exporter              50m          100m
odf-console-6498bc56f7-4fnkw                                     odf-console                        100m         100m
odf-external-snapshotter-operator-6fbdd75675-5kzw4               odf-external-snapshotter-operator  10m          100m
odf-external-snapshotter-operator-6fbdd75675-xtdtw               odf-external-snapshotter-operator  10m          100m
odf-operator-controller-manager-744cfbddb6-npr2n                 manager                            200m         200m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-cephfsplugin                   50m          1
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-provisioner                    25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-resizer                        25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-attacher                       25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-snapshotter                    25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  ex-csi-snapshotter                 25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-addons                         25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  csi-omap-generator                 25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdf5tgwd  log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-cephfsplugin                   50m          1
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-provisioner                    25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-resizer                        25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-attacher                       25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-snapshotter                    25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  ex-csi-snapshotter                 25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-addons                         25m          250m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  csi-omap-generator                 25m          500m
openshift-storage.cephfs.csi.ceph.com-ctrlplugin-59f4c7cdfbglkv  log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-5cn4d           csi-cephfsplugin                   50m          1
openshift-storage.cephfs.csi.ceph.com-nodeplugin-5cn4d           driver-registrar                   5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-5cn4d           log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-bvlhw           csi-cephfsplugin                   50m          1
openshift-storage.cephfs.csi.ceph.com-nodeplugin-bvlhw           driver-registrar                   5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-bvlhw           log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon79rpn  csi-addons                         25m          200m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon79rpn  log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon95hlf  csi-addons                         25m          200m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addon95hlf  log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addongcbcl  csi-addons                         25m          200m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-csi-addongcbcl  log-rotator                        5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-tpgmf           csi-cephfsplugin                   50m          1
openshift-storage.cephfs.csi.ceph.com-nodeplugin-tpgmf           driver-registrar                   5m           50m
openshift-storage.cephfs.csi.ceph.com-nodeplugin-tpgmf           log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-rbdplugin                      50m          1
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-provisioner                    25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-resizer                        25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-attacher                       25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-snapshotter                    25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-addons                         25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   csi-omap-generator                 25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-p2xzs   log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-rbdplugin                      50m          1
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-provisioner                    25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-resizer                        25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-attacher                       25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-snapshotter                    25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-addons                         25m          250m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   csi-omap-generator                 25m          500m
openshift-storage.rbd.csi.ceph.com-ctrlplugin-6cc4888987-vrqcz   log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-5pkmv   csi-addons                         25m          200m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-5pkmv   log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-mvr94   csi-addons                         25m          200m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-mvr94   log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-xsg4x   csi-addons                         25m          200m
openshift-storage.rbd.csi.ceph.com-nodeplugin-csi-addons-xsg4x   log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-fqx26              csi-rbdplugin                      50m          1
openshift-storage.rbd.csi.ceph.com-nodeplugin-fqx26              driver-registrar                   5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-fqx26              log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-hr9sk              csi-rbdplugin                      50m          1
openshift-storage.rbd.csi.ceph.com-nodeplugin-hr9sk              driver-registrar                   5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-hr9sk              log-rotator                        5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-zmmb9              csi-rbdplugin                      50m          1
openshift-storage.rbd.csi.ceph.com-nodeplugin-zmmb9              driver-registrar                   5m           50m
openshift-storage.rbd.csi.ceph.com-nodeplugin-zmmb9              log-rotator                        5m           50m
rook-ceph-crashcollector-worker-0.m4204001.test.ocs-599d66kzxwb  ceph-crash                         25m          100m
rook-ceph-crashcollector-worker-1.m4204001.test.ocs-7bf685t9kb9  ceph-crash                         25m          100m
rook-ceph-crashcollector-worker-2.m4204001.test.ocs-6f9854zkpz4  ceph-crash                         25m          100m
rook-ceph-exporter-worker-0.m4204001.test.ocs-5f6755f6c6-tmcb4   ceph-exporter                      25m          50m
rook-ceph-exporter-worker-0.m4204001.test.ocs-5f6755f6c6-tmcb4   log-collector                      25m          50m
rook-ceph-exporter-worker-1.m4204001.test.ocs-ffd8fcc4c-cvljz    ceph-exporter                      25m          50m
rook-ceph-exporter-worker-1.m4204001.test.ocs-ffd8fcc4c-cvljz    log-collector                      25m          50m
rook-ceph-exporter-worker-2.m4204001.test.ocs-b5dcff9fb-ljvbd    ceph-exporter                      25m          50m
rook-ceph-exporter-worker-2.m4204001.test.ocs-b5dcff9fb-ljvbd    log-collector                      25m          50m
rook-ceph-mds-ocs-storagecluster-cephfilesystem-a-554c4d69lhcfp  mds                                1            2
rook-ceph-mds-ocs-storagecluster-cephfilesystem-a-554c4d69lhcfp  log-collector                      25m          50m
rook-ceph-mds-ocs-storagecluster-cephfilesystem-b-58ddf869kv2gp  mds                                1            2
rook-ceph-mds-ocs-storagecluster-cephfilesystem-b-58ddf869kv2gp  log-collector                      25m          50m
rook-ceph-mgr-a-7f7bb4b9b9-h7gxs                                 mgr                                500m         2
rook-ceph-mgr-a-7f7bb4b9b9-h7gxs                                 watch-active                       25m          200m
rook-ceph-mgr-a-7f7bb4b9b9-h7gxs                                 log-collector                      25m          50m
rook-ceph-mgr-b-5cbd46b6f-x5j28                                  mgr                                500m         2
rook-ceph-mgr-b-5cbd46b6f-x5j28                                  watch-active                       25m          200m
rook-ceph-mgr-b-5cbd46b6f-x5j28                                  log-collector                      25m          50m
rook-ceph-mon-a-5ff8bc5f88-n9d8l                                 mon                                500m         1
rook-ceph-mon-a-5ff8bc5f88-n9d8l                                 log-collector                      25m          50m
rook-ceph-mon-b-d699bfc76-s4vjt                                  mon                                500m         1
rook-ceph-mon-b-d699bfc76-s4vjt                                  log-collector                      25m          50m
rook-ceph-mon-c-7f6bcbbd88-rbv84                                 mon                                500m         1
rook-ceph-mon-c-7f6bcbbd88-rbv84                                 log-collector                      25m          50m
rook-ceph-operator-5c6dff5f84-xlb8d                              rook-ceph-operator                 100m         1
rook-ceph-osd-0-9845f6c69-664ms                                  osd                                1            2
rook-ceph-osd-0-9845f6c69-664ms                                  log-collector                      25m          50m
rook-ceph-osd-1-54fd977859-z8bll                                 osd                                1            2
rook-ceph-osd-1-54fd977859-z8bll                                 log-collector                      25m          50m
rook-ceph-osd-2-6cd9f7f86f-xm5qz                                 osd                                1            2
rook-ceph-osd-2-6cd9f7f86f-xm5qz                                 log-collector                      25m          50m
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-0xmx27d7l  provision                          -            -
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-1jh5bl2lq  provision                          -            -
rook-ceph-osd-prepare-ocs-deviceset-localblock-0-data-2tftlgdvh  provision                          -            -
rook-ceph-rgw-ocs-storagecluster-cephobjectstore-a-56d56587jwxn  rgw                                1            2
rook-ceph-rgw-ocs-storagecluster-cephobjectstore-a-56d56587jwxn  log-collector                      25m          50m
storageclient-737342087af10580-status-reporter-29714936-h5xzc    heartbeat                          -            -
ux-backend-server-5956fbcdf-tjh9g                                ux-backend-server                  50m          250m
ux-backend-server-5956fbcdf-tjh9g                                oauth-proxy                        5m           25m
[root@m4204001 ~]#
[root@m4204001 ~]# (   oc get pods -o json | jq -r '
    .items[] |
    .spec.containers[] |
    (.resources.requests.cpu // empty)
  '; ) | awk '
  {
    if ($0 ~ /m$/) {
      sub(/m$/, "", $0)
      sum += $0
    } else {
      sum += $0 * 1000
    }
  }
  END {
    printf "Total CPU Request: %dm (%.2f CPUs)\n", sum, sum/1000
  }
'
Total CPU Request: 13068m (13.07 CPUs)
[root@m4204001 ~]#

@leelavg leelavg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Madhu-1 fyi.

}
templates.CSIOperatorConfigSpec.DeepCopyInto(&csiOperatorConfig.Spec)
driverSpecDefaults := csiOperatorConfig.Spec.DriverSpecDefaults
if goruntime.GOARCH == ibmZCpuArch {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not goruntime.Is390x == 1 rather than using names?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find any variable or func of the type goruntime.Is390x / goruntime.IsS390x
Only GOARCH & GOOS are availble https://pkg.go.dev/runtime#pkg-constants

templates.CSIOperatorConfigSpec.DeepCopyInto(&csiOperatorConfig.Spec)
driverSpecDefaults := csiOperatorConfig.Spec.DriverSpecDefaults
if goruntime.GOARCH == ibmZCpuArch {
adjustControllerPluginCpuResourcesForIbmZ(&driverSpecDefaults.ControllerPlugin.Resources, ibmZCpuAdjustFactor)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
adjustControllerPluginCpuResourcesForIbmZ(&driverSpecDefaults.ControllerPlugin.Resources, ibmZCpuAdjustFactor)
adjustControllerPluginCpuRequestsForIbmZ(&driverSpecDefaults.ControllerPlugin.Resources, ibmZCpuAdjustFactor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally did not mention Request in the name, so that in future if required the same func can be expanded to adjust limits as well

driverSpecDefaults := csiOperatorConfig.Spec.DriverSpecDefaults
if goruntime.GOARCH == ibmZCpuArch {
adjustControllerPluginCpuResourcesForIbmZ(&driverSpecDefaults.ControllerPlugin.Resources, ibmZCpuAdjustFactor)
adjustNodePluginCpuResourcesForIbmZ(&driverSpecDefaults.NodePlugin.Resources, ibmZCpuAdjustFactor)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
adjustNodePluginCpuResourcesForIbmZ(&driverSpecDefaults.NodePlugin.Resources, ibmZCpuAdjustFactor)
adjustNodePluginCpuRequestsForIbmZ(&driverSpecDefaults.NodePlugin.Resources, ibmZCpuAdjustFactor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally did not mention Request in the name, so that in future if required the same func can be expanded to adjust limits as well

Comment on lines +1429 to +1447
func adjustControllerPluginCpuResourcesForIbmZ(resources *csiopv1.ControllerPluginResourcesSpec, adjustFactor float64) {
adjustCpuResourcesForIbmZ(resources.Attacher, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Snapshotter, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Resizer, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Provisioner, adjustFactor)
adjustCpuResourcesForIbmZ(resources.OMapGenerator, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Liveness, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Addons, adjustFactor)
adjustCpuResourcesForIbmZ(resources.LogRotator, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Plugin, adjustFactor)
}

func adjustNodePluginCpuResourcesForIbmZ(resources *csiopv1.NodePluginResourcesSpec, adjustFactor float64) {
adjustCpuResourcesForIbmZ(resources.Registrar, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Liveness, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Addons, adjustFactor)
adjustCpuResourcesForIbmZ(resources.LogRotator, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Plugin, adjustFactor)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the adjust factor is same why not go over all the resources and set the values rather than picking each resource/sidecar because it creates a requirement to update things in two places when there is a new container. tnf also should've been like that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, going over the list would be a better approach so that we cover any new containers if they come up in future

Comment thread pkg/utils/k8sutils.go Outdated
}

func AdjustCPU(cpuQty resource.Quantity, adjustFactor float64) resource.Quantity {
str := strconv.FormatInt(int64(float64(cpuQty.MilliValue())*adjustFactor), 10) + "m"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many conversions i guess, took a quick look at the lib, could you try resource.NewMilliQuantity(cpuQty.MilliValue() / 2, resource.DecimalSI)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you still require the conversions? you changed the value to milli and adjust factor leaves a reminder between 0 to that num (2 = 1, 9 = 8) and float to int anyways would curtail it making it redundant, am I missing something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leelavg Did not get you, Are you asking about the float64 conv or the int64 conv

adjustCpuResourcesForIbmZ(resources.Resizer, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Provisioner, adjustFactor)
adjustCpuResourcesForIbmZ(resources.OMapGenerator, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Liveness, adjustFactor)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont have this anymore should be removed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not used in downstream we can remove it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now switched to iterate over the struct


func adjustNodePluginCpuResourcesForIbmZ(resources *csiopv1.NodePluginResourcesSpec, adjustFactor float64) {
adjustCpuResourcesForIbmZ(resources.Registrar, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Liveness, adjustFactor)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func adjustControllerPluginCpuResourcesForIbmZ(resources *csiopv1.ControllerPluginResourcesSpec, adjustFactor float64) {
adjustCpuResourcesForIbmZ(resources.Attacher, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Snapshotter, adjustFactor)
adjustCpuResourcesForIbmZ(resources.Resizer, adjustFactor)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there is two more containers missing or two more related to odf snapshotter and snapshotter metadata

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odf-snapshotter uses the internal snapshotter and the metadata sidecar doesnt have the resource and limits set.

Halve default CSI controller and node plugin CPU requests when the
operator runs on s390x, matching the IBM Z resource adjustment in
ocs-operator. The reason for this is individual CPU cores on IBM Z
are more than 2X powerful than the ones on other archs.

Signed-off-by: Malay Kumar Parida <mparida@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants