Saturday 25 October 2014

Arista Ethernet Switch Third Party SFP Workaround


I recently had the need to get a third party DWDM SFP+ to work in an Arista 7050T switch. The following work around worked for me. Basically just comment out the vendor checking. I suspect there is a much nicer way to do this.

Step 1 unzip EOS-4.10.6.swi
step 2 unsquashfs rootfs-i386.sqsh (as root)
step 3 make changes to the Python file XcvrAgent.py. See 3.a
step 4 remove original rootfs-i386.sqsh and mksquashfs  squashfs-root/ rootfs-i386.sqsh
step 5 zip up everything without compression
zip -Z store EOS-4.10.6a.swi boot0 initrd-i386 linux-i386 rootfs-i386.sqsh version

Things to change:
/usr/lib/python2.7/site-packages/XcvrAgent.py starts line 172.
3.a) Comment out the 4 lines
assert xcvrStatus.presence == "xcvrPresent"
#Commented out to enable Third Party Optics
# If the xcvr is present, authenticate it.
#t7( "Xcvr", name, "is present. genId status=%d, cfg=%d" % \
 #    ( xcvrStatus.generationId, xcvrConfig.generationId ) )
xcvrConfig.xcvrEnabled = True
 #xcvrConfig.xcvrEnabled = xcvrStatus.xcvrEnabled
#xcvrConfig.configReason = xcvrStatus.configReason

While I would not recommend doing this on a production box it is a handy work around if you are stuck or Arista don't support the SFP+ you need.


4 comments:

  1. --- ./XcvrAgent.py 2015-04-10 11:33:53.000000000 +0100
    +++ ./XcvrAgent-good.py 2015-04-20 17:27:35.399540949 +0100
    @@ -601,7 +601,11 @@
    # If the xcvr is present, authenticate it.
    t7( "Xcvr", name, "is present. genId status=%d, cfg=%d" % \
    ( xcvrStatus.generationId, xcvrConfig.generationId ) )
    - xcvrConfig.xcvrState = xcvrStatus.xcvrState
    + #xcvrConfig.xcvrState = xcvrStatus.xcvrState
    + xcvrConfig.xcvrState = Tac.Value( "Xcvr::XcvrState",
    + True, 'presumedAuthentic' )
    + xcvrConfig.generationId = xcvrStatus.generationId
    + return
    def _cleanup( s ):
    if( s ):
    s = s.strip()

    mksquashfs squashfs-root/ rootfs-i386.sqsh -comp xz -b 131072 -Xbcj x86

    zip -Z store EOS-4.14.5F-new.swi boot0 initrd-i386 linux-i386
    rootfs-i386.sqsh version

    ReplyDelete
  2. Hi Eoin,

    could you please confirm the whole process again. I tried it and it doesn't work for me
    Here is the info from the switch,

    Arista DCS-7050SX-128-R
    Hardware version: 02.01
    Serial number: JPE15330006
    System MAC address: 001c.7388.05e6

    Software image version: 4.14.7M
    Architecture: i386
    Internal build version: 4.14.7M-2383935.4147M
    Internal build ID: 55d2833a-23df-42b5-b65b-9159dd2a70f9

    ReplyDelete


  3. for EOS-2GB-4.23.8M changes are there codes are list almost at end of file

    please tell it is ok ?

    else:
    assert xcvrStatus.presence == "xcvrPresent"
    # If the xcvr is present, authenticate it.
    # t7( "Xcvr", name, "is present. genId status=%d" % \
    # ( xcvrStatus.generationId ) )
    if not isSwizzled:
    xcvrStatus.xcvrState = self.statusHelper_.getXcvrState( xcvrStatus )
    else:
    xcvrStatus.sfpStatus.xcvrState = \
    self.statusHelper_.getXcvrState( xcvrStatus.sfpStatus )
    t7( "Xcvr", name, "xcvrState", xcvrStatus.xcvrState)
    def _cleanup( s ):
    if( s ):
    s = s.strip()
    else:
    s = "n/a"
    return s
    if not xcvrStatus.xcvrState.enabled:
    for intf in xcvrConfig.intfName.values():
    if intf not in self.xcvrDisabledCause_.intfStatus:
    t7( "Marking interface %s errdisabled" % intf )
    self.xcvrDisabledCause_.intfStatus.newMember( intf, Tac.now() )
    if not self.disablementLogged_:
    t7( "Logging disablement" )
    vendorInfo = xcvrStatus.vendorInfo
    Logging.log( TRANSCEIVER_DISABLED, name,
    _cleanup( vendorInfo.vendorName ),
    _cleanup( vendorInfo.vendorPn ),
    _cleanup( vendorInfo.vendorSn ) )

    self.disablementLogged_ = True
    else:
    t7( "Not logging disablement." )
    xcvrStatus.xcvrStateChanges += 1

    def main():
    container = Agent.AgentContainer( [ XcvrAgent ], passiveMount=True )
    container.addSliceIdOption( XcvrAgent )
    container.runAgents()





    ReplyDelete
  4. Hi Addy,

    is it working fine.. after doing changes on 4.23.8M ?

    ReplyDelete