Closed yujiterada closed 4 years ago
@JackStromberg or @MitchellGulledge, please create a new branch specifically for this fix so I can create a pull request with the possible solution.
@yujiterada new branch created. Check out https://github.com/MitchellGulledge/Meraki-vWAN/tree/MX-HA-Support
Fixed in PR #12
Currently, the script does not work with all scenarios with a MX HA setup.
If the MX in active and standby have a same public IP address for their WAN port, the script will succeed. This is a scenario in which there is a router in the upstream which NATs the private IP address of the MX WAN IP to a single public IP.
If the MX in active and standby have a different public IP address for their WAN port, the script will fail.
Expected Behavior
Should handle all scenarios for MX HA.
Current Behavior
Finds the first MX returned in getNetworkDevices, and this MX can be the active or standby. The script can provision the tunnel for the standby MX. If it provisions a tunnel for the active MX, the tunnel will fail after failover.
Possible Solution
Change get_mx_from_network_devices to return a list and not a dictionary.
if len < 1, then exit as MX does not exist in network if len == 1, then a single MX exists in the network and apply current logic if len > 1, then MX is in HA in the network, and therefore gather public IPs for both MXs for creating a VPN site for both the active and standby MX
Steps to Reproduce