Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-48256: Run iscsiadm for agent-based iSCSI installations #9356

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions data/data/agent/systemd/units/iscsiadm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Ensure iscsid is started and iSCSI sessions are managed
After=iscsistart.service

[Service]
Type=oneshot
ExecStart=-/usr/sbin/iscsiadm -m session -P3
bfournie marked this conversation as resolved.
Show resolved Hide resolved

[Install]
WantedBy=multi-user.target
4 changes: 3 additions & 1 deletion docs/user/agent/agent-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ step is required because the agent-tui and nmstate libraries are too big to fit
* install-status - determines the current install status and writes it out to /etc/issue.d/
* apply-host-config - applies root device hints and roles specified in agent-config.yaml
* start-cluster-installation - calls assisted-service REST-API to start cluster installation when all hosts are in ready state and have passed validations
* iscsistart - calls the iscsistart utility which allows an iSCSI session to be started for booting off an iSCSI target
* iscsiadm - calls the iscsiadm utility that will start iscsid to manage the iSCSI session needed to install the final rhcos image

## Add-nodes workflow

Expand All @@ -47,4 +49,4 @@ agent-interactive-console service because the disk images generated in the facto
so no connectivity checks to the release image is needed.

* load-config-iso@ - detects the config image has been mounted and copies the cluster configuration files from the config image to the host. It also enables start-cluster-installation which is disabled by default in the unconfigured-ignition. The actual service is created when the config image is mounted as a device and its name will be load-config-iso@<dev-name>.service e.g [email protected]
* agent-check-config-image - if the config image has not been mounted, it displays a message to the console asking for the config image to be mounted in order to start the cluster installation.
* agent-check-config-image - if the config image has not been mounted, it displays a message to the console asking for the config image to be mounted in order to start the cluster installation.
Binary file modified docs/user/agent/agent_installer_services-install_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pkg/asset/agent/image/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ func getDefaultEnabledServices() []string {
"oci-eval-user-data.service",
"iscsistart.service",
"set-hostname.service",
"iscsiadm.service",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a benefit to run iscsiadm instead of enabling iscsid (and perhaps configure iscsistart after iscsid has started) directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to [RHEL 9 doumentation] it seems iscsiadm should be used to start iscsid (https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_storage_devices/configuring-an-iscsi-initiator_managing-storage-devices#configuring-an-iscsi-initiator_managing-storage-devices)

By default, an iSCSI service is lazily started and the service starts after running the iscsiadm command. If root is not on an iSCSI device or there are no nodes marked with node.startup = automatic then the iSCSI service will not start until an iscsiadm command is executed that requires iscsid or the iscsi kernel modules to be started.

I've also confirmed it works by using ExecStart=systemctl start iscsid.service instead of iscsiadm in the service however.

}
}

Expand Down