Skip to content

vstart.sh: create cephfs with fs new instead of fs volume create - #69901

Merged
idryomov merged 1 commit into
ceph:mainfrom
tchaikov:wip-vstart-without-mgr
Jul 2, 2026
Merged

idryomov merged 1 commit into
ceph:mainfrom
tchaikov:wip-vstart-without-mgr

Conversation

@tchaikov

@tchaikov tchaikov commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

vstart.sh already supports CEPH_NUM_MGR=0 (start_mgr is gated on it), but cephfs creation didn't honor it: fs volume ls/create are handled by the mgr volumes module, not the monitor, so without a mgr the "wait for volume module to load" loop spins forever. A ceph-build typo fix (ed61da39dff8) that made -WITH_MGR=OFF finally take effect surfaced this on Windows CI.

fs volume create is just three mon commands: create cephfs..{meta,data}, then fs new (volumes/fs/operations/volume.py, fs_util.py). Doing them directly drops the mgr dependency and keeps the same pool names the Windows CI script expects afterward.

Verified against the Windows CI vstart invocation (CEPH_NUM_MGR=0 --bluestore --without-dashboard -n): HEALTH_OK, mgr: no daemons active, fs dump shows filesystem 'a' active.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@idryomov

idryomov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

1 similar comment
@tchaikov

tchaikov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@idryomov
idryomov requested a review from a team July 2, 2026 08:22
Comment thread src/vstart.sh Resolved
@tchaikov
tchaikov force-pushed the wip-vstart-without-mgr branch from 2f69a79 to 8035540 Compare July 2, 2026 09:28
@tchaikov

tchaikov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

changelog:

  • extract a helper func to wait for the volumes plugin and use it to perform fs new / run fs new manually.

@dparmar18 dparmar18 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.

lgtm

The mgr volumes module handles fs volume ls/create, not the monitor, so
without a mgr (CEPH_NUM_MGR=0) the "wait for volume module to load" loop
spun forever. Open-coding fs new unconditionally, my first attempt,
changed pool creation for every vstart user and dropped the wait, so
cephfs tests calling `fs volume ...` right after vstart.sh returns could
race a module still mid-load.

create_fs_volume() branches on CEPH_NUM_MGR instead. With a mgr it still
calls fs volume ls/create. Without one it runs the plain mon commands fs
volume create wraps: osd pool create cephfs.<name>.{meta,data}, then fs
new <name> <meta> <data>. The wait stays at its one call site above the
per-filesystem loop, so it runs once regardless of CEPH_NUM_FS, not once
per filesystem.

Verified against a local vstart: mgr present, fs volume ls polls once
then creates CEPH_NUM_FS=2 filesystems with no repeated poll;
CEPH_NUM_MGR=0, no poll, fs new creates 'a' directly, HEALTH_OK.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-vstart-without-mgr branch from 8035540 to bb9c1fd Compare July 2, 2026 10:41
@tchaikov

tchaikov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

changelog

  • move the wait for ceph_adm fs volume ls out of the helper func, so the wait loop is executed only once.

@tchaikov
tchaikov requested a review from idryomov July 2, 2026 10:45
@idryomov

idryomov commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor
_______________ TestSchedule.test_created_now[simple_schedule0] ________________
[gw38] linux -- Python 3.10.12 /ceph/src/pybind/mgr/.tox/py3/bin/python

self = <snap_schedule.tests.fs.test_schedule.TestSchedule object at 0xfffee01f4ee0>
simple_schedule = <snap_schedule.fs.schedule.Schedule object at 0xfffedf48e1d0>

    def test_created_now(self, simple_schedule):
        now = datetime.datetime.now(datetime.timezone.utc)
>       assert simple_schedule.created.minute == now.minute
E       assert 13 == 14
E        +  where 13 = datetime.datetime(2026, 7, 2, 11, 13, 59, 998283, tzinfo=datetime.timezone.utc).minute
E        +    where datetime.datetime(2026, 7, 2, 11, 13, 59, 998283, tzinfo=datetime.timezone.utc) = <snap_schedule.fs.schedule.Schedule object at 0xfffedf48e1d0>.created
E        +  and   14 = datetime.datetime(2026, 7, 2, 11, 14, 0, 15569, tzinfo=datetime.timezone.utc).minute

snap_schedule/tests/fs/test_schedule.py:65: AssertionError

All but the last assertion in this CephFS test are racy:

    def test_created_now(self, simple_schedule):
        now = datetime.datetime.now(datetime.timezone.utc)
        assert simple_schedule.created.minute == now.minute
        assert simple_schedule.created.hour == now.hour
        assert simple_schedule.created.day == now.day
        assert simple_schedule.created.month == now.month
        assert simple_schedule.created.year == now.year
        assert simple_schedule.created.tzinfo == now.tzinfo

The current minute, hour, day, month and even year can change underneath the test.

@idryomov

idryomov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@tchaikov

tchaikov commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor Author
_______________ TestSchedule.test_created_now[simple_schedule0] ________________
[gw38] linux -- Python 3.10.12 /ceph/src/pybind/mgr/.tox/py3/bin/python

self = <snap_schedule.tests.fs.test_schedule.TestSchedule object at 0xfffee01f4ee0>
simple_schedule = <snap_schedule.fs.schedule.Schedule object at 0xfffedf48e1d0>

    def test_created_now(self, simple_schedule):
        now = datetime.datetime.now(datetime.timezone.utc)
>       assert simple_schedule.created.minute == now.minute
E       assert 13 == 14
E        +  where 13 = datetime.datetime(2026, 7, 2, 11, 13, 59, 998283, tzinfo=datetime.timezone.utc).minute
E        +    where datetime.datetime(2026, 7, 2, 11, 13, 59, 998283, tzinfo=datetime.timezone.utc) = <snap_schedule.fs.schedule.Schedule object at 0xfffedf48e1d0>.created
E        +  and   14 = datetime.datetime(2026, 7, 2, 11, 14, 0, 15569, tzinfo=datetime.timezone.utc).minute

snap_schedule/tests/fs/test_schedule.py:65: AssertionError

All but the last assertion in this CephFS test are racy:

    def test_created_now(self, simple_schedule):
        now = datetime.datetime.now(datetime.timezone.utc)
        assert simple_schedule.created.minute == now.minute
        assert simple_schedule.created.hour == now.hour
        assert simple_schedule.created.day == now.day
        assert simple_schedule.created.month == now.month
        assert simple_schedule.created.year == now.year
        assert simple_schedule.created.tzinfo == now.tzinfo

The current minute, hour, day, month and even year can change underneath the test.

hmm, will create a PR to fix it.

EDIT, created #69918

@idryomov

idryomov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

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.

3 participants