Skip to content

Commit

Permalink
change default kernel argument to disable multipath and overwrite mul…
Browse files Browse the repository at this point in the history
…tipathd system unit definition to allow multipathd to still be run after boot
  • Loading branch information
ibrokethecloud committed Feb 27, 2025
1 parent 265e1db commit f922cb9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,4 +925,41 @@ func disableLonghornMultipathing(stage *yipSchema.Stage) {
Owner: 0,
Group: 0,
})

// need to patch multipathd system unit to remove check for multipath=off
// this is needed to allow users to still manually start multipath post boot for
// 3rd party csi integration
multipathdUnitPatch := []byte(`[Unit]
Description=Device-Mapper Multipath Device Controller
Before=lvm2-activation-early.service
Before=local-fs-pre.target blk-availability.service shutdown.target
Wants=systemd-udevd-kernel.socket
After=systemd-udevd-kernel.socket
After=multipathd.socket systemd-remount-fs.service
Before=initrd-cleanup.service
DefaultDependencies=no
Conflicts=shutdown.target
Conflicts=initrd-cleanup.service
ConditionKernelCommandLine=!nompath
ConditionVirtualization=!container
[Service]
Type=notify
NotifyAccess=main
ExecStart=/sbin/multipathd -d -s
ExecReload=/sbin/multipathd reconfigure
TasksMax=infinity
[Install]
WantedBy=sysinit.target`)

multipathDirectives := base64.StdEncoding.EncodeToString(multipathdUnitPatch)
stage.Files = append(stage.Files, yipSchema.File{
Path: "/etc/systemd/system/multipathd.service",
Content: multipathDirectives,
Encoding: "base64",
Permissions: 0644,
Owner: 0,
Group: 0,
})
}
2 changes: 1 addition & 1 deletion pkg/console/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can see the full installation log by:

ElementalConfigDir = "/tmp/elemental"
ElementalConfigFile = "config.yaml"
multipathOff = "rd.multipath=0"
multipathOff = "multipath=off"
PartitionType = "part"
MpathType = "mpath"
CosDiskLabelPrefix = "COS_OEM"
Expand Down

0 comments on commit f922cb9

Please sign in to comment.