Troubleshooting an unexpected Commander or Standby switch selection

Action
Viewing the running configuration with priority

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

switch(config)# show running-config 

Running configuration:

; hpStack_WC Configuration Editor; Created on release #WC.16.04.0000x
; Ver #10:9b.3f.bf.bb.ef.7c.59.fc.6b.fb.9f.fc.ff.ff.37.ef:ad

stacking
   member 1 type "JL321A" mac-address 941882-d83c40
   member 2 type "JL319A" mac-address 941882-d91a40
   member 3 type "JL321A" mac-address 941882-d9a240
   member 3 priority 200
   member 3 flexible-module A type JL078A
   member 4 type "JL319A" mac-address 941882-d9e900
   member 4 priority 175
   member 4 flexible-module A type JL078A
   member 5 type "JL319A" mac-address 941882-da0f40
   member 5 flexible-module A type JL083A
   exit
hostname "Aruba-Stack-2930M"
snmp-server community "public" unrestricted
oobm
   ip address dhcp-bootp
   member 1
-- MORE --, next page: Space, next line: Enter, qu      ip address dhcp-bootp
      exit
   member 2
      ip address dhcp-bootp
      exit
   member 3
      ip address dhcp-bootp
      exit
   member 4
      ip address dhcp-bootp
      exit
   member 5
      ip address dhcp-bootp
      exit
   exit
vlan 1
   name "DEFAULT_VLAN"
   untagged 1/1-1/48,2/1-2/24,3/1-3/48,3/A1,4/1-4/24,4/A1,5/A1-5/A4
   ip address dhcp-bootp
   exit

switch(config)#

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 5 at the other end, the number of hops between switches will be part of the election process.