<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create mLAG Port with XMC Python in Scripting</title>
    <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90548#M499</link>
    <description>&lt;P&gt;I’m writing a python script to create MLAG port.&amp;nbsp; Since the config will vary slightly between 2 devices, is it possible to write this in a single script and apply to 2 devices?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my script so far.&lt;/P&gt;&lt;P&gt;#@METADATASTART&lt;BR /&gt;#@ScriptDescription "Create mLAG Port"&lt;BR /&gt;#@DetailDescriptionStart&lt;BR /&gt;##############################################################################&lt;BR /&gt;#&lt;BR /&gt;# Purpose: Create mLAG Port&lt;BR /&gt;#&lt;BR /&gt;# Version : 1.0&lt;BR /&gt;#&lt;BR /&gt;##############################################################################&lt;BR /&gt;#@DetailDescriptionEnd&lt;BR /&gt;#&lt;BR /&gt;#@SectionStart ( description = "mLAG Section")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG VLAN Name",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "mLAG-ISL",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagName"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG VLAN ID",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "4092",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagId"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@SectionStart ( description = "mLAG ISL Port")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG ISL Port",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "port_number",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagPort"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@SectionStart ( description = "mLAG Peer")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG Peer",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "peer_switch",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagPeer"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#@MetaDataEnd&lt;/P&gt;&lt;P&gt;import re&lt;BR /&gt;import commands&lt;/P&gt;&lt;P&gt;def allowedSigns(tagged_vlans):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; reg = re.compile(r'[^0-9,]')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; string = reg.search(tagged_vlans)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return not bool(string)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def vlanCheck(tagged_vlans):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if allowedSigns(tagged_vlans) == True:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vlanList = tagged_vlans.split(",")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for v in vlanList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if int(v) &amp;gt; 4094 or int(v) &amp;lt; 1 or int(v) == 4051 or int(v) == 4052:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Error not a valid vlan id" + v&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Wrong character in vlan list, use only digits and \",\" as separator, please!"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def main():&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; varMlagName = emc_vars["MlagName"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagId = emc_vars["MlagId"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagPort = emc_vars["MlagPort"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagPeer = emc_vars["MlagPeer"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;#varDeviceName = emc_vars["deviceName"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if "port" in emc_vars:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ports = emc_vars["port"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Please select at least one PORT if you start the script"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; print("The name of the device is :" + emc_vars["deviceName"])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; #create mlag if needed#&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("disable clipaging")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("show mlag peer")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlag = cli_result.getOutput()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlag_vlan = re.findall(r"VLAN\s+:\s\S{3,15}", mlag)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlagid = [s.strip('VLAN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ') for s in mlag_vlan]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if mlagid:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("mLAG id is: ", mlagid)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("mLAG does not exist. &amp;nbsp;Creating ISC...")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("create vlan " + varMlagName)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " tag " + varMlagId)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " add ports " + varMlagPort + " tagged")&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " ipaddress 169.254.40.93 255.255.255.252")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("enable sharing " + ports + " grouping " + ports + " algorithm address-based L3_L4") #create LACP option#&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("create mlag peer " + varMlagPeer)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure mlag peer " + varMlagPeer + " ipaddress 169.254.40.94 vr VR-Default")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("enable mlag port " + ports + " peer " + varMlagPeer + " id 1")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;main()&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 03:50:26 GMT</pubDate>
    <dc:creator>cslayton</dc:creator>
    <dc:date>2020-10-15T03:50:26Z</dc:date>
    <item>
      <title>Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90548#M499</link>
      <description>&lt;P&gt;I’m writing a python script to create MLAG port.&amp;nbsp; Since the config will vary slightly between 2 devices, is it possible to write this in a single script and apply to 2 devices?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my script so far.&lt;/P&gt;&lt;P&gt;#@METADATASTART&lt;BR /&gt;#@ScriptDescription "Create mLAG Port"&lt;BR /&gt;#@DetailDescriptionStart&lt;BR /&gt;##############################################################################&lt;BR /&gt;#&lt;BR /&gt;# Purpose: Create mLAG Port&lt;BR /&gt;#&lt;BR /&gt;# Version : 1.0&lt;BR /&gt;#&lt;BR /&gt;##############################################################################&lt;BR /&gt;#@DetailDescriptionEnd&lt;BR /&gt;#&lt;BR /&gt;#@SectionStart ( description = "mLAG Section")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG VLAN Name",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "mLAG-ISL",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagName"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG VLAN ID",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "4092",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagId"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@SectionStart ( description = "mLAG ISL Port")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG ISL Port",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "port_number",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagPort"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#@SectionEnd&lt;BR /&gt;#@SectionStart ( description = "mLAG Peer")&lt;BR /&gt;#@VariableFieldLabel (&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description &amp;nbsp; = "mLAG Peer",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= String,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scope &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = global,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;required &amp;nbsp; &amp;nbsp; &amp;nbsp;= yes,&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "peer_switch",&lt;BR /&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= "MlagPeer"&lt;BR /&gt;# &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;#@MetaDataEnd&lt;/P&gt;&lt;P&gt;import re&lt;BR /&gt;import commands&lt;/P&gt;&lt;P&gt;def allowedSigns(tagged_vlans):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; reg = re.compile(r'[^0-9,]')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; string = reg.search(tagged_vlans)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return not bool(string)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def vlanCheck(tagged_vlans):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if allowedSigns(tagged_vlans) == True:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vlanList = tagged_vlans.split(",")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for v in vlanList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if int(v) &amp;gt; 4094 or int(v) &amp;lt; 1 or int(v) == 4051 or int(v) == 4052:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Error not a valid vlan id" + v&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Wrong character in vlan list, use only digits and \",\" as separator, please!"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def main():&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; varMlagName = emc_vars["MlagName"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagId = emc_vars["MlagId"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagPort = emc_vars["MlagPort"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; varMlagPeer = emc_vars["MlagPeer"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;#varDeviceName = emc_vars["deviceName"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if "port" in emc_vars:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ports = emc_vars["port"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print "Please select at least one PORT if you start the script"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; print("The name of the device is :" + emc_vars["deviceName"])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; #create mlag if needed#&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("disable clipaging")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("show mlag peer")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlag = cli_result.getOutput()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlag_vlan = re.findall(r"VLAN\s+:\s\S{3,15}", mlag)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; mlagid = [s.strip('VLAN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ') for s in mlag_vlan]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if mlagid:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("mLAG id is: ", mlagid)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("mLAG does not exist. &amp;nbsp;Creating ISC...")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("create vlan " + varMlagName)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " tag " + varMlagId)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " add ports " + varMlagPort + " tagged")&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure vlan " + varMlagName + " ipaddress 169.254.40.93 255.255.255.252")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("enable sharing " + ports + " grouping " + ports + " algorithm address-based L3_L4") #create LACP option#&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("create mlag peer " + varMlagPeer)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("configure mlag peer " + varMlagPeer + " ipaddress 169.254.40.94 vr VR-Default")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cli_result = emc_cli.send("enable mlag port " + ports + " peer " + varMlagPeer + " id 1")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;main()&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 03:50:26 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90548#M499</guid>
      <dc:creator>cslayton</dc:creator>
      <dc:date>2020-10-15T03:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90549#M500</link>
      <description>&lt;P&gt;Hello cslayton,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;did you see the the System Workflow “Configure ISC and MLAG Peers on EXOS” (in System Workflows-&amp;gt;Config-&amp;gt;LAG-MLAG)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe that Workflow do the work for you. Or did you miss something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;	&lt;P&gt;&amp;nbsp;&lt;/P&gt;	&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 15 Oct 2020 12:16:08 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90549#M500</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2020-10-15T12:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90550#M501</link>
      <description>&lt;P&gt;Hello cslyton,&lt;/P&gt;&lt;P&gt;Regarding your original question. You have among others the following options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Either you select both partners (switches) at the beginning of your workflow that belong to your MLAG and use variables to make sure that the Config fits once for the left and once for the right (you can use the emc_vars to query which switch is currently configured).&lt;/LI&gt;	&lt;LI&gt;Or you can start the workflow with the first switch and then change the IP to the second switch and continue working with them. (How this works is described here:&amp;nbsp;&lt;A href="https://extreme.connectedcommunity.org/communities/community-home/digestviewer/view-question?ContributedContentKey=9dffe261-afd6-4045-afd6-086c867460f3&amp;amp;CommunityKey=d4b57428-7c7e-4bce-886a-356352ffa2c0&amp;amp;tab=digestviewer" target="_self" rel="noreferrer"&gt;https://community.extremenetworks.com/extrememanagement-230297/set-switch-ip-at-runtime-in-workflow-or-script-7815564&lt;/A&gt;)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 12:24:42 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90550#M501</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2020-10-15T12:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90551#M502</link>
      <description>&lt;P&gt;cslayton,&lt;/P&gt;&lt;P&gt;Did checked the standard&amp;nbsp;workflow for this on the XMC?&lt;/P&gt;&lt;P&gt;It is located at Tasks/Workflows/System Workflows/Syste/Config/LAG-MLAG/&lt;STRONG&gt;Configure ISC and MLAG Peers on EXOS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mig&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 14:14:20 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90551#M502</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-15T14:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90552#M503</link>
      <description>&lt;P&gt;Hey Mig,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also suggested this above&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="7bc740d41c8d452e83ca7cc5e738d199_1f609.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/5762iBF8C37B1B194CEB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="7bc740d41c8d452e83ca7cc5e738d199_1f609.png" alt="7bc740d41c8d452e83ca7cc5e738d199_1f609.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 14:56:10 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90552#M503</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2020-10-15T14:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90553#M504</link>
      <description>&lt;P&gt;It’s too early for me&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="95e448731e8f445d887eaf69db18a4c0_1f60a.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/525iA7029B7AC2263EDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="95e448731e8f445d887eaf69db18a4c0_1f60a.png" alt="95e448731e8f445d887eaf69db18a4c0_1f60a.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 15:05:42 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90553#M504</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-15T15:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90554#M505</link>
      <description>&lt;P&gt;If you enable the Multi-Device menu option for the script, it can then be executed against 2 (or more) switches at the same time. What happens then is that your script gets executed simultaneously against multiple switches (i.e. you get multiple threads of the same script) each instance will have the same inputs but will operate against a different switch IP.&lt;/P&gt;&lt;P&gt;So that will work; the problem is if you need those instances to get inputs from each other, as there is no mechanism in XMC to exchange data between those threads.&lt;/P&gt;&lt;P&gt;Another approach is to use workflows (not scripts) and let the workflow take both switch IPs from the start (so 1 single workflow thread) and then have parallel activities within the workflow, on both switches; here it is possible to exchange data inside the workflow.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 16:10:18 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90554#M505</guid>
      <dc:creator>Ludovico_Steven</dc:creator>
      <dc:date>2020-10-15T16:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90555#M506</link>
      <description>&lt;P&gt;another way could to enable “orchestration mode” before doing portconfig. Than the switch is doing a sync by themself.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 18:03:26 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90555#M506</guid>
      <dc:creator>PeterK</dc:creator>
      <dc:date>2020-10-15T18:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90556#M507</link>
      <description>&lt;P&gt;Thanks all for your replies!&amp;nbsp; I am new to XMC and completely missed the “workflow” section.&amp;nbsp; However, in my workflow tab I don’t see&amp;nbsp;&lt;STRONG&gt;Configure ISC and MLAG Peers on EXOS. See screenshot.&amp;nbsp; I’m wondering if this is a permissions issue.&lt;/STRONG&gt;&lt;/P&gt;&lt;FIGURE&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="a8c767afe08541a1a7dafffcc5bdbb01_8c083382-4736-4f41-bdd0-fed1c4101a2c.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/5361i3531FB34EC496ADF/image-size/large?v=v2&amp;amp;px=999" role="button" title="a8c767afe08541a1a7dafffcc5bdbb01_8c083382-4736-4f41-bdd0-fed1c4101a2c.png" alt="a8c767afe08541a1a7dafffcc5bdbb01_8c083382-4736-4f41-bdd0-fed1c4101a2c.png" /&gt;&lt;/span&gt;&lt;/FIGURE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 01:42:30 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90556#M507</guid>
      <dc:creator>cslayton</dc:creator>
      <dc:date>2020-10-16T01:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90557#M508</link>
      <description>&lt;P&gt;What version of XMC are you running?&lt;/P&gt;&lt;P&gt;Mig&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 01:46:06 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90557#M508</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-16T01:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90558#M509</link>
      <description>&lt;P&gt;&lt;USER-MENTION data-id="9728928"&gt;@Miguel-Angel RODRIGUEZ-GARCIA&lt;/USER-MENTION&gt;&amp;nbsp;&lt;/P&gt;&lt;FIGURE&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="14692a78791a4455b1fe9b4f293320b8_26998843-5596-4798-a18c-b0b10ba79e91.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/5875i52E1A7D282D158F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="14692a78791a4455b1fe9b4f293320b8_26998843-5596-4798-a18c-b0b10ba79e91.png" alt="14692a78791a4455b1fe9b4f293320b8_26998843-5596-4798-a18c-b0b10ba79e91.png" /&gt;&lt;/span&gt;&lt;/FIGURE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:34:59 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90558#M509</guid>
      <dc:creator>cslayton</dc:creator>
      <dc:date>2020-10-16T03:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90559#M510</link>
      <description>&lt;P&gt;cslayton,&lt;/P&gt;&lt;P&gt;The default Workflows are changing with the upgrades.&lt;/P&gt;&lt;P&gt;Extreme is adding features and new workflows.&lt;/P&gt;&lt;P&gt;I can export it and send it to you by email if you send me your email address by private message.&lt;/P&gt;&lt;P&gt;Another option is to upgrade.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mig&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:38:21 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90559#M510</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-16T03:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90560#M511</link>
      <description>&lt;P&gt;FYI&lt;/P&gt;&lt;P&gt;I’m running 8.1.5&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:38:38 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90560#M511</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-16T03:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90561#M512</link>
      <description>&lt;P&gt;Hello Mig,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is your version 8.1.5 correct or do you meen 8.5.1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the workflow on 8.4.4.x&amp;nbsp;and 8.5.1.60&amp;nbsp;with ADV license but not an a 8.3.1.9 with Standard license.&lt;/P&gt;&lt;P&gt;Maybe the license is the difference if you have realy a old 8.1x.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:52:16 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90561#M512</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2020-10-16T03:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90562#M513</link>
      <description>&lt;P&gt;Sorry I crossed fingers...It is 8.5.1&lt;/P&gt;&lt;P&gt;Mig&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:53:27 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90562#M513</guid>
      <dc:creator>Miguel-Angel_RO</dc:creator>
      <dc:date>2020-10-16T03:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create mLAG Port with XMC Python</title>
      <link>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90563#M514</link>
      <description>&lt;P&gt;Hmm,&lt;/P&gt;&lt;P&gt;so it still remains two options&amp;nbsp;cslayton,&amp;nbsp;either your version is too old or the license type is wrong.&lt;/P&gt;&lt;P&gt;As MIG has already asked. Which version and which type (Basic, Standard, Advanced) do you use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 12:25:31 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/create-mlag-port-with-xmc-python/m-p/90563#M514</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2020-10-16T12:25:31Z</dc:date>
    </item>
  </channel>
</rss>

