Cisco MDS | nxos_zone_zoneset

Alrighty

So I’ve run into a bit of a head scratcher

New MDS deployment, right?

all of 0 customers running across it so far,
2 admins poking at it, one being myself trying to get Ansible playbooks to play nicely with this new pair.

Playbook functions on old MDS’s without an incident. that is one MINOR code version behind (like .1a to .2)

The error:
"msg": "zone has acquired lock on the switch for vsan 101. Hence cannot procced.",
some redactions have been made.

playbook:

`

And What happens when you -The admin execute :

show zone status  ?? 


It’s in the OG post.

I can’t get it to post /w the code, so here we go.
https://pastebin.com/ziMcfTSt

Updated the modules for MDS to most current release via github.
No success.

I think I found the offending “Check” thats causing my headache.

`

 # Step1: execute show zone status and get
        shZoneStatusObj = ShowZoneStatus(module, vsan)
        sw_default_zone = shZoneStatusObj.getDefaultZone()
        sw_mode = shZoneStatusObj.getMode()
        sw_smart_zoning = shZoneStatusObj.getSmartZoningStatus()        if sw_smart_zoning.lower() == "Enabled".lower():
            sw_smart_zoning_bool = True
        else:
            sw_smart_zoning_bool = False        if shZoneStatusObj.isVsanAbsent():
            module.fail_json(msg='Vsan ' + str(vsan) + ' is not present in the switch. Hence cannot procced.')        if shZoneStatusObj.isLocked():
            module.fail_json(msg='zone has acquired clock on the switch for vsan ' + str(vsan) + '. Hence cannot procced.')

`

Referencing the ShowZoneStatus module that its calling

Looks like its mishandling the output from this command…

`
def update(self):

output = self.execute_show_zone_status_cmd().split(“\n”)

patfordefzone = “VSAN: " + str(self.vsan) + r” default-zone:\s+(\S+).*"
patformode = r".mode:\s+(\S+)."
patforsession = r".session:\s+(\S+)."
patforsz = r".smart-zoning:\s+(\S+)."
for line in output:
if “is not configured” in line:
self.vsanAbsent = True
break
mdefz = re.match(patfordefzone, line.strip())
mmode = re.match(patformode, line.strip())
msession = re.match(patforsession, line.strip())
msz = re.match(patforsz, line.strip())

if mdefz:
self.default_zone = mdefz.group(1)
if mmode:
self.mode = mmode.group(1)
if msession:
self.session = msession.group(1)
if self.session != “none”:
self.locked = True
if msz:
self.sz = msz.group(1)

def isLocked(self):
return self.locked

`

Opened an issue with Cisco on github.

https://github.com/Cisco-SAN/MDS_Ansible_Modules/issues/9