Skip to content

Adds functionality to validate externally managed instances storage mount before starting nova-compute#184

Open
Raven-182 wants to merge 1 commit into
canonical:mainfrom
Raven-182:externally-managed-storage
Open

Adds functionality to validate externally managed instances storage mount before starting nova-compute#184
Raven-182 wants to merge 1 commit into
canonical:mainfrom
Raven-182:externally-managed-storage

Conversation

@Raven-182
Copy link
Copy Markdown

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:

  • the path is mounted
  • the mounted filesystem is a directory and writable

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

@Raven-182 Raven-182 force-pushed the externally-managed-storage branch from e9a870d to 62f7677 Compare June 4, 2026 02:31
@gboutry gboutry requested a review from Copilot June 4, 2026 07:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_validation with helpers to detect /etc/fstab declarations, mount status, and directory writability.
  • Adds a preflight() hook to OpenStackService and implements NovaComputeService.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.

Comment thread openstack_hypervisor/mount_validation.py
Comment thread openstack_hypervisor/mount_validation.py Outdated
Comment thread tests/unit/test_services.py
Comment thread openstack_hypervisor/mount_validation.py
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread openstack_hypervisor/mount_validation.py Outdated
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>
@Raven-182 Raven-182 force-pushed the externally-managed-storage branch from 1ecafdb to e2a7491 Compare June 4, 2026 15:16
@Raven-182 Raven-182 requested a review from gboutry June 4, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants