2.2. Replacing storage nodes on IBM Z or IBM® LinuxONE infrastructure
You can choose one of the following procedures to replace storage nodes:
Use this procedure to replace an operational node on IBM Z or IBM® LinuxONE infrastructure.
Procedure
Identify the node and get labels on the node to be replaced. Make a note of the rack label.
$ oc get nodes --show-labels | grep <node_name>Identify the mon (if any) and object storage device (OSD) pods that are running in the node to be replaced.
$ oc get pods -n openshift-storage -o wide | grep -i <node_name>Scale down the deployments of the pods identified in the previous step.
For example:
$ oc scale deployment rook-ceph-mon-c --replicas=0 -n openshift-storage $ oc scale deployment rook-ceph-osd-0 --replicas=0 -n openshift-storage $ oc scale deployment --selector=app=rook-ceph-crashcollector,node_name=<node_name> --replicas=0 -n openshift-storageMark the nodes as unschedulable.
$ oc adm cordon <node_name>Remove the pods which are in the
Terminatingstate.$ oc get pods -A -o wide | grep -i <node_name> | awk '{if ($4 == "Terminating") system ("oc -n " $1 " delete pods " $2 " --grace-period=0 " " --force ")}'Drain the node.
$ oc adm drain <node_name> --force --delete-emptydir-data=true --ignore-daemonsetsDelete the node.
$ oc delete node <node_name>- Get a new IBM Z storage node as a replacement.
Check for certificate signing requests (CSRs) related to OpenShift Data Foundation that are in
Pendingstate:$ oc get csrApprove all required OpenShift Data Foundation CSRs for the new node:
$ oc adm certificate approve <Certificate_Name>-
Click Compute
Nodes in OpenShift Web Console, confirm if the new node is in Ready state. Apply the
openshift-storagelabel to the new node using any one of the following:- From User interface
-
For the new node, click Action Menu (⋮)
Edit Labels -
Add
cluster.ocs.openshift.io/openshift-storageand click Save.
-
For the new node, click Action Menu (⋮)
- From Command line interface
- Execute the following command to apply the OpenShift Data Foundation label to the new node:
$ oc label node <new_node_name> cluster.ocs.openshift.io/openshift-storage=""
Add a new worker node to
localVolumeDiscoveryandlocalVolumeSet.Update the
localVolumeDiscoverydefinition to include the new node and remove the failed node.# oc edit -n local-storage-project localvolumediscovery auto-discover-devices [...] nodeSelector: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - server1.example.com - server2.example.com #- server3.example.com - newnode.example.com [...]Remember to save before exiting the editor.
In the above example,
server3.example.comwas removed andnewnode.example.comis the new node.Determine which
localVolumeSetto edit.Replace local-storage-project in the following commands with the name of your local storage project. The default project name is
openshift-local-storagein OpenShift Data Foundation 4.6 and later. Previous versions uselocal-storageby default.# oc get -n local-storage-project localvolumeset NAME AGE localblock 25hUpdate the
localVolumeSetdefinition to include the new node and remove the failed node.# oc edit -n local-storage-project localvolumeset localblock [...] nodeSelector: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - server1.example.com - server2.example.com #- server3.example.com - newnode.example.com [...]Remember to save before exiting the editor.
In the above example,
server3.example.comwas removed andnewnode.example.comis the new node.
Verify that the new
localblockPV is available.$ oc get pv | grep localblock CAPA- ACCESS RECLAIM STORAGE NAME CITY MODES POLICY STATUS CLAIM CLASS AGE local-pv- 931Gi RWO Delete Bound openshift-storage/ localblock 25h 3e8964d3 ocs-deviceset-2-0 -79j94 local-pv- 931Gi RWO Delete Bound openshift-storage/ localblock 25h 414755e0 ocs-deviceset-1-0 -959rp local-pv- 931Gi RWO Delete Available localblock 3m24s b481410 local-pv- 931Gi RWO Delete Bound openshift-storage/ localblock 25h d9c5cbd6 ocs-deviceset-0-0 -nvs68Change to the
openshift-storageproject.$ oc project openshift-storageRemove the failed OSD from the cluster. You can specify multiple failed OSDs if required.
Identify the PVC as afterwards we need to delete PV associated with that specific PVC.
$ osd_id_to_remove=1 $ oc get -n openshift-storage -o yaml deployment rook-ceph-osd-${osd_id_to_remove} | grep ceph.rook.io/pvcwhere,
osd_id_to_removeis the integer in the pod name immediately after therook-ceph-osd prefix. In this example, the deployment name isrook-ceph-osd-1.Example output:
ceph.rook.io/pvc: ocs-deviceset-localblock-0-data-0-g2mmc ceph.rook.io/pvc: ocs-deviceset-localblock-0-data-0-g2mmcIn this example, the PVC name is
ocs-deviceset-localblock-0-data-0-g2mmc.Remove the failed OSD from the cluster.
$ oc process -n openshift-storage ocs-osd-removal -p FAILED_OSD_IDS=${osd_id_to_remove} |oc create -f -You can remove more than one OSD by adding comma separated OSD IDs in the command. (For example: FAILED_OSD_IDS=0,1,2)
警告This step results in OSD being completely removed from the cluster. Ensure that the correct value of
osd_id_to_removeis provided.
Verify that the OSD was removed successfully by checking the status of the
ocs-osd-removalpod.A status of
Completedconfirms that the OSD removal job succeeded.# oc get pod -l job-name=ocs-osd-removal-osd_id_to_remove -n openshift-storage注意If
ocs-osd-removalfails and the pod is not in the expectedCompletedstate, check the pod logs for further debugging. For example:# oc logs -l job-name=ocs-osd-removal-osd_id_to_remove -n openshift-storage --tail=-1It may be necessary to manually cleanup the removed OSD as follows:
ceph osd crush remove osd.osd_id_to_remove ceph osd rm osd_id_to_remove ceph auth del osd.osd_id_to_remove ceph osd crush rm osd_id_to_removeDelete the PV associated with the failed node.
Identify the PV associated with the PVC.
The PVC name must be identical to the name that is obtained while removing the failed OSD from the cluster.
# oc get pv -L kubernetes.io/hostname | grep localblock | grep Released local-pv-5c9b8982 500Gi RWO Delete Released openshift-storage/ocs-deviceset-localblock-0-data-0-g2mmc localblock 24h worker-0If there is a PV in
Releasedstate, delete it.# oc delete pv <persistent-volume>For example:
# oc delete pv local-pv-5c9b8982 persistentvolume "local-pv-5c9b8982" deleted
Identify the
crashcollectorpod deployment.$ oc get deployment --selector=app=rook-ceph-crashcollector,node_name=<failed_node_name> -n openshift-storageIf there is an existing
crashcollectorpod deployment, delete it.$ oc delete deployment --selector=app=rook-ceph-crashcollector,node_name=<failed_node_name> -n openshift-storageDelete the
ocs-osd-removaljob.# oc delete job ocs-osd-removal-${osd_id_to_remove}Example output:
job.batch "ocs-osd-removal-0" deleted
Verification steps
Verify that the new node is present in the output:
$ oc get nodes --show-labels | grep cluster.ocs.openshift.io/openshift-storage= |cut -d' ' -f1Click Workloads
Pods. Confirm that at least the following pods on the new node are in Running state: -
csi-cephfsplugin-* -
csi-rbdplugin-*
-
- Verify that all the other required OpenShift Data Foundation pods are in Running state.
Verify that new Object Storage Device (OSD) pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If data encryption is enabled on the cluster, verify that the new OSD devices are encrypted.
For each of the new nodes identified in the previous step, do the following:
Create a debug pod and open a chroot environment for the one or more selected hosts:
$ oc debug node/<node_name>$ chroot /hostDisplay the list of available block devices:
$ lsblkCheck for the
cryptkeyword beside the one or moreocs-devicesetnames.
- If the verification steps fail, contact Red Hat Support.
Procedure
-
Log in to the OpenShift Web Console, and click Compute
Nodes. - Identify the faulty node, and click on its Machine Name.
-
Click Actions
Edit Annotations, and click Add More. -
Add
machine.openshift.io/exclude-node-draining, and click Save. -
Click Actions
Delete Machine, and click Delete. A new machine is automatically created. Wait for new machine to start.
重要This activity might take at least 5 - 10 minutes or more. Ceph errors generated during this period are temporary and are automatically resolved when you label the new node, and it is functional.
-
Click Compute
Nodes. Confirm that the new node is in Ready state. Apply the OpenShift Data Foundation label to the new node using any one of the following:
- From the user interface
-
For the new node, click Action Menu (⋮)
Edit Labels. -
Add
cluster.ocs.openshift.io/openshift-storage, and click Save.
-
For the new node, click Action Menu (⋮)
- From the command-line interface
- Apply the OpenShift Data Foundation label to the new node:
$ oc label node <new_node_name> cluster.ocs.openshift.io/openshift-storage=""<new_node_name>- Specify the name of the new node.
Verification steps
Verify that the new node is present in the output:
$ oc get nodes --show-labels | grep cluster.ocs.openshift.io/openshift-storage= | cut -d' ' -f1Click Workloads
Pods. Confirm that at least the following pods on the new node are in Running state: -
csi-cephfsplugin-* -
csi-rbdplugin-*
-
- Verify that all the other required OpenShift Data Foundation pods are in Running state.
Verify that new Object Storage Device (OSD) pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If data encryption is enabled on the cluster, verify that the new OSD devices are encrypted.
For each of the new nodes identified in the previous step, do the following:
Create a debug pod and open a chroot environment for the one or more selected hosts:
$ oc debug node/<node_name>$ chroot /hostDisplay the list of available block devices:
$ lsblkCheck for the
cryptkeyword beside the one or moreocs-devicesetnames.
- If the verification steps fail, contact Red Hat Support.