Skip to main content
https://travis-ci.com/jbrt/devicewwn.svg?branch=master

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

  • EMC VPLEX

  • 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
<WWN(10:00:00:00:c9:90:7a:92)>
>>>
>>>
>>> wwn2 = factory.create("50:00:09:72:08:13:49:AD")
>>> wwn2
<EmcVmaxWWN(50:00:09:72:08:13:49:ad)>

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
<EmcDmxWWN(60:06:04:80:00:01:87:90:06:48:53:59:4d:35:38:44)>
>>>

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
True
>>> wwn1 == '50000972081349AD'
True
>>>

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
'00:60:48'
>>> wwn.wwn_nodots
'5006048accc86a32'
>>> wwn.wwn_to_binary
'101000000000110000001001000101011001100110010000110101000110010'

License

See LICENSE file for more information.

Release files for devicewwn 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devicewwn 0.8.0
File Size Uploaded
devicewwn-0.8.0.tar.gz 9.2 kB Details

Release files / devicewwn-0.8.0.tar.gz

Download URL devicewwn-0.8.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ce2058f1ed311866355ea8f3a9d412da8927448ba4bee0d81c841a20c7ba044a
BLAKE2b-256 checksum
How to use checksums
03b5754573268b04f28b987269413adf00417e3b0e452b68bae6e6e01d4a8468
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.16

Release history Release notifications | RSS feed

This release

0.8.0 This release

1 release file

0.7.0

1 release file

0.6.4

1 release file

0.6.3

2 release files

0.6

2 release files

0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page