# Happy Path for ODF Resource Profiles ## SetUp ![Screenshot 2023-12-05 at 3.35.51 PM](https://hackmd.io/_uploads/rJ6vwu3ST.png) In the storagesystem creation wizard, find the drop down to choose the resource profile. By default balanced is selected. Wait for the storagecluster to become ready ## Testing Change of Profile On the data foundation tab in the storage section, go to the kebab menu on the storagesystem. Their change the profile. ### Change the profile to higher(balanced-->performance) ![Screenshot 2023-12-05 at 3.48.58 PM](https://hackmd.io/_uploads/BJ8BFdhHp.png) ![Screenshot 2023-12-05 at 3.49.25 PM](https://hackmd.io/_uploads/HyeIYdnrp.png) #### New Resource Profile is being applied Storagecluster will be in progressing state, The conditions will show "New resource profile is being applied" ![Screenshot 2023-12-05 at 3.50.57 PM](https://hackmd.io/_uploads/Hyo9YdnH6.png) #### Resource Profile successfully applied, storagecluster is ready again ![Screenshot 2023-12-05 at 4.15.38 PM](https://hackmd.io/_uploads/HJuPyYhH6.png) #### Check the new pods with the new resource profile label ![Screenshot 2023-12-05 at 4.18.11 PM](https://hackmd.io/_uploads/SyplltnrT.png) ### Change the profile to lower(performance-->lean) ![Screenshot 2023-12-05 at 4.20.00 PM](https://hackmd.io/_uploads/B1KwlYhra.png) #### Resource Profile is being applied ![Screenshot 2023-12-05 at 4.20.57 PM](https://hackmd.io/_uploads/BkRTgKhrp.png) #### Resource Profile applied, Storagecluster is ready again ![Screenshot 2023-12-05 at 4.26.34 PM](https://hackmd.io/_uploads/Hyi-MK3H6.png) #### Check the new pods with the new resource profile label ![Screenshot 2023-12-05 at 4.27.38 PM](https://hackmd.io/_uploads/r174MKnH6.png) ## Test Resource Profile Change Failed ### Reaching resource profile change failed state #### Create high consumption pods on each node so that it consumes majority amount of the resources on the cluster, so that when resource profile is changed to performance there isn't enough for all the pods, So we can see the profile change failed behaviour. ``` cat <<EOF | oc create -f - apiVersion: v1 kind: Pod metadata: name: test-pod-1 spec: priorityClassName: system-node-critical nodeSelector: topology.kubernetes.io/zone: us-east-1a containers: - name: nginx-container image: nginx ports: - containerPort: 80 resources: limits: cpu: '1' memory: 40Gi requests: cpu: '1' memory: 40Gi EOF ``` ``` cat <<EOF | oc create -f - apiVersion: v1 kind: Pod metadata: name: test-pod-2 spec: priorityClassName: system-node-critical nodeSelector: topology.kubernetes.io/zone: us-east-1b containers: - name: nginx-container image: nginx ports: - containerPort: 80 resources: limits: cpu: '1' memory: 40Gi requests: cpu: '1' memory: 40Gi EOF ``` ``` cat <<EOF | oc create -f - apiVersion: v1 kind: Pod metadata: name: test-pod-3 spec: priorityClassName: system-node-critical nodeSelector: topology.kubernetes.io/zone: us-east-1c containers: - name: nginx-container image: nginx ports: - containerPort: 80 resources: limits: cpu: '1' memory: 40Gi requests: cpu: '1' memory: 40Gi EOF ``` ![Screenshot 2023-12-05 at 5.38.32 PM](https://hackmd.io/_uploads/HyQRGc3Sa.png) #### Now change the profile to performance mode #### Resource Profile is being applied ![Screenshot 2023-12-05 at 5.00.18 PM](https://hackmd.io/_uploads/ryJJ9F2ST.png) #### Resource Profile change failed After some time, When pods go into pending, the storagecluster will be in error state. The conditions will say "New resource profile failed to apply, please revert to the last working profile" ![Screenshot 2023-12-05 at 6.18.32 PM](https://hackmd.io/_uploads/BkGNh93rT.png) #### Check the pods ![Screenshot 2023-12-05 at 6.19.17 PM](https://hackmd.io/_uploads/S1RIhq3Sp.png) ### Recovery from Resource profile change failed #### Change the resource profile to the last working one As we were lean profile we will revert to that, the last working profile can be found from sc.status.lastAppliedResourceProfile in the storagecluster CR. As we were on lean profile change to that. #### Wait for the resource profile to get applied #### Now the storagecluster is ready ![Screenshot 2023-12-05 at 7.12.04 PM](https://hackmd.io/_uploads/r1HxKo2Sp.png)