Refactor ASM udev rules generation to overwrite file#437
Merged
Conversation
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.
AlexBasinov
approved these changes
Jun 12, 2026
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously, the toolkit used
blockinfileto 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.rulesfile on every deployment.This refactors the rules generation to use a Jinja2 template, replacing the
blockinfiletasks. Stale rules are now automatically pruned when disks are removed from the configuration, improving toolkit resiliency.Testing: