Skip to content

ceph-volume: fix nvme preformat wiping VG on osds-per-device > 1 - #70486

Merged
guits merged 1 commit into
ceph:mainfrom
guits:fix-nvme-reformat
Jul 29, 2026
Merged

guits merged 1 commit into
ceph:mainfrom
guits:fix-nvme-reformat

Conversation

@guits

@guits guits commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

prepare_data_device() was calling nvme_utils.preformat() unconditionally for every OSD slot. With --osds-per-device N, this means the second osd reformats the device after the first OSD had already created its vg on it which makes vgcreate fail with "device has a signature".

this commit fixes this issue by checking api.get_device_vgs() before preformatting: if a ceph VG already exists on the device, skip the format. This mirrors the logic create_lv() already uses to reuse an existing VG.

Fixes: https://tracker.ceph.com/issues/78615

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

@guits
guits requested a review from Copilot July 23, 2026 14:35
@guits
guits requested a review from a team as a code owner July 23, 2026 14:35
@guits

guits commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

jenkins ceph-volume unit tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents repeated NVMe formatting from destroying an existing Ceph VG when provisioning multiple OSDs per device.

Changes:

  • Skip NVMe preformatting when a Ceph VG already exists.
  • Add tests for fresh-device and existing-VG behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/ceph-volume/ceph_volume/objectstore/lvm.py Guards NVMe preformatting with a VG existence check.
src/ceph-volume/ceph_volume/tests/objectstore/test_lvm.py Tests preformat execution and skipping.

prepare_data_device() was calling nvme_utils.preformat() unconditionally
for every OSD slot. With --osds-per-device N, this means the second osd
reformats the device after the first OSD had already created its vg
on it which makes vgcreate fail with "device has a signature".

this commit fixes this issue by checking api.get_device_vgs() before
preformatting: if a ceph VG already exists on the device, skip the format.
This mirrors the logic create_lv() already uses to reuse an existing VG.

Fixes: https://tracker.ceph.com/issues/78615

Signed-off-by: Guillaume Abrioux <[email protected]>
@guits
guits force-pushed the fix-nvme-reformat branch from f6b6c2f to 9020d1d Compare July 24, 2026 07:02
Copilot AI review requested due to automatic review settings July 24, 2026 07:02
@guits
guits removed the request for review from Copilot July 24, 2026 07:02
@guits

guits commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@guits
guits merged commit 4d26ec1 into ceph:main Jul 29, 2026
6 checks passed
@guits
guits deleted the fix-nvme-reformat branch July 29, 2026 07:34
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.

3 participants