Bug 2060720

Summary: Do not run `blkdiscard` block mode pvc as part of reclaim space operation
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Rakshith <rar>
Component: csi-driverAssignee: Rakshith <rar>
Status: CLOSED CURRENTRELEASE QA Contact: kmanohar
Severity: high Docs Contact:
Priority: urgent    
Version: 4.10CC: kramdoss, madam, muagarwa, ocs-bugs, odf-bz-bot, rperiyas
Target Milestone: ---   
Target Release: ODF 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.10.0-184 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-21 09:12:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 4 kmanohar 2022-03-14 11:50:02 UTC
Verification comments :

PVC yaml

[kmanohar@kmanohar auth]$ oc get pvc block-pvc -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
    volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
  creationTimestamp: "2022-03-14T10:14:53Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: block-pvc
  namespace: block-storage
  resourceVersion: "65532"
  uid: 6bf3287d-8b2c-45a4-aa93-c514d2f354c6
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Gi
  storageClassName: ocs-storagecluster-ceph-rbd
  volumeMode: Block
  volumeName: pvc-6bf3287d-8b2c-45a4-aa93-c514d2f354c6
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 100Gi
  phase: Bound

_____________________________________________________________

Pod yaml

[kmanohar@kmanohar auth]$ oc get pod test-pod -o yaml
apiVersion: v1
kind: Pod
metadata:
  annotations:
    k8s.v1.cni.cncf.io/network-status: |-
      [{
          "name": "openshift-sdn",
          "interface": "eth0",
          "ips": [
              "10.128.2.35"
          ],
          "default": true,
          "dns": {}
      }]
    k8s.v1.cni.cncf.io/networks-status: |-
      [{
          "name": "openshift-sdn",
          "interface": "eth0",
          "ips": [
              "10.128.2.35"
          ],
          "default": true,
          "dns": {}
      }]
    openshift.io/scc: privileged
  creationTimestamp: "2022-03-14T10:17:13Z"
  name: test-pod
  namespace: block-storage
  resourceVersion: "67406"
  uid: d2c49ece-2e3d-4724-9b23-68a457e19881
spec:
  containers:
  - image: quay.io/ocsci/nginx:latest
    imagePullPolicy: IfNotPresent
    name: my-container
    resources: {}
    securityContext:
      capabilities:
        add:
        - SYS_ADMIN
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeDevices:
    - devicePath: /dev/rbdblock
      name: my-volume
    volumeMounts:
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-d6m5b
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  imagePullSecrets:
  - name: default-dockercfg-fsnbs
  nodeName: compute-2
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: default
  serviceAccountName: default
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
  volumes:
  - name: my-volume
    persistentVolumeClaim:
      claimName: block-pvc
  - name: kube-api-access-d6m5b
    projected:
      defaultMode: 420
      sources:
      - serviceAccountToken:
          expirationSeconds: 3607
          path: token
      - configMap:
          items:
          - key: ca.crt
            path: ca.crt
          name: kube-root-ca.crt
      - downwardAPI:
          items:
          - fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
            path: namespace
      - configMap:
          items:
          - key: service-ca.crt
            path: service-ca.crt
          name: openshift-service-ca.crt
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2022-03-14T10:17:13Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2022-03-14T10:17:29Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2022-03-14T10:17:29Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2022-03-14T10:17:13Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: cri-o://0669b0c4b9b3c85529fe2204821eab2abd4c0fe896a6a70d5f3eea7b5bf5f19a
    image: quay.io/ocsci/nginx:latest
    imageID: quay.io/ocsci/nginx@sha256:34f3f875e745861ff8a37552ed7eb4b673544d2c56c7cc58f9a9bec5b4b3530e
    lastState: {}
    name: my-container
    ready: true
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2022-03-14T10:17:28Z"
  hostIP: 10.1.160.73
  phase: Running
  podIP: 10.128.2.35
  podIPs:
  - ip: 10.128.2.35
  qosClass: BestEffort
  startTime: "2022-03-14T10:17:13Z"
[kmanohar@kmanohar auth]$ 

___________________________________________________________________

Reclaim space yaml

[kmanohar@kmanohar auth]$ oc get reclaimspacejob test-rs-blk -o yaml
apiVersion: csiaddons.openshift.io/v1alpha1
kind: ReclaimSpaceJob
metadata:
  creationTimestamp: "2022-03-14T11:38:03Z"
  generation: 1
  name: test-rs-blk
  namespace: block-storage
  resourceVersion: "121320"
  uid: e209bda6-d695-44a8-8259-ac898a0b2c1c
spec:
  backOffLimit: 10
  retryDeadlineSeconds: 900
  target:
    persistentVolumeClaim: block-pvc
status:
  completionTime: "2022-03-14T11:38:16Z"
  message: Reclaim Space operation successfully completed.
  result: Succeeded
  startTime: "2022-03-14T11:38:03Z"

___________________________________________________________________


Memory consumption Output:

sh-4.4$ 
0a-0a580a800212-p ocs-storagecluster-cephblockpool csi-vol-976e5d7e-a37f-11ec-98 
warning: fast-diff map is not enabled for csi-vol-976e5d7e-a37f-11ec-980a-0a580a800212. operation may be slow.
NAME                                          PROVISIONED  USED  
csi-vol-976e5d7e-a37f-11ec-980a-0a580a800212      100 GiB  39 GiB

Memory remains intact