-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
New service that waits on zvol links to be created #8975
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8975 +/- ##
===========================================
- Coverage 77.6% 66.44% -11.17%
===========================================
Files 391 325 -66
Lines 120531 103708 -16823
===========================================
- Hits 93544 68913 -24631
- Misses 26987 34795 +7808
Continue to review full report at Codecov.
|
Some random questions. Note that these really are questions, and I'm not implying that I'm in favor of them.
@aerusso @Fabian-Gruenbichler do you have any thoughts here? |
@rlaager I had many of the same thoughts/questions, but not yet found the time to write them up. Especially in combination with encryption it would be nice to have individual units for zvols (that could then also be ordered after/depend on the resp. zfs-load-key units, if necessary). I am also not sure whether we really want to tie in this new service(s)/target into the main zfs.target. IMHO it would make more sense for other services (like iSCSI targets, hypervisors that have guest volumes as zvols, ...) that actually depend on the links being there to explicitly pull it/them in. This would avoid artificially slowing down the default boot - there were no guarantees so far that all zvol links are available, so nobody should rely on this (yet). |
@behlendorf At the risk of seeing everything as a nail (because of the hammer that I've wielded), I agree that the granularity of having I have not tested the below, but this is roughly what I'm thinking: aerusso@ce2abd4 in https://github.com/aerusso/zfs/commits/pulls/systemd-zvols |
The granularity would be nice, but it would be nice to not have that additional requirement block this PR. I'm not familiar with .path units would this be something which could co-exist with the proposed approach? Similar to what's done with I do think we want to have a |
Thanks for the feedback. I do think that having more granular units could be very useful in some cases, but even with the implementation stub from @aerusso we would probably need to spend much more time testing it and ironing out any corner cases. If others do not object, I'd prefer going forward with this approach for now since it does provide quite some value already. With |
For now I will not add any |
I have added the new |
This implementation does not seem to handle
Systems with at least 1 "hidden" ( |
Thanks for the review. I was not aware of this property. I'll update the review to filter out zvols with |
Updated code with the following changes:
|
Thanks for addressing those last few issues. I'll get this merged pending the final CI results. |
@pzakha bad timing, I believe we had some zimport failures due to the unrelated log space map changes being integrated. Can you rebase this one last time on master. |
The zfs-volume service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volume.service. Signed-off-by: Pavel Zakharov <pzakharov@delphix.com>
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
119: DLPX-64724 rtslib-fb-targetctl service should wait on domain0 zvol links before starting r=pzakha a=pzakha This leverages the functionality added in openzfs/zfs#8975. ## Testing ab-pre-push + migration testing: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/appliance-build-orchestrator-pre-push/1836/ Co-authored-by: Pavel Zakharov <pavel.zakharov@delphix.com>
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes openzfs#8975
The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: John Gallagher <john.gallagher@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Zakharov <pzakharov@delphix.com> Closes #8975
This creates a new service,
zfs-volume.service
. When this service becomes active, it ensures that all the zvols of imported pools are ready to use and their symlinks are created under/dev
. Note that this service doesn't actually do any modifications to the system, it only waits for resources to be ready before returning. Any service that performs operations on zvols at boot time would want to add this service as a dependency.Motivation and Context
The
rtslib-fb-targetctl
service that comes with thepython-rtslib-fb
package provides a userland interface to the LIO framework, which can serve iSCSI LUNs from block devices on the system. ZFS volumes (zvols) can be used as backing block devices. However, there is currently no guarantee that the zvols are ready when that service runs at boot time. If that is the case, thenrtslib-fb-targetctl
will fail to create LUNs from those zvols. The newzfs-volume
service can be added as a dependency tortslib-fb-targetctl
to avoid such situations.Description
The original Delphix review is here: https://github.com/delphix/zfs/pull/56.
The idea is to list all the zvols and then wait for their links under
/dev
to be created.How Has This Been Tested?
rtslib-fb-targetctl
service doesn't report any errors at boot because of unexisting zvol links after adding a dependency on zfs-volume.service.Types of changes
Checklist:
Signed-off-by
.