View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Luke Poskitt > IBM-StorageSystem > IBM::StorageSystem::Host



Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  


IBM::StorageSystem::Host - Class for operations with a IBM StorageSystem attached hosts


Version 0.01


IBM::StorageSystem::Host is a utility class for operations with a IBM StorageSystem attached hosts.

        use IBM::StorageSystem;
        my $ibm = IBM::StorageSystem->new(      
                                        user            => 'admin',
                                        host            => 'my-v7000',
                                        key_path        => '/path/to/my/.ssh/private_key'
                                ) or die "Couldn't create object! $!\n";

        # Print a list of all configured hosts sorted by hostname, their WWPNs,
        # port state and login status.

        foreach $host ( map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [ $_, $_->name ] } $ibm->get_hosts ) { 
                my $c = 0;

                foreach $wwpn ( @{ $host->WWPN } ) { 
                        print ( $c ? "\t" : ('-'x100)."\n".$host->name );
                        print "\t\t\t$wwpn\t" . @{ $host->state }[$c] . "\t\t" .
                                ( @{$host->node_logged_in_count }[$c] ? '' : 'not ' ) . "logged in\n";

        # Prints something similar to:
        # ----------------------------------------------------------------------------------------------------
        # host-3                        2101001B32A3D94C        active          logged in
        #                               2100001B3283D94C        active          logged in
        # ----------------------------------------------------------------------------------------------------
        # host-4                        2100001B320786E7        active          logged in
        #                               2101001B322786E7        active          logged in
        # ----------------------------------------------------------------------------------------------------
        # storage-2                     210100E08BB40A08        offline         not logged in
        #                               210000E08B940A08        offline         not logged in
        # ... etc.



Returns an array of the WWPNs configured for this host - the order of the WWPNs in the array preserves the order in which the WWPNs were returned from the CLI. For example, if two WWPNs would be returned from the CLI command of lshost <host_id>, then the order in which the WWPNs will be preserved in the array so that the first WWPN to be returned is the first array item and the second to be returned is the second array item.

See the NOTES section for further detail.


Returns the numerical identifier of the host.


Returns the IO group count for the host.


Returns the LUN masking for the host.


Returns the name of the host - this is the name with which the host was configured with in the CLI or GUI.


Returns an array of integers representing the node logged in count for the corresponding WWPN. The array order is preserved from the output of the CLI and the array index match the values returned from the WWPN and state methods.


Returns configured host port count.


Returns an array or host port states - the array order is preserved as returned by the CLI and the array indexes match the values returned from the WWPN and node_logged_in_count methods.


Returns the host overal status, either one of online, offline or degraded.


Returns the host type.


Note that the CLI output of an lshost <host_id> command in the StorageSystem CLI environment can return multiple identical output lines for the values of 'state', 'node_logged_in_count' and 'WWPN' fields. These output lines are positionally representational meaning that the first output lines refer to the first port, the second set of lines refer to the second port, and so on.

Because this output is returned using positional output formatting only and not explicit field numbering it is necessary to preserve the order implied by positional output formatting to retain the relationship between port specific information.

To do so, the methods WWPN, node_logged_in_count and state all return ordered arrays that preserve the positional output from the CLI so that the indexes for all of the aforementioned methods refer to a common port. That is:

        # Given $i, then the port identified by WWPN
        @{ $host->wwpn[$i] }

        # Will have the port state
        @{ $host->state[$i] }

        # And the node_logged_in_count of
        @{ $host->node_logged_in_count[$i] }


Luke Poskitt, <ltp at>


Please report any bugs or feature requests to bug-ibm-v7000-host at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc IBM::StorageSystem::Host

You can also look for information at:



Copyright 2012 Luke Poskitt.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: