Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting virt-bridge to "none" to disable all network configuration #96

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

opoplawski
Copy link
Contributor

I'm still kind of mulling this over, but figured I would get it out there for more comments.

My use case is that I want to install VMs with SR-IOV hostdev interfaces. Unfortunately, virt-install does not yet support this (see virt-manager/virt-manager#500), so the only way I've figured to do this is as follows:

sudo koan --server=${COBBLER_SERVER} --virt --system ${name} --graphics spice --virt-type kvm --qemu-disk-type scsi ${opts}

# Remove any bridged interface setup for the hostdev MAC and attach the hostdev interface
if [ -n "$hostdev" ]
then
   virsh detach-interface ${name} bridge --mac ${hostdev_mac} --live --config || :
   virsh nodedev-detach pci_0000_${hostdev//[:.]/_}
   virsh attach-interface ${name} hostdev 0000:${hostdev} --mac ${hostdev_mac}
fi

It's somewhat cleaner and I can ditch the detach-interface call if I don't have any networks configured for the VM in the first place.

I'm not sure if there are any other use-cases for configuring a VM without a network interface.

The other TODO is to get cobbler to be able to save the information needed for hostdev interface configurations, namely the PCI ID and that it is the type hostdev. But that isn't really useful until virt-install supports it.

@SchoolGuy
Copy link
Member

I like the idea of being able to handle an "empty" network interface. As such please go ahead with your plan from my side.

@opoplawski
Copy link
Contributor Author

Trying to enumerate various uses cases:

  • Normal - every interface has an associated virt_bridge
  • No network config at all. Options for configuring;
    • A system level virt option to disable networking. Probably best?
    • Specify 'none' for virt_bridge. What to do if one interface is 'none' and another has a bridge specified?
  • Partial - some interfaces have bridges, some are blank
  • Hostdev only interface
  • Mixed bridged and hostdev interfaces

@SchoolGuy
Copy link
Member

So far my experience with Koan & Virtualization is limited. I will ask at work if this would cover all cases our virt team can imagine.

@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 4.08%. Comparing base (34360a8) to head (b39c4c8).

❗ Current head b39c4c8 differs from pull request most recent head 792c74b. Consider uploading reports for the commit 792c74b to get more accurate results

Files Patch % Lines
koan/virtinstall.py 0.00% 9 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##            main     #96      +/-   ##
========================================
- Coverage   4.08%   4.08%   -0.01%     
========================================
  Files         12      12              
  Lines       2152    2154       +2     
========================================
  Hits          88      88              
- Misses      2064    2066       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SchoolGuy SchoolGuy merged commit 803d356 into cobbler:main Apr 1, 2024
14 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.

3 participants