Skip to content

Conversation

@vitthalmagadum
Copy link
Contributor

Change Summary

Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined

Related Issue(s)

Fixes #5880

Component(s) name

arista.avd.anta_runner

Proposed changes

Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined

How to test

run molecule

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@vitthalmagadum vitthalmagadum requested review from a team as code owners October 13, 2025 10:19
@vitthalmagadum vitthalmagadum marked this pull request as draft October 13, 2025 10:19
@github-actions
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-6005
# Activate the virtual environment
source test-avd-pr-6005/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/vitthalmagadum/avd.git@anta_runner/vxlan#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/vitthalmagadum/avd.git#/ansible_collections/arista/avd/,anta_runner/vxlan --force
# Optional: Install AVD examples
cd test-avd-pr-6005
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Oct 13, 2025
@github-actions github-actions bot added the state: conflict PR with conflict label Oct 15, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

1 similar comment
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 16, 2025
@github-actions
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review October 28, 2025 04:41
Copy link
Contributor

@MaheshGSLAB MaheshGSLAB left a comment

Choose a reason for hiding this comment

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

LGTM, just update the host vars custom structure config comment more descriptive about what we are testing so in future we dont need to look what is the test for.

@github-actions github-actions bot added the state: conflict PR with conflict label Oct 29, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 29, 2025
@github-actions
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Oct 29, 2025
@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 29, 2025
@github-actions
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

if self.device.is_vtep:
interfaces.append(InterfaceState(name="Vxlan1", status="up"))
if self.structured_config.vxlan_interface.vxlan1.vxlan.shutdown:
interfaces.append(InterfaceState(name="Vxlan1", status="down"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
interfaces.append(InterfaceState(name="Vxlan1", status="down"))
interfaces.append(InterfaceState(name="Vxlan1", status="adminDown"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Thanks!!

self.logger_adapter.debug(
LogMessage.SOURCE_INTERFACE_SHUTDOWN, interface="Vxlan1", source_interface=self.device.vxlan_source_interface_status.name
)
elif not self.structured_config.vxlan_interface.vxlan1.vxlan.vlans and not self.structured_config.vxlan_interface.vxlan1.vxlan.vrfs:
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to check for vlan_range.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the check. Thanks!!

LogMessage.SOURCE_INTERFACE_SHUTDOWN, interface="Vxlan1", source_interface=self.device.vxlan_source_interface_status.name
)
elif not self.structured_config.vxlan_interface.vxlan1.vxlan.vlans and not self.structured_config.vxlan_interface.vxlan1.vxlan.vrfs:
self.logger_adapter.debug(LogMessage.VNI_NOT_CONFIGURED, interface="Vxlan1")
Copy link
Contributor

Choose a reason for hiding this comment

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

See if you can use the existing LogMessage.INPUT_MISSING_FIELDS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might lose the original message here.

interfaces.append(InterfaceState(name="Vxlan1", status="up"))
if self.structured_config.vxlan_interface.vxlan1.vxlan.shutdown:
interfaces.append(InterfaceState(name="Vxlan1", status="down"))
elif self.device.vxlan_source_interface_status and self.device.vxlan_source_interface_status.shutdown:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we don't need this in other tests, let's just use a small helper function in AntaTestInputFactory to check if the Loopback (or DPS) interface is not shutdown. The helper could return a bool.

The VXLAN interface will also be down if an IP address is not configured on the source interface so we need to check if the Loopback (or DPS) has ip_address configured or ipv6_address if the VXLAN encapsulation is IPv6 (vxlan_interface.vxlan1.vxlan.encapsulations.ipv6).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this checks inside helper. Thanks!!

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: CI Updated CI scenario have been updated in the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat(anta_runner): Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined

5 participants