You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,18 +12,32 @@ The Machine Config Operator (MCO) is responsible for mounting a secondary disk f
12
12
13
13
[NOTE]
14
14
====
15
-
This procedure does not move parts of the root file system, such as `/var/`, to another disk or partition on an installed node.
15
+
This encoded script only supports device names for the following device types:
16
+
17
+
SCSI or SATA:: `/dev/sd*`
18
+
Virtual device:: `/dev/vd*`
19
+
NVMe:: `/dev/nvme*[0-9]\*n*`
16
20
====
17
21
22
+
.Limitations
23
+
24
+
* When the new disk is attached to the cluster, the etcd database is part of the root mount. It is not part of the secondary disk or the intended disk when the primary node is recreated. As a result, the primary node will not create a separate `/var/lib/etcd` mount.
25
+
18
26
.Prerequisites
19
27
20
28
* You have installed the {oc-first}.
21
29
* You have access to the cluster with `cluster-admin` privileges.
30
+
* Add additional disks before uploading the machine configuration.
22
31
* The `MachineConfigPool` must match `metadata.labels[machineconfiguration.openshift.io/role]`. This applies to a controller, worker, or a custom pool.
23
32
33
+
[NOTE]
34
+
====
35
+
This procedure does not move parts of the root file system, such as `/var/`, to another disk or partition on an installed node.
36
+
====
37
+
24
38
.Procedure
25
39
26
-
. Attach the new disk to the cluster and verify that the disk is detected in the node by using the `lsblk` command in a debug shell:
40
+
. Attach the new disk to the cluster and verify that the disk is detected in the node by running the `lsblk` command in a debug shell:
27
41
+
28
42
[source,terminal]
29
43
----
@@ -37,116 +51,29 @@ $ oc debug node/<node_name>
37
51
+
38
52
Note the device name of the new disk reported by the `lsblk` command.
39
53
40
-
. Create a `MachineConfig` YAML file named `etcd-mc.yml` with contents such as the following, replacing instances of `<new_disk_name>` with the noted device name:
41
-
+
42
-
[source,yaml]
43
-
----
44
-
apiVersion: machineconfiguration.openshift.io/v1
45
-
kind: MachineConfig
46
-
metadata:
47
-
labels:
48
-
machineconfiguration.openshift.io/role: master
49
-
name: 98-var-lib-etcd
50
-
spec:
51
-
config:
52
-
ignition:
53
-
version: 3.4.0
54
-
systemd:
55
-
units:
56
-
- contents: |
57
-
[Unit]
58
-
Description=Make File System on /dev/<new_disk_name>
. Log in to the cluster as a user with `cluster-admin` privileges and create the machine configuration:
54
+
. Decode and replace the device name in the script according to your environment.
130
55
+
131
-
[source,terminal]
132
-
----
133
-
$ oc login -u <username> -p <password>
134
-
----
135
-
+
136
-
[source,terminal]
137
-
----
138
-
$ oc create -f etcd-mc.yml
139
-
----
140
-
+
141
-
The nodes are updated and rebooted. After the reboot completes, the following events occur:
142
-
+
143
-
* An XFS file system is created on the specified disk.
144
-
* The disk mounts to `/var/lib/etcd`.
145
-
* The content from `/sysroot/ostree/deploy/rhcos/var/lib/etcd` syncs to `/var/lib/etcd`.
146
-
* A restore of `SELinux` labels is forced for `/var/lib/etcd`.
147
-
* The old content is not removed.
148
-
149
-
. After the nodes are on a separate disk, update the `etcd-mc.yml` file with contents such as the following, replacing instances of `<new_disk_name>` with the noted device name:
56
+
[source,bash]
57
+
----
58
+
#!/bin/bash
59
+
set -uo pipefail
60
+
61
+
for device in <device_type_glob>; do # <1>
62
+
/usr/sbin/blkid $device &> /dev/null
63
+
if [ $? == 2 ]; then
64
+
echo "secondary device found $device"
65
+
echo "creating filesystem for etcd mount"
66
+
mkfs.xfs -L var-lib-etcd -f $device &> /dev/null
67
+
udevadm settle
68
+
touch /etc/var-lib-etcd-mount
69
+
exit
70
+
fi
71
+
done
72
+
echo "Couldn't find secondary block device!" >&2
73
+
exit 77
74
+
----
75
+
<1> Replace `<device_type_glob>` with a shell glob for your block device type. For SCSI or SATA drives, use `/dev/sd*`; for virtual drives, use `/dev/vd*`; for NVMe drives, use `/dev/nvme*[0-9]\*n*`.
76
+
. Create a `MachineConfig` YAML file named `etcd-mc.yml` with contents such as the following:
0 commit comments