2.4. Replacing storage nodes on VMware infrastructure
To replace an operational node, see:
To replace a failed node,see:
Prerequisites
- Ensure that the replacement nodes are configured with similar infrastructure, resources, and disks to the node that you replace.
- You must be logged into the OpenShift Container Platform cluster.
Procedure
Identify the node, and get the labels on the node that you need to replace:
$ oc get nodes --show-labels | grep <node_name><node_name>- Specify the name of node that you need to replace.
Identify the monitor pod (if any), and OSDs that are running in the node that you need to replace:
$ 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 node as unschedulable:
$ oc adm cordon <node_name>Drain the node:
$ oc adm drain <node_name> --force --delete-emptydir-data=true --ignore-daemonsetsDelete the node:
$ oc delete node <node_name>- Log in to VMware vSphere and terminate the Virtual Machine (VM) that you have identified.
- Create a new VM on VMware vSphere with the required infrastructure. See Infrastructure requirements.
- Create a new OpenShift Container Platform worker node using the new VM.
Check for the Certificate Signing Requests (CSRs) related to OpenShift Container Platform that are in
Pendingstate:$ oc get csrApprove all the required OpenShift Container Platform CSRs for the new node:
$ oc adm certificate approve <certificate_name><certificate_name>- Specify the name of the CSR.
-
Click Compute
Nodes in the OpenShift Web Console. 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.
Identify the namespace where OpenShift local storage operator is installed, and assign it to the
local_storage_projectvariable:$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)For example:
$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)echo $local_storage_projectExample output:
openshift-local-storageAdd a new worker node to the
localVolumeDiscoveryandlocalVolumeSet.Update the
localVolumeDiscoverydefinition to include the new node, and remove the failed node:# oc edit -n $local_storage_project localvolumediscovery auto-discover-devicesExample output:
[...] 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 this example,
server3.example.comis removed, andnewnode.example.comis the new node.Determine the
localVolumeSetto edit:# oc get -n $local_storage_project localvolumesetExample output:
NAME AGE localblock 25hUpdate the
localVolumeSetdefinition to include the new node, and remove the failed node:# oc edit -n $local_storage_project localvolumeset localblockExample output:
[...] 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 this example,
server3.example.comis removed andnewnode.example.comis the new node.
Verify that the new
localblockPersistent Volume (PV) is available:$oc get pv | grep localblock | grep AvailableExample output:
local-pv-551d950 512Gi RWO Delete Available localblock 26sNavigate to the
openshift-storageproject:$ oc project openshift-storageRemove the failed OSD from the cluster. You can specify multiple failed OSDs if required:
$ oc process -n openshift-storage ocs-osd-removal \ -p FAILED_OSD_IDS=<failed_osd_id> | oc create -f -<failed_osd_id>Is the integer in the pod name immediately after the
rook-ceph-osdprefix.You can add comma separated OSD IDs in the command to remove more than one OSD, for example,
FAILED_OSD_IDS=0,1,2.The
FORCE_OSD_REMOVALvalue must be changed totruein clusters that only have three OSDs, or clusters with insufficient space to restore all three replicas of the data after the OSD is removed.
Verify that the OSD was removed successfully by checking the status of the
ocs-osd-removal-jobpod.A status of
Completedconfirms that the OSD removal job succeeded.# oc get pod -l job-name=ocs-osd-removal-job -n openshift-storageEnsure that the OSD removal is completed.
$ oc logs -l job-name=ocs-osd-removal-job -n openshift-storage --tail=-1 | egrep -i 'completed removal'Example output:
2022-05-10 06:50:04.501511 I | cephosd: completed removal of OSD 0重要If the
ocs-osd-removal-jobfails, 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-job -n openshift-storage --tail=-1Identify the Persistent Volume (PV) associated with the Persistent Volume Claim (PVC):
# oc get pv -L kubernetes.io/hostname | grep localblock | grep ReleasedExample output:
local-pv-d6bf175b 1490Gi RWO Delete Released openshift-storage/ocs-deviceset-0-data-0-6c5pw localblock 2d22h compute-1If there is a PV in
Releasedstate, delete it:# oc delete pv <persistent_volume>For example:
# oc delete pv local-pv-d6bf175bExample output:
persistentvolume "local-pv-d9c5cbd6" deletedIdentify 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-removal-job:# oc delete -n openshift-storage job ocs-osd-removal-jobExample output:
job.batch "ocs-osd-removal-job" 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 Runningstate:-
csi-cephfsplugin-* -
csi-rbdplugin-*
-
Verify that all other required OpenShift Data Foundation pods are in
Runningstate.Ensure that the new incremental
monis created, and is in theRunningstate:$ oc get pod -n openshift-storage | grep monExample output:
rook-ceph-mon-a-cd575c89b-b6k66 2/2 Running 0 38m rook-ceph-mon-b-6776bc469b-tzzt8 2/2 Running 0 38m rook-ceph-mon-d-5ff5d488b5-7v8xh 2/2 Running 0 4m8sOSD and monitor pod might take several minutes to get to the
Runningstate.Verify that new OSD pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If cluster-wide 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.
Prerequisites
- Ensure that the replacement nodes are configured with the similar infrastructure, resources, and disks to the node that you replace.
- You must be logged into the OpenShift Container Platform cluster.
Procedure
-
Log in to the OpenShift Web Console, and click Compute
Nodes. - Identify the node that you need to replace. Take a note of its Machine Name.
Get labels on the node:
$ oc get nodes --show-labels | grep <node_name><node_name>- Specify the name of node that you need to replace.
Identify the
mon(if any), and Object Storage Devices (OSDs) that are running in the node:$ oc get pods -n openshift-storage -o wide | grep -i <node_name>Scale down the deployments of the pods that you 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 node as unschedulable:
$ oc adm cordon <node_name>Drain the node:
$ oc adm drain <node_name> --force --delete-emptydir-data=true --ignore-daemonsets-
Click Compute
Machines. Search for the required machine. -
Besides the required machine, click Action menu (⋮)
Delete Machine. - Click Delete to confirm the machine deletion. A new machine is automatically created.
Wait for the new machine to start and transition into Running state.
重要This activity might take at least 5 - 10 minutes or more.
-
Click Compute
Nodes in the OpenShift Web Console. Confirm that the new node is in Ready state. - Physically add a new device to the node.
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.
Identify the namespace where the OpenShift local storage operator is installed, and assign it to the
local_storage_projectvariable:$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)For example:
$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)echo $local_storage_projectExample output:
openshift-local-storageAdd a new worker node to the
localVolumeDiscoveryandlocalVolumeSet.Update the
localVolumeDiscoverydefinition to include the new node and remove the failed node.# oc edit -n $local_storage_project localvolumediscovery auto-discover-devicesExample output:
[...] 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 this example,
server3.example.comis removed, andnewnode.example.comis the new node.Determine the
localVolumeSetyou need to edit:# oc get -n $local_storage_project localvolumesetExample output:
NAME AGE localblock 25hUpdate the
localVolumeSetdefinition to include the new node and remove the failed node:# oc edit -n $local_storage_project localvolumeset localblockExample output:
[...] 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 this example,
server3.example.comis removed, andnewnode.example.comis the new node.
Verify that the new
localblockPersistent Volume (PV) is available:$ oc get pv | grep localblock | grep AvailableExample output:
local-pv-551d950 512Gi RWO Delete Available localblock 26sNavigate to the
openshift-storageproject:$ oc project openshift-storageRemove the failed OSD from the cluster. You can specify multiple failed OSDs if required:
$ oc process -n openshift-storage ocs-osd-removal \ -p FAILED_OSD_IDS=<failed_osd_id> | oc create -f -<failed_osd_id>Is the integer in the pod name immediately after the
rook-ceph-osdprefix.You can add comma separated OSD IDs in the command to remove more than one OSD, for example,
FAILED_OSD_IDS=0,1,2.The
FORCE_OSD_REMOVALvalue must be changed totruein clusters that only have three OSDs, or clusters with insufficient space to restore all three replicas of the data after the OSD is removed.
Verify that the OSD was removed successfully by checking the status of the
ocs-osd-removal-jobpod.A status of
Completedconfirms that the OSD removal job succeeded.# oc get pod -l job-name=ocs-osd-removal-job -n openshift-storageEnsure that the OSD removal is completed.
$ oc logs -l job-name=ocs-osd-removal-job -n openshift-storage --tail=-1 | egrep -i 'completed removal'Example output:
2022-05-10 06:50:04.501511 I | cephosd: completed removal of OSD 0重要If the
ocs-osd-removal-jobfails 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-job -n openshift-storage --tail=-1Identify the PV associated with the Persistent Volume Claim (PVC):
# oc get pv -L kubernetes.io/hostname | grep localblock | grep ReleasedExample output:
local-pv-d6bf175b 1490Gi RWO Delete Released openshift-storage/ocs-deviceset-0-data-0-6c5pw localblock 2d22h compute-1If there is a PV in
Releasedstate, delete it:# oc delete pv <persistent_volume>For example:
# oc delete pv local-pv-d6bf175bExample output:
persistentvolume "local-pv-d9c5cbd6" deletedIdentify 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-removal-job:# oc delete -n openshift-storage job ocs-osd-removal-jobExample output:
job.batch "ocs-osd-removal-job" 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 Runningstate:-
csi-cephfsplugin-* -
csi-rbdplugin-*
-
Verify that all other required OpenShift Data Foundation pods are in
Runningstate.Ensure that the new incremental
monis created and is in theRunningstate.$ oc get pod -n openshift-storage | grep monExample output:
rook-ceph-mon-a-cd575c89b-b6k66 2/2 Running 0 38m rook-ceph-mon-b-6776bc469b-tzzt8 2/2 Running 0 38m rook-ceph-mon-d-5ff5d488b5-7v8xh 2/2 Running 0 4m8sOSD and monitor pod might take several minutes to get to the
Runningstate.Verify that new OSD pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If cluster-wide 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.
Prerequisites
- Ensure that the replacement nodes are configured with similar infrastructure, resources, and disks to the node that you replace.
- You must be logged into the OpenShift Container Platform cluster.
Procedure
Identify the node, and get the labels on the node that you need to replace:
$ oc get nodes --show-labels | grep <node_name><node_name>- Specify the name of node that you need to replace.
Identify the monitor pod (if any), and OSDs that are running in the node that you need to replace:
$ 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 node as unschedulable:
$ oc adm cordon <node_name>Remove the pods which are in
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>- Log in to VMware vSphere and terminate the Virtual Machine (VM) that you have identified.
- Create a new VM on VMware vSphere with the required infrastructure. See Infrastructure requirements.
- Create a new OpenShift Container Platform worker node using the new VM.
Check for the Certificate Signing Requests (CSRs) related to OpenShift Container Platform that are in
Pendingstate:$ oc get csrApprove all the required OpenShift Container Platform CSRs for the new node:
$ oc adm certificate approve <certificate_name><certificate_name>- Specify the name of the CSR.
-
Click Compute
Nodes in the OpenShift Web Console. 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.
Identify the namespace where OpenShift local storage operator is installed, and assign it to the
local_storage_projectvariable:$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)For example:
$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)echo $local_storage_projectExample output:
openshift-local-storageAdd a new worker node to the
localVolumeDiscoveryandlocalVolumeSet.Update the
localVolumeDiscoverydefinition to include the new node, and remove the failed node:# oc edit -n $local_storage_project localvolumediscovery auto-discover-devicesExample output:
[...] 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 this example,
server3.example.comis removed, andnewnode.example.comis the new node.Determine the
localVolumeSetto edit:# oc get -n $local_storage_project localvolumesetExample output:
NAME AGE localblock 25hUpdate the
localVolumeSetdefinition to include the new node, and remove the failed node:# oc edit -n $local_storage_project localvolumeset localblockExample output:
[...] 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 this example,
server3.example.comis removed andnewnode.example.comis the new node.
Verify that the new
localblockPersistent Volume (PV) is available:$oc get pv | grep localblock | grep AvailableExample output:
local-pv-551d950 512Gi RWO Delete Available localblock 26sNavigate to the
openshift-storageproject:$ oc project openshift-storageRemove the failed OSD from the cluster. You can specify multiple failed OSDs if required:
$ oc process -n openshift-storage ocs-osd-removal \ -p FAILED_OSD_IDS=<failed_osd_id> | oc create -f -<failed_osd_id>Is the integer in the pod name immediately after the
rook-ceph-osdprefix.You can add comma separated OSD IDs in the command to remove more than one OSD, for example,
FAILED_OSD_IDS=0,1,2.The
FORCE_OSD_REMOVALvalue must be changed totruein clusters that only have three OSDs, or clusters with insufficient space to restore all three replicas of the data after the OSD is removed.
Verify that the OSD was removed successfully by checking the status of the
ocs-osd-removal-jobpod.A status of
Completedconfirms that the OSD removal job succeeded.# oc get pod -l job-name=ocs-osd-removal-job -n openshift-storageEnsure that the OSD removal is completed.
$ oc logs -l job-name=ocs-osd-removal-job -n openshift-storage --tail=-1 | egrep -i 'completed removal'Example output:
2022-05-10 06:50:04.501511 I | cephosd: completed removal of OSD 0重要If the
ocs-osd-removal-jobfails, 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-job -n openshift-storage --tail=-1Identify the Persistent Volume (PV) associated with the Persistent Volume Claim (PVC):
# oc get pv -L kubernetes.io/hostname | grep localblock | grep ReleasedExample output:
local-pv-d6bf175b 1490Gi RWO Delete Released openshift-storage/ocs-deviceset-0-data-0-6c5pw localblock 2d22h compute-1If there is a PV in
Releasedstate, delete it:# oc delete pv <persistent_volume>For example:
# oc delete pv local-pv-d6bf175bExample output:
persistentvolume "local-pv-d9c5cbd6" deletedIdentify 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-removal-job:# oc delete -n openshift-storage job ocs-osd-removal-jobExample output:
job.batch "ocs-osd-removal-job" 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 Runningstate:-
csi-cephfsplugin-* -
csi-rbdplugin-*
-
Verify that all other required OpenShift Data Foundation pods are in
Runningstate.Ensure that the new incremental
monis created, and is in theRunningstate:$ oc get pod -n openshift-storage | grep monExample output:
rook-ceph-mon-a-cd575c89b-b6k66 2/2 Running 0 38m rook-ceph-mon-b-6776bc469b-tzzt8 2/2 Running 0 38m rook-ceph-mon-d-5ff5d488b5-7v8xh 2/2 Running 0 4m8sOSD and monitor pod might take several minutes to get to the
Runningstate.Verify that new OSD pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If cluster-wide 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.
Prerequisites
- Ensure that the replacement nodes are configured with the similar infrastructure, resources, and disks to the node that you replace.
- You must be logged into the OpenShift Container Platform cluster.
Procedure
-
Log in to the OpenShift Web Console, and click Compute
Nodes. - Identify the node that you need to replace. Take a note of its Machine Name.
Get the labels on the node:
$ oc get nodes --show-labels | grep _<node_name>_<node_name>- Specify the name of node that you need to replace.
Identify the
mon(if any) and Object Storage Devices (OSDs) that are running in the node:$ 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 node as unschedulable:
$ oc adm cordon _<node_name>_Remove the pods which are in
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-daemonsets-
Click Compute
Machines. Search for the required machine. -
Besides the required machine, click Action menu (⋮)
Delete Machine. - Click Delete to confirm the machine is deleted. A new machine is automatically created.
Wait for the new machine to start and transition into Running state.
重要This activity might take at least 5 - 10 minutes or more.
-
Click Compute
Nodes in the OpenShift Web Console. Confirm that the new node is in Ready state. - Physically add a new device to the node.
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.
Identify the namespace where the OpenShift local storage operator is installed, and assign it to the
local_storage_projectvariable:$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)For example:
$ local_storage_project=$(oc get csv --all-namespaces | awk '{print $1}' | grep local)echo $local_storage_projectExample output:
openshift-local-storageAdd a new worker node to the
localVolumeDiscoveryandlocalVolumeSet.Update the
localVolumeDiscoverydefinition to include the new node and remove the failed node:# oc edit -n $local_storage_project localvolumediscovery auto-discover-devicesExample output:
[...] 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 this example,
server3.example.comis removed andnewnode.example.comis the new node.Determine the
localVolumeSetyou need to edit.# oc get -n $local_storage_project localvolumesetExample output:
NAME AGE localblock 25hUpdate the
localVolumeSetdefinition to include the new node and remove the failed node:# oc edit -n $local_storage_project localvolumeset localblockExample output:
[...] 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 this example,
server3.example.comis removed andnewnode.example.comis the new node.
Verify that the new
localblockPV is available:$ oc get pv | grep localblock | grep AvailableExample output:
local-pv-551d950 512Gi RWO Delete Available localblock 26sNavigate to the
openshift-storageproject:$ oc project openshift-storageRemove the failed OSD from the cluster. You can specify multiple failed OSDs if required:
$ oc process -n openshift-storage ocs-osd-removal \ -p FAILED_OSD_IDS=<failed_osd_id> | oc create -f -<failed_osd_id>Is the integer in the pod name immediately after the
rook-ceph-osdprefix.You can add comma separated OSD IDs in the command to remove more than one OSD, for example,
FAILED_OSD_IDS=0,1,2.The
FORCE_OSD_REMOVALvalue must be changed totruein clusters that only have three OSDs, or clusters with insufficient space to restore all three replicas of the data after the OSD is removed.
Verify that the OSD was removed successfully by checking the status of the
ocs-osd-removal-jobpod.A status of
Completedconfirms that the OSD removal job succeeded.# oc get pod -l job-name=ocs-osd-removal-job -n openshift-storageEnsure that the OSD removal is completed.
$ oc logs -l job-name=ocs-osd-removal-job -n openshift-storage --tail=-1 | egrep -i 'completed removal'Example output:
2022-05-10 06:50:04.501511 I | cephosd: completed removal of OSD 0重要If the
ocs-osd-removal-jobfails 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-job -n openshift-storage --tail=-1Identify the PV associated with the Persistent Volume Claim (PVC):
# oc get pv -L kubernetes.io/hostname | grep localblock | grep ReleasedExample output:
local-pv-d6bf175b 1490Gi RWO Delete Released openshift-storage/ocs-deviceset-0-data-0-6c5pw localblock 2d22h compute-1If there is a PV in
Releasedstate, delete it:# oc delete pv _<persistent_volume>_For example:
# oc delete pv local-pv-d6bf175bExample output:
persistentvolume "local-pv-d9c5cbd6" deletedIdentify 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-removal-job:# oc delete -n openshift-storage job ocs-osd-removal-jobExample output:
job.batch "ocs-osd-removal-job" 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 Runningstate:-
csi-cephfsplugin-* -
csi-rbdplugin-*
-
Verify that all other required OpenShift Data Foundation pods are in
Runningstate.Ensure that the new incremental
monis created, and is in theRunningstate:$ oc get pod -n openshift-storage | grep monExample output:
rook-ceph-mon-a-cd575c89b-b6k66 2/2 Running 0 38m rook-ceph-mon-b-6776bc469b-tzzt8 2/2 Running 0 38m rook-ceph-mon-d-5ff5d488b5-7v8xh 2/2 Running 0 4m8sOSD and monitor pod might take several minutes to get to the
Runningstate.Verify that new OSD pods are running on the replacement node:
$ oc get pods -o wide -n openshift-storage| egrep -i <new_node_name> | egrep osdOptional: If cluster-wide 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.