Another EEM port from me I'm afraid but somehow this does not seem to work under the 9k's.
We're running VXLAN and running VSAN across racks. Now there's a limitation with VMware where if the ESXi host sees the host port up when the spine links are down, it will think that it's in VSAN isolation and then go split brain.
The 2 conditions I want to protect against are
1) both spine links go down and shut down the port.
2) if the host ports are brought up before the spine bgp session is established immediately reshut the ports.
Following is the first EEM script which i've drawn up however it looks like the boolean AND operation does not work as expected.
event manager applet BOTHDOWN event track tag eth50 50 state down event track tag eth51 51 state down tag eth50 and eth51 happens 1 in 1 action 1 cli conf t action 2 cli interface ethernet 1/1-10 action 3 cli shut action 4 cli end
Of course I can't simulate an actual link failure but best I can do is admin down the ports.
The thing is if i run int eth1/50-51 and shut only then does it trigger the EEM to shut 1 to 10.
however if I shut 50 then wait a min or 2 and then shut 51 it does not trigger.
Also when I have shut both spine links and bring up the host ports.. it does not re-trigger the EEM to re-shut the ports.
is there a different logic I should be using to achieve the protection required for the 2 scenarios above?
In the nexus 9K python cli I'm not able to parse the following syntax
cli("conf") cli("int %s" % interface) cli("sh")
according to the guide, I need to issue it as
cli ("conf ; int %s % interface ; shut")
The help only says the following
cli(cmd) Execute CLI commands. Takes CLI command string and returns show command output in a plain string form.
Arguments: cmd: Single CLI command or a Batch of CLI commands. Delimiter for mutlple CLI commands is space + semi-colon. Configuration commands need to be in a fully qualified form. For example, configure terminal ; interface ethernet1/1 ; no shutdown
Returns: string: CLI output string for show commands and an empty string for configuration commands.
Raises: cli_syntax_error: CLI command is not a valid NXOS command. cmd_exec_error: Execution of CLI command is not successful.
How can I pass variables into the cli command in the new nexus 9k please?