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

virt_net modify only affects the running config #46

Open
gprocunier opened this issue Sep 19, 2020 · 1 comment
Open

virt_net modify only affects the running config #46

gprocunier opened this issue Sep 19, 2020 · 1 comment

Comments

@gprocunier
Copy link

SUMMARY

virt_net with command modify only affects the current/running version of the network being modified and not the actual startup config. There is no way to make changes made by modify permanent.

res = network.update(libvirt.VIR_NETWORK_UPDATE_COMMAND_ADD_LAST,
libvirt.VIR_NETWORK_SECTION_IP_DHCP_HOST,
-1, xml, libvirt.VIR_NETWORK_UPDATE_AFFECT_CURRENT)

res = network.update(libvirt.VIR_NETWORK_UPDATE_COMMAND_MODIFY,
libvirt.VIR_NETWORK_SECTION_IP_DHCP_HOST,
-1, xml, libvirt.VIR_NETWORK_UPDATE_AFFECT_CURRENT)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

virt_net

ANSIBLE VERSION
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /bin/ansible
  python version = 3.6.8 (default, Jun 12 2019, 01:12:31) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]
CONFIGURATION
OS / ENVIRONMENT

Linux 4.18.0-80.11.2.el8_0.x86_64 #1 SMP Sun Sep 15 11:24:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

STEPS TO REPRODUCE
call something like the following from a playbook

virt_net:
  command: modify
  name: default
  xml: "<host mac='de:ad:be:ef:00:00' name='deadbeef' ip='192.168.122.50'/>"

' virsh net-dumpxml default' will show the current running config with the modifcation, however doing a virsh net-edit default will not reflect the changes as the update method in the module only affects the running config.

eg

# virsh net-update --help
  NAME
    net-update - update parts of an existing network's configuration

  SYNOPSIS
    net-update <network> <command> <section> <xml> [--parent-index <number>] [--config] [--live] [--current]

  OPTIONS
    [--network] <string>  network name or uuid
    [--command] <string>  type of update (add-first, add-last (add), delete, or modify)
    [--section] <string>  which section of network configuration to update
    [--xml] <string>  name of file containing xml (or, if it starts with '<', the complete xml element itself) to add/modify, or to be matched for search
    --parent-index <number>  which parent object to search through
    --config         affect next network startup  <--- this
    --live           affect running network
    --current        affect current state of network
see above
EXPECTED RESULTS

that both the startup config and the running/current be updated .. or there be some way to specify which config to modify

ACTUAL RESULTS

n/a

@nodiscc
Copy link

nodiscc commented Jun 12, 2023

This was supposedly fixed in #107 (I believe it's the same bug), but I can confirm this behavior is still present.

Ansible 8.0.0, community.libvirt 1.2.0

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

No branches or pull requests

2 participants