osism / issues

This repository is used for bug reports that are cross-project or not bound to a specific repository (or to an unknown repository).
https://www.osism.tech
1 stars 1 forks source link

osism-generic network would not include variables from configuration.yaml #962

Closed gravityscout closed 7 months ago

gravityscout commented 7 months ago

Hello there,

We were running osism-generic network -l network,control in order to provide the compute nodes with an updated MTU value. The MTU value is defined via $network_mtu in /opt/configuration/environments/kolla/configuration.yml along with many other variables.

Now osism-generic would fail with the following:

ASK [osism.commons.network : Prepare netplan configuration template] *******************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleFilterError: to_nice_yaml - {'vceph_backend': {'addresses': ["{{ ceph_private_network | ansible.utils.ipmath(node_id) }}/{{ ceph_private_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1313, 'link': 'bexternal', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ ceph_private_network }}', 'via': '{{ ceph_private_network | ansible.utils.ipmath(1) }}'}]}, 'vceph_frontend': {'addresses': ["{{ ceph_public_network | ansible.utils.ipmath(node_id) }}/{{ ceph_public_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1309, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ ceph_public_network }}', 'via': '{{ ceph_public_network | ansible.utils.ipmath(1) }}'}]}, 'vmanagement': {'addresses': ["{{ management_network | ansible.utils.ipmath(node_id) }}/{{ management_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1306, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'nameservers': {'addresses': ['10.40.64.205'], 'search': ['lab.infra.il.thlrz.de']}, 'routes': [{'to': 'default', 'via': '{{ management_network | ansible.utils.ipmath(1) }}'}]}, 'vmonitoring': {'addresses': ["{{ monitoring_network | ansible.utils.ipmath(node_id) }}/{{ monitoring_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1314, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ monitoring_network }}', 'via': '{{ monitoring_network | ansible.utils.ipmath(1) }}'}]}, 'vprovider': {'id': 1340, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}'}}: 'ceph_private_network' is undefined. 'ceph_private_network' is undefined. {'vceph_backend': {'addresses': ["{{ ceph_private_network | ansible.utils.ipmath(node_id) }}/{{ ceph_private_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1313, 'link': 'bexternal', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ ceph_private_network }}', 'via': '{{ ceph_private_network | ansible.utils.ipmath(1) }}'}]}, 'vceph_frontend': {'addresses': ["{{ ceph_public_network | ansible.utils.ipmath(node_id) }}/{{ ceph_public_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1309, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ ceph_public_network }}', 'via': '{{ ceph_public_network | ansible.utils.ipmath(1) }}'}]}, 'vmanagement': {'addresses': ["{{ management_network | ansible.utils.ipmath(node_id) }}/{{ management_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1306, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'nameservers': {'addresses': ['10.40.64.205'], 'search': ['lab.infra.il.thlrz.de']}, 'routes': [{'to': 'default', 'via': '{{ management_network | ansible.utils.ipmath(1) }}'}]}, 'vmonitoring': {'addresses': ["{{ monitoring_network | ansible.utils.ipmath(node_id) }}/{{ monitoring_network | ansible.utils.ipaddr('prefix') }}"], 'id': 1314, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}', 'routes': [{'to': '{{ monitoring_network }}', 'via': '{{ monitoring_network | ansible.utils.ipmath(1) }}'}]}, 'vprovider': {'id': 1340, 'link': 'bmanagement', 'mtu': '{{ network_mtu }}'}}: 'ceph_private_network' is undefined. 'ceph_private_network' is undefined

We set $network_mtu additionally in /opt/configuration/inventory/group_vars/generic.yml , otherwise it wouldn't be available to osism-generic network. However, now it just remarks the next variable, in our case $ceph_private_network as being undefined.

In conclusion: Why aren't variables from configuration.yaml available to osism-generic network -l network,control ?

Kind regards

berendt commented 7 months ago

Variables defined in environments/kolla are available to the playbooks from Kolla. The network playbook is a generic playbook, it uses the variables from environments/generic.

The parameters from environments/configuration.yml are also available to all playbooks. Same for the parameters defined in the inventory.

Please note that the osism-generic (and similar commands) are no longer supported and will be removed in the future.

gravityscout commented 7 months ago

Alright, thank you! That makes a lot of sense, obviously.

I suspect, in our case we would have to go with something like osism-kolla reconfigure <someparameter> -l network,control then?

osism-kolla also tells me about being deprecated, however.

Could you hint the current approach to provide nodes from openstack compute service list with an updated network_mtu? Either with environments/configuration.yaml or environments/kolla/configuration.yaml.

berendt commented 7 months ago

Where does the network_mtu parameter come from? At least it is not used by our roles and nowhere in Kolla either. If you want to change the MTU of a network interface, you have to change the network configuration of the respective nodes in the inventory/host_vars. This is documented here: https://osism.tech/docs/guides/configuration-guide/commons/network. Guide for the netplan configuration is here: https://netplan.readthedocs.io/en/stable/netplan-yaml/

You can change the network configuration with osism apply network. Afterwards change the generated network configuration in /etc/netplan/01-osism.yml and apply the network configuration with sudo netplan apply.