Skip to content

M #-: Improve infra role#173

Open
Aletibazo wants to merge 4 commits intomasterfrom
infra
Open

M #-: Improve infra role#173
Aletibazo wants to merge 4 commits intomasterfrom
infra

Conversation

@Aletibazo
Copy link

  • Add support for OVS and OVS + DPDK interfaces for infra VMs
  • Add qemu-guest-agent to infra VM template
  • Add SEARCH_DOMAIN as supported context parameter
  • Install opennebula-node-kvm and configure libvirt as part of infra tasks

- Add support for OVS and OVS + DPDK interfaces for infra VMs
- Add qemu-guest-agent to infra VM template
- Add SEARCH_DOMAIN as supported context parameter
- Install opennebula-node-kvm and configure libvirt as part of infra tasks

Signed-off-by: Alejandro Mosteiro <amosteiro@opennebula.io>
@tinova tinova removed request for dann1 and tinova February 23, 2026 13:18
{% if use_dpdk %}
<hugepages/>
{% endif %}
{% if use_virtiofs and not use_dpdk %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This logic looks incomplete, what happens if both use_virtiofs and use_dpdk are true, virtiofs stops working? If those 2 things are indeed in conflict I think it should be clearly resolved which one takes precedence. 🤔

Copy link
Author

Choose a reason for hiding this comment

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

When both are true the hugepages configuration will take place. This is enough for virtiofs, since it requires shared memory but does not require that it's type=memfd. In case only virtiofs is enabled we use memfd since we cannot asume the host has hugepages configured

Copy link
Collaborator

@sk4zuzu sk4zuzu Feb 25, 2026

Choose a reason for hiding this comment

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

Please take a look here https://libvirt.org/kbase/virtiofs.html#sharing-a-host-directory-with-a-guest

  <memoryBacking>
    <source type='memfd'/>
    <access mode='shared'/>
  </memoryBacking>

In the template

{% set use_dpdk = (infra_bridge_type is defined and infra_bridge_type == 'openvswitch_dpdk') %}
{% set use_virtiofs = ('virtiofs' in (passthrough_fs | map(attribute='driver_type') | map('default', None) | select | map('lower'))) %}

{% if use_dpdk or use_virtiofs %}
  <memoryBacking>
{% if use_dpdk %}
    <hugepages/>
{% endif %}
{% if use_virtiofs and not use_dpdk %}
    <source type='memfd'/>
{% endif %}
    <access mode='shared'/>
  </memoryBacking>
{% endif %}

So if you set infra_bridge_type: 'openvswitch_dpdk' then this line <source type='memfd'/> will simply vanish. So what I mean is if dpdk requires that option removed, then fine, ansible should throw an error if both are enabled, no? 🤔

Unless you've tested that original docs are incorrectly suggesting memory config. If so then fine. 👍 😇

Copy link
Author

Choose a reason for hiding this comment

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

Docs are correct when they suggest the use of memfd type. But in the case you enable hugepages, you already have shared memory configured, which is enough to meet virtiofs requirement. As far as I know, hugepages and memfd are mutually exclusive.

Signed-off-by: Alejandro Mosteiro <amosteiro@opennebula.io>
@Aletibazo Aletibazo requested a review from sk4zuzu February 24, 2026 11:10
@sk4zuzu
Copy link
Collaborator

sk4zuzu commented Feb 25, 2026

@Aletibazo This is really optional, but since this is called "Improve infra role" maybe we could rename *.j2 templates to *.jinja as it is the new recommended naming. For example my neovim no longer recognizes *.j2 files.. 🥹

Signed-off-by: Alejandro Mosteiro <amosteiro@opennebula.io>
Signed-off-by: Alejandro Mosteiro <amosteiro@opennebula.io>
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