Adds functionality to validate externally managed instances storage mount before starting nova-compute#184
Open
Raven-182 wants to merge 1 commit into
Open
Conversation
e9a870d to
62f7677
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a startup preflight check for nova-compute to validate that Nova’s instances directory is correctly mounted and writable when that path is declared in /etc/fstab, preventing nova-compute from starting on misconfigured externally managed storage.
Changes:
- Introduces
openstack_hypervisor.mount_validationwith helpers to detect/etc/fstabdeclarations, mount status, and directory writability. - Adds a
preflight()hook toOpenStackServiceand implementsNovaComputeService.preflight()to validate the instances mount. - Adds unit tests for the new mount validation logic and the new preflight behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
openstack_hypervisor/services.py |
Adds a generic preflight() hook and calls it before starting services; implements mount validation preflight for nova-compute. |
openstack_hypervisor/mount_validation.py |
New module implementing /etc/fstab detection, mountpoint validation, and writable-directory checks. |
tests/unit/test_services.py |
Adds a unit test for NovaComputeService.preflight() (and should also cover preflight integration in run()). |
tests/unit/test_mount_validation.py |
New unit tests covering fstab parsing, mount detection, usability checks, and overall validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62f7677 to
1ecafdb
Compare
Check whether the default instances path is being used as an externally managed mount point via /etc/fstab. If external storage is configured, the service will only start when: - the instances path is actually mounted - the mounted filesystem is writable If no external storage is configured, startup behavior is unchanged. Signed-off-by: Raven Kaur <raven.kaur@canonical.com>
1ecafdb to
e2a7491
Compare
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.
Check whether the default instances path is being used as an externally managed mount point via /etc/fstab.
When an /etc/fstab entry exists for the instances path, nova-compute now validates that:
If either check fails, nova-compute will not start and an error is logged.
Startup behaviour is unchanged if there is no entry for the instances path in /etc/fstab