Skip to content
  • Leigh B Stoller's avatar
    Fixes for vlan modification, specifically shared vlans, DeleteNotes() · 1a3b52ef
    Leigh B Stoller authored
    and swapmod, where we use -X (syncVlansFromTables) to update existing
    vlans:
    
    The basic problem to solve is leaving vlans (and their lanid) behind on
    switches that later interfere with a new lanid that uses the same tag.
    
    Consider: when we create a new vlan, we operate on only the devices
    needed to create that vlan (the stack object is created with those
    devices). Then we reserve a vlan tag, asking the stack for a number that
    does not exist on any devices in the stack. But it won't know about a
    stale vlan with that number on some other device. Later we add more
    ports to the shared vlan, on different devices (which includes the
    interswitch trunk links).  We do not check to see if that vlan is
    already on some of those devices with a different or no name, We just
    plow ahead. What happens is somewhat switch dependent, but usually
    something happens without an error.
    
    And the main reason for leaving these behind, is that while we remove
    the vlans from ports on the interswitch links, we do not remove the vlan
    from the switches. Next time we come along and modify or delete the
    vlan, the stack might not include those switches.
    
    So ... the main effect of this commit is to try much harder in
    setVlanOnSwitchTrunks(), to remove vlans from switches that no longer
    have any ports in that vlan. We shall see how well this works ...
    
    Note that shared vlans do not store the current switch path in the DB,
    which is a handy debugging item. This commit changes that; we know store
    the switch path in the DB, although in order to do that, we need to
    serialize snmpit on shared vlans. This is seems fine, we do not do that
    many shared vlans.
    1a3b52ef