Skip to content

DLPX-73192 Establish appropriate systemd service dependencies for iSCSI initiator #262

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

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

don-brady
Copy link
Contributor

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) the open-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 an open-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 existing umountiscsi.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 the open-iscsi service from stopping. The service will log the failure as seen below.

Jan 14 02:00:04  systemd[1]: Stopping Login to default iSCSI targets...
Jan 14 02:00:04  zpool_on_iscsi.sh [25638]: device '/dev/sde1' in use by zfs pool 'domain0'
Jan 14 02:00:04  systemd[1]: open-iscsi.service: Control process exited, code=exited status=1
Jan 14 02:00:04  systemd[1]: open-iscsi.service: Failed with result 'exit-code'.

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:

  • Confirmed override.conf file was correctly installed and that systemctl cat shows override is present
  • Confirmed that when the pool is imported, that stopping open-iscsi service will fail and the pool remains accessible
  • Confirmed that after the domain0 pool is exported, then a stop of open-iscsi service proceeds and the iscsi devices are no longer present (lsblk).
  • Confirmed that on a reboot the system was able to shutdown (i.e. the zpool_on_iscsi.sh check doesn't prevent shutting down)
  • Ran both shellcheck and shfmt against the new script.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

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 suspended

What is the new behavior?

stopping open-iscsi service will fail and the pool remains accessible

Does this introduce a breaking change?

  • Yes
  • No

@don-brady don-brady merged commit cc33556 into delphix:master Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants