Troubleshooting an unexpected Commander or Standby switch selection

Cause

When a switch stack is established and a boot/reboot of the stack occurs, the Commander and Standby are selected based on the configured switch priority. Other rules in the election process can override this priority.

switch(config)# show running-config

; Stack Configuration Editor; Created on release #:WB.15.11.0000x
; Ver #:01:00:01

hostname "switch"
stacking
member 1 type "J9726A" mac-address 1cc1de-4d87c0
member 2 type "J9726A" mac-address 1cc1de-4dc740
member 3 type "J9728A" mac-address 1cc1de-4dbd40
member 3 priority 200
member 4 type "J9729A" mac-address 1cc1de-4d79c0
member 4 priority 175

On a boot of the stack, member 3 becomes a Commander and member 4 becomes a Standby, based on priority. If this were a chain with member 1 at one end of the chain and member 4 at the other end, the number of hops between switches will be part of the election process.