DLPX-73192 Establish appropriate systemd service dependencies for iSCSI initiator #262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This makes the
open-iscsi
service service stop operation zfs aware. Here we want to make sure ZFS is still not actively using an iSCSI device. When restarting (or stopping) theopen-iscsi
service, the iscsi devices are torn completely down. Then during start these devices are rebuilt; they typically have a different device node (sdN
). Note that anopen-iscsi
stop operation already checks for mounted file systems that are backed by iscsi devices but those checks are not ZFS aware.We introduce a new check script,
zpool_on_iscsi.sh
, which is similar to the existingumountiscsi.sh
script. This new script will return a non-zero result (1) if there is a zfs pool using iSCSI devices which in turn will prevent theopen-iscsi
service from stopping. The service will log the failure as seen below.We expect that most iSCSI administration will be performed using the Delphix iSCSI APIs and that in general no admin should be directly stopping or restarting the
open-iscsi
service.Testing Done
Ab-pre-push:
http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/appliance-build-orchestrator-pre-push/4641/
Manual Testing:
systemctl cat
shows override is presentopen-iscsi
service will fail and the pool remains accessibleopen-iscsi
service proceeds and the iscsi devices are no longer present (lsblk
).zpool_on_iscsi.sh
check doesn't prevent shutting down)shellcheck
andshfmt
against the new script.Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
An
open-iscsi
stop will tear down the devices while still being used by zfs and the pool will become suspendedWhat is the new behavior?
stopping
open-iscsi
service will fail and the pool remains accessibleDoes this introduce a breaking change?