Skip to content

Additional ceph disks for clusters#84

Merged
eroussy merged 1 commit into
seapath:mainfrom
dahoat-sprecher:daho-additional-ceph-disks
May 4, 2026
Merged

Additional ceph disks for clusters#84
eroussy merged 1 commit into
seapath:mainfrom
dahoat-sprecher:daho-additional-ceph-disks

Conversation

@dahoat-sprecher
Copy link
Copy Markdown
Contributor

@dahoat-sprecher dahoat-sprecher commented Mar 6, 2026

Hello to All,

As we noticed, the guest.xml.j2 contained partial support for (one) additional disk(s) for VMs. This Pull Request adds this feature also to clusters for an arbitrary amount of disks. However, this contains also a breaking change as the inventory for a VM uses a map instead of a list:

 additional_disk:
     vdb: "../files/data.qcow2" # TODO: Replace with your disk image

However, this permits explicitly naming additional disks.
See also: seapath/ansible#893

Best regards,
Daniel

Copy link
Copy Markdown
Member

@eroussy eroussy left a comment

Choose a reason for hiding this comment

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

Hi @dahoat-sprecher

Thanks for the PR, it is a complicated one and it will have to be tested properly.
I have made some comments here and on the ansible PR. I will have another SEAPATH maintainer have a look also

Comment thread vm_manager/vm_manager_cluster.py Outdated
Comment thread vm_manager/vm_manager_cluster.py
@dahoat-sprecher dahoat-sprecher force-pushed the daho-additional-ceph-disks branch 2 times, most recently from 69820be to 3c945ff Compare March 12, 2026 08:26
@dahoat-sprecher
Copy link
Copy Markdown
Contributor Author

I rebased the branch on top of the current main branch. vm_manager_cluster.py required merging.

@dahoat-sprecher dahoat-sprecher force-pushed the daho-additional-ceph-disks branch 3 times, most recently from f9aa57d to 107c301 Compare March 17, 2026 14:36
@eroussy
Copy link
Copy Markdown
Member

eroussy commented Mar 31, 2026

Can you add an option in vm_manager CLI to add additional disks in the VM ?

@dahoat-sprecher dahoat-sprecher force-pushed the daho-additional-ceph-disks branch from 107c301 to 056a0e7 Compare April 14, 2026 09:28
@dahoat-sprecher
Copy link
Copy Markdown
Contributor Author

I added a --additional-disk CLI option to vm_manager (cluster mode). The new test file tests/test_vm_manager_cmd.py contains both argparse unit tests and an end-to-end test that drives main() through the real backend to verify the CLI→backend string contract (additional_disks).

However, I introduced some code duplication:

  • test_vm_manager_cmd.py copies ~50 lines from test_vm_manager_cluster.py:
    • TESTDATA_XML_PATH
    • the XML-reading helper
    • vm_name / qcow2_image / additional_qcow2_images fixtures (renamed to cli_*).

The duplicates exist because test_vm_manager_cluster.py defines its fixtures locally and deliberately shadows the libvirt-level vm_name fixture from tests/conftest.py with a cluster-level cleanup version.
Options

  • (A) Reorganize into tests/cluster/ with its own conftest.py, requires CI's --ignore=tests/test_vm_manager_cluster.py to be updated to --ignore=tests/cluster.
  • (B) Extract only the harmless bits (XML helper + constant), keep the fixture duplication. Minimal change, ~15 lines saved.
  • (C) Leave as-is — accept 50 lines of duplication, but keep both files independent.

Which option do you prefer?

@dahoat-sprecher dahoat-sprecher force-pushed the daho-additional-ceph-disks branch from 056a0e7 to 7e27df6 Compare April 15, 2026 07:48
Modifications so that also cluster setups support multiple disks per VM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Daniel Hofer <daniel.hofer@sprecher-automation.com>
@dahoat-sprecher dahoat-sprecher force-pushed the daho-additional-ceph-disks branch from 7e27df6 to ea4dafb Compare April 15, 2026 09:18
@sonarqubecloud
Copy link
Copy Markdown

@dahoat-sprecher dahoat-sprecher requested a review from eroussy April 15, 2026 09:20
Copy link
Copy Markdown
Member

@dupremathieu dupremathieu left a comment

Choose a reason for hiding this comment

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

LGTM

@eroussy eroussy merged commit bdd5209 into seapath:main May 4, 2026
5 checks passed
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.

Create VM with multiple disks

3 participants