QualiSystems / QualiSystems/cloudshell-networking-cisco

Switchport VLAN 1 Default Condition Causing Failures on Setup

Open
#140 0 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
7
Avg merge
18m
Merged PRs (30d)
2

Description

The default state of the config for an interface is on VLAN 1 as switchport. This is the state the Cloudshell returns the port to after it returns the resource to the general pool. However, some switches show that the VLAN1 is set, while others do not (as it is implied). For instance, we have two different switch ports on different switches that have the following configuration after Cloudshell tears down the environment:

CORE_SWITCH(config-if)#do show run interface GigabitEthernet110/1/0/6
Building configuration...

Current configuration : 144 bytes
!
interface GigabitEthernet110/1/0/6
 description KG-255X-06-PT
 switchport
 switchport trunk allowed vlan 1
 switchport mode dynamic auto
end
CORE_SWITCH(config-if)#do show run interface te1/5/10
Building configuration...

Current configuration : 85 bytes
!
interface TenGigabitEthernet1/5/10
 description SPIRENT Port 2/10
 switchport
end

Both of these configurations are actually the same. The second interface is indeed on vlan 1, but it is implied and it doesn't show. We have a mixed bag based on switch and IOS version of what shows with the configuration command.

Due to this, if the switchport trunk allowed vlan 1 shows in the run interface command, Cloudshell setup fails when attempting to setup VLAN connectivity on this port due to the following:
The logic in here runs a check
here and since the switchport ... vlan is present in the config, it fails to identify that all VLANS were cleared thus failing the VLAN connectivity.

We get an error on cloudshell side of the following:

2025-11-06 13:04:52,478 - QS.cisco_switch_pt.Thread-5 - ERROR - Failed to apply VLAN changes () for target cisco_switch_pt/Chassis 1-1/Module 1/GigabitEthernet110-1-0-5. Error: ('CiscoConnectivityFlow', '[FAIL] VLAN(s) ALL removal failed')
Traceback (most recent call last):
  File "C:\ProgramData\QualiSystems\venv\Cisco_IOS_Switch_2G_1_13\lib\site-packages\cloudshell\shell\flows\connectivity\basic_flow.py", line 54, in _wait_futures
    result: ConnectivityActionResult = future.result()
  File "C:\Program Files (x86)\QualiSystems\TestShell\ExecutionServer\python\3\lib\concurrent\futures\_base.py", line 438, in result
    return self.__get_result()
  File "C:\Program Files (x86)\QualiSystems\TestShell\ExecutionServer\python\3\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "C:\Program Files (x86)\QualiSystems\TestShell\ExecutionServer\python\3\lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\ProgramData\QualiSystems\venv\Cisco_IOS_Switch_2G_1_13\lib\site-packages\cloudshell\networking\cisco\flows\cisco_connectivity_flow.py", line 141, in _remove_vlan
    msg = self._remove_vlan_flow(vlan_range, full_name)
  File "C:\ProgramData\QualiSystems\venv\Cisco_IOS_Switch_2G_1_13\lib\site-packages\cloudshell\networking\cisco\flows\cisco_connectivity_flow.py", line 210, in _remove_vlan_flow
    raise Exception(
Exception: ('CiscoConnectivityFlow', '[FAIL] VLAN(s) ALL removal failed')

Some condition needs to be added to this method to add in the case for if the switchport trunk allowed vlan 1 being present in the config since this is the default state for a switchport on some cisco switch flavors.

Note: If we set the port to routed (no switchport), the reservation does succeed, but on teardown, it places the port configuration back into the default state which has switchport vlan 1 present so all subsequent uses of this port fail.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.