@@ -4,7 +4,8 @@ Provisioning disks
44
55As a tech preview, Warewulf provides structures to define disks, partitions, and
66file systems. These structures can generate a configuration for `Ignition `_ to
7- provision partitions and file systems dynamically on cluster nodes.
7+ provision partitions and file systems dynamically on cluster nodes, or with
8+ sfdisk, mkfs, and mkswap during boot.
89
910.. _Ignition : https://coreos.github.io/ignition/
1011
@@ -145,3 +146,117 @@ file systems once, you may
145146 See the `upstream ignition documentation `_ for additional information.
146147
147148.. _upstream ignition documentation : https://coreos.github.io/ignition/operator-notes/#filesystem-reuse-semantics
149+
150+
151+ .. _provision to disk :
152+
153+ Provision to disk
154+ =================
155+
156+ *New in Warewulf v4.6.2 *
157+
158+ As a tech preview, the Warewulf two-stage boot process can provision the node
159+ image to local storage.
160+
161+ .. warning ::
162+
163+ This functionality is a technology preview and should be used with care. Pay
164+ specific attention to ``wipeFilesytem `` and similar settings.
165+
166+ .. note ::
167+
168+ Warewulf doesn't install a bootloader to the disk or add UEFI entries. Nodes
169+ still request an image and configuration from the Warewulf server on every
170+ boot.
171+
172+ .. note ::
173+
174+ While provisioning to disk should be possible during a single-stage boot, not
175+ all features are available:
176+
177+ - Warewulf does not perform hardware detection to ensure that necessary
178+ kernel modules are loaded prior to init.
179+ - Warewulf does not load udev to ensure that ``/dev/disk/by-* `` symlinks are
180+ available prior to init.
181+
182+ With Ignition
183+ -------------
184+
185+ Warewulf needs a prepared file system to deploy the image to. Warewulf can
186+ provision this file system using Ignition. To use Ignition, include ``ignition ``
187+ in your system overlay. The ignition overlay provisions disks during init and,
188+ optionally, during the first stage of a two-stage boot. This allows the
189+ root file system to be provisioned before the image is loaded.
190+
191+ .. code-block :: shell
192+
193+ wwctl node set wwnode1 \
194+ --diskname /dev/vda --diskwipe \
195+ --partname rootfs --partcreate --partnumber 1 \
196+ --fsname rootfs --fsformat ext4 --fspath /
197+
198+ In order to allow Dracut to provision the disk, partition, and file system,
199+ Ignition must be included in the Dracut image.
200+
201+ .. code-block :: shell
202+
203+ wwctl image exec rockylinux-9 -- /usr/bin/dracut --force --no-hostonly --add wwinit --add ignition --regenerate-all
204+
205+ The necessary file system may alternatively be prepared out-of-band.
206+
207+ With sfdisk and mkfs
208+ --------------------
209+
210+ Systems that do not have access to Ignition (e.g., Rocky Linux 8) can provision
211+ the root file system using a combination of ``sfdisk `` and ``mkfs ``. To use
212+ them, include ``sfdisk `` and ``mkfs `` in your system overlay. The ``sfdisk `` and
213+ ``mkfs `` overlays provision disk and file systems during the first stage of a
214+ two-stage boot. This allows the root file system to be provisioned before the
215+ image is loaded.
216+
217+ Configure the ``sfdisk `` and ``mkfs `` overlays using resources:
218+
219+ .. code-block :: shell
220+
221+ wwctl node set wwnode1 \
222+ --diskname /dev/vda --diskwipe \
223+ --partname rootfs --partcreate --partnumber 1 \
224+ --fsname rootfs --fsformat ext4 --fspath /
225+
226+ In order to allow Dracut to provision the disk, partition, and file system, some
227+ additional commands must be included in the Dracut image, depending on which
228+ functionality is used:
229+
230+ - **sfdisk: ** writes the partition table
231+
232+ - **blockdev: ** used to re-read the partition table after writing
233+
234+ - **udevadm: ** used to trigger udev events after writing the partition table
235+
236+ - **mkfs: ** formats file systems (may also require file-system-specific commands like mkfs.ext4)
237+
238+ - **mkfs.ext4 **, **mkfs.btrfs **, etc: used by mkfs to format specific file systems
239+
240+ - **wipefs: ** used to determine if a file system already exists
241+
242+ .. code-block :: shell
243+
244+ wwctl image exec rockylinux-8 -- /usr/bin/dracut --force --no-hostonly \
245+ --add wwinit \
246+ --install sfdisk \
247+ --install blockdev \
248+ --install udevadm \
249+ --install mkfs \
250+ --install mkfs.ext4 \
251+ --install wipefs \
252+ --regenerate-all
253+
254+ Configuring the root device
255+ ---------------------------
256+
257+ Set the desired storage device for the node image using the ``--root ``
258+ parameter.
259+
260+ .. code-block :: shell
261+
262+ wwctl node set wwnode1 --root /dev/disk/by-partlabel/rootfs
0 commit comments