Skip to content

CP-13821 Gate nfs-server.service and default it off at image build - #581

Open
david-mendez1 wants to merge 3 commits into
developfrom
dlpx/pr/david-mendez1/9dfae8a5-a50d-4d69-ae1b-337a64079379
Open

david-mendez1 wants to merge 3 commits into
developfrom
dlpx/pr/david-mendez1/9dfae8a5-a50d-4d69-ae1b-337a64079379

Conversation

@david-mendez1

Copy link
Copy Markdown
Contributor

Summary

CP-13821 (child of Epic CP-13819): closes port 2049 by default on most Delphix appliance variants. Companion appliance change: dlpx-app-gate PR #4967, CP-13820.

This PR is not safe to merge independently of the companion dlpx-app-gate PR. Merging either repo's change alone leaves an engine in a broken state:

  • delphix-platform alone: new images ship with /etc/nfs_disable present (NFS disabled), and nothing in this repo ever removes it — only the companion PR's ProductServiceImpl/StackStartup code does.
  • app-gate alone: the upgrade retrofit and setup-time enable logic exist, but there is no systemd Condition anywhere to actually gate nfs-server.service without this PR.

Both must land in the same release train.

  • ConditionPathExists=!/etc/nfs_disable added to the existing [Unit] block in files/common/lib/systemd/system/nfs-server.service.d/override.conf, alongside the existing ConditionVirtualization=!container.
  • A new, ansible_is_chroot-gated task in roles/delphix-platform/tasks/main.yml creates /etc/nfs_disable on every variant except six named internal-infra variants (internal-minimal, internal-unittest, internal-dcenter, internal-buildserver, internal-package-mirror, internal-claude). The ansible_is_chroot gate is required: without it, this task would re-run on every real engine's boot-time Ansible re-run after every delphix-platform package upgrade and silently re-disable NFS on a live VIRTUALIZATION/BOTH engine.

Test plan

  • Build (via ab-pre-push) and manually verify on cloned internal-dev engines for both VIRTUALIZATION and MASKING: /etc/nfs_disable present/absent and nfs-server.service active/inactive match expectations on both.
  • Confirm the systemd Condition blocks nfs-server.service while the marker exists.
  • Confirm factory reset (developer_reset) correctly reconciles NFS state back to disabled on a previously-enabled Virtualization engine, and leaves a Masking engine unaffected.
  • server:storage tests could not be executed in the implementation sandbox (no native libzfs on that machine) and need a real run on Linux/CI before merge.

Replaces #578, which was closed because its head branch (CP-13821-disable-nfs-default) had unintentionally acquired develop-level branch protection (no force-push, no admin bypass, linear-history-only, 1 required review with no self-approval), making it impossible to update.

🤖 Generated with Claude Code

Add a ConditionPathExists=!/etc/nfs_disable constraint to the nfs-server.service
drop-in configuration. When the /etc/nfs_disable marker file exists, systemd will
not start this service, even if explicitly requested via 'systemctl start'. This
gating mechanism allows administrators to close port 2049 (NFS) by default on most
appliance variants. Multiple Condition*= keys are ANDed together, preserving the
existing container virtualization check.
…iants

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@david-mendez1
david-mendez1 force-pushed the dlpx/pr/david-mendez1/9dfae8a5-a50d-4d69-ae1b-337a64079379 branch from e1324aa to bc7f55a Compare October 16, 2026 23:07
@david-mendez1 david-mendez1 changed the title CP-13821 Fix final-review wording: mention BOTH, remove non-existent admin-control framing CP-13821 Gate nfs-server.service and default it off at image build Oct 16, 2026
@david-mendez1
david-mendez1 changed the base branch from CP-13821-disable-nfs-default to develop October 16, 2026 23:08
@david-mendez1
david-mendez1 marked this pull request as ready for review October 16, 2026 23:08
@david-mendez1
david-mendez1 requested review from sebroy and a balanced review from Copilot October 17, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Coordinated delivery with the companion PR and outstanding Linux storage tests require human verification.

No open issues 🎉

What changed in this PR

Disables NFS by default on most appliance variants, with engine-specific enablement handled by the companion application change.

Changes:

  • Gates nfs-server.service on the absence of /etc/nfs_disable.
  • Creates the marker only during image builds, excluding six internal infrastructure variants and avoiding runtime upgrade resets.
File Description
files/​common/​var/​lib/​delphix-platform/​ansible/​10-delphix-platform/​roles/​delphix-platform/​tasks/​main.yml Creates the NFS-disable marker for eligible image builds.
files/​common/​lib/​systemd/​system/​nfs-server.service.d/​override.conf Prevents NFS startup while the marker exists.

Review effort: Balanced

…admin-control framing

PR URL: https://www.github.com/delphix/delphix-platform/pull/581

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@david-mendez1
david-mendez1 force-pushed the dlpx/pr/david-mendez1/9dfae8a5-a50d-4d69-ae1b-337a64079379 branch from bc7f55a to 812d616 Compare October 19, 2026 16:16
@david-mendez1 david-mendez1 changed the title CP-13821 Gate nfs-server.service and default it off at image build CP-13821 Fix final-review wording: mention BOTH, remove non-existent admin-control framing Oct 19, 2026
@david-mendez1 david-mendez1 changed the title CP-13821 Fix final-review wording: mention BOTH, remove non-existent admin-control framing CP-13821 Gate nfs-server.service and default it off at image build Oct 19, 2026
@david-mendez1
david-mendez1 requested review from sebroy and a balanced review from Copilot and removed request for sebroy October 20, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Safe rollout requires coordinated companion changes and completion of the outstanding Linux/CI storage tests.

No open issues 🎉

Review effort: Balanced

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.

2 participants