Skip to content

Refactor ASM udev rules generation to overwrite file#437

Merged
mfielding merged 1 commit into
masterfrom
fix-udev-overlapping-rules
Jun 12, 2026
Merged

Refactor ASM udev rules generation to overwrite file#437
mfielding merged 1 commit into
masterfrom
fix-udev-overlapping-rules

Conversation

@mfielding

Copy link
Copy Markdown
Member

Previously, the toolkit used blockinfile to manage udev rules for ASM disks. While this works for initial deployments, it fails to clean up stale rules when storage is reconfigured (e.g. replacing smaller disks with larger ones) if the manual cleanup step (cleanup.sh) is bypassed. Stale rules mapped to the same symlink cause race conditions on boot.

Since a host only supports a single Grid Infrastructure / ASM installation, we can safely overwrite the entire /etc/udev/rules.d/99-oracle-asmdevices.rules file on every deployment.

This refactors the rules generation to use a Jinja2 template, replacing the blockinfile tasks. Stale rules are now automatically pruned when disks are removed from the configuration, improving toolkit resiliency.

Testing:

  • Verified that rules are correctly generated and applied.
  • Successfully deployed a test instance in the gcp-oracle-sandbox cloud environment using Infrastructure Manager and verified that ASM disk discovery and database installation completed without issues.

Previously, the toolkit used `blockinfile` to manage udev rules for ASM disks.
While this works for initial deployments, it fails to clean up stale rules
when storage is reconfigured (e.g. replacing smaller disks with larger ones)
if the manual cleanup step (`cleanup.sh`) is bypassed. Stale rules mapped
to the same symlink cause race conditions on boot.

Since a host only supports a single Grid Infrastructure / ASM installation,
we can safely overwrite the entire `/etc/udev/rules.d/99-oracle-asmdevices.rules`
file on every deployment.

This refactors the rules generation to use a Jinja2 template, replacing
the `blockinfile` tasks. Stale rules are now automatically pruned when
disks are removed from the configuration, improving toolkit resiliency.

Testing:
- Verified that rules are correctly generated and applied.
- Successfully deployed a test instance in the gcp-oracle-sandbox cloud environment using Infrastructure Manager and verified that ASM disk discovery and database installation completed without issues.
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexBasinov, mfielding

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [AlexBasinov,mfielding]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mfielding mfielding merged commit 42b32da into master Jun 12, 2026
13 checks passed
@mfielding mfielding deleted the fix-udev-overlapping-rules branch June 12, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants