Skip to main content

Manipulating Fibre Channel WWN easily with decoding capabilities

Project description

This package provide a simple way to manipulate Fibre Channel WWN in a SAN Storage environment with decoding capabilities. Most of storage manufacturers encodes some information in the WWN of their equipment (serials numbers, directors names, etc.).

This package can extract these information for the following devices :

  • EMC Symmetrix DMX, VMAX and VMAX3
  • NetApp FAS
  • Hitachi (thank you @hille721)

Pull requests are welcome ! :-)

Create a WWN

You can create your WWN objects with a dedicated factory method. The return type will WWN or the specific type of the manufacturer (if available) :

>>> from devicewwn.factory import WWNFactory
>>> factory = WWNFactory()
>>> wwn1 = factory.create("10000000c9907a92")
>>> wwn1
>>> wwn2 = factory.create("50:00:09:72:08:13:49:AD")
>>> wwn2

You can use ‘:’ as separator (or not) between the bytes of your WWN. Example: 50000972081349AD or 50:00:09:72:08:13:49:ad are accepted

This package supports also the use of WWN objects called ‘Device WWN’ (compliant IEEE NAA6) used to identify a specific LUN in many devices.

>>> from devicewwn.vendors.EMC.Symmetrix import EmcVmaxWWN
>>> wwn = EmcVmaxWWN('6006048000018790064853594d353844')
>>> wwn

Compare WWN

The comparison between WWN is also possible (even between an WWN object and a string) :

>>> from devicewwn.factory import WWNFactory
>>> factory = WWNFactory()
>>> wwn1 = factory.create('50000972081349AD')
>>> wwn2 = factory.create('50000972081349AD')
>>> wwn1 == wwn2
>>> wwn1 == '50000972081349AD'

Extract the information encoded in a WWN

Some manufacturers encode information in the WWNs of their equipments. These information are not the same between manufacturers but, generally, you can obtain the serial number of your device, a port or a director port number (very useful to identify easily an equipment on your network).

The property ‘decode’ of the WWN class is used to extract these informations (if available)

>>> from devicewwn.factory import WWNFactory
>>> factory = WWNFactory()
>>> wwn = factory.create('50000972081349AD')
>>> wwn.decode
'VMAX-20K S/N:HK192601234 Dir:12G Port:1'

The decode property can be also used with the WWNs NAA6 to obtain specific informations (very useful with the Symmetrix arrays):

>>> from devicewwn.vendors.EMC.Symmetrix import EmcVmaxWWN
>>> wwn = EmcVmaxWWN('60000970000292605199533030384638')
>>> wwn.decode
'VMAX S/N:000292605199 HVE:08F8'

Useful properties

Another properties are available :

  • oui : extract the OUI (Organization Unique Identifier) of the WWN
  • wwn_nodots : display the WWN without ‘:’ in the string
  • wwn_to_binary : convert the WWN to binary form
>>> wwn.oui
>>> wwn.wwn_nodots
>>> wwn.wwn_to_binary


See LICENSE file for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devicewwn-0.8.0.tar.gz (9.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page