The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IBM::StorageSystem::VDisk - Class for operations with IBM StorageSystem VDisks

VERSION

Version 0.01

SYNOPSIS

IBM::StorageSystem::VDisk - Class for operations with IBM StorageSystem VDisks

        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";

        # Get the VDisk ID 3 and print the VDisk UUID
        my $vdisk = $ibm->vdisk(3);
        print $vdisk->vdisk_UUID;

        # Alternately:
        print $ibm->vdisk(3)->vdisk_UUID;

        # Print the name, ID, capacity in GB and MDisk group name of all VDisks in a
        # nicely formatted output
        printf( "%-20s%-8s%-15s%20s\n", 'Name', 'ID', 'Capacity (GB)', 'MDisk Group Name' );
        printf( "%-20s%-8s%-15s%20s\n", '-'x18, '-'x4, '-'x12, '-'x15 );
        map { printf( "%-20s%-8s%-15s%20s\n", $_->name, $_->id, (int($_->capacity / (1024**3))), $_->mdisk_grp_name) } 
        grep { $_->status eq 'online' } $ibm->get_vdisks;

        # Should print something like:
        # Name                ID      Capacity (GB)      MDisk Group Name
        # ------------------  ----    ------------       ---------------
        # file-host-1         0       5823               FILE_POOL
        # backup-host-2       1       2330               BACKUP_POOL
        # ... etc.

METHODS

FC_id

Specifies the ID of the FlashCopy mapping that the volume belongs to. The value many indicates that the volume belongs to more than one FlashCopy mapping.

FC_name

Specifies the name of the FlashCopy mapping that the volume belongs to. The value many indicates that the volume belongs to more than one FlashCopy mapping.

IO_group_id

Specifies the I/O Group that the volume belongs to.

IO_group_name

Specifies the I/O Group that the volume belongs to.

RC_change

Specifies if a volume is a change volume of a Global Mirror or Metro Mirror relationship.

RC_id

Specifies the ID of the Global Mirror or Metro Mirror relationship that the volume belongs to. The value must be numerical.

RC_name

Specifies the name of the Global Mirror or Metro Mirror relationship that the volume belongs to.

cache

Specifies the cache mode of the volume. The value can be readwrite or <none>.

capacity

Specifies the total capacity of the volume.

copy ( $id )

        # Get copy ID 0 of VDisk 0 and print the copy status
        my $copy = $ibm->vdisk(0)->copy(0);
        print $copy->status;

        # Or:
        print $ibm->vdisk(0)->copy(0)->status;

Returns the VDisk volume copy specified by the value of the numerical ID argument as an IBM::StorageSystem::VDisk::Copy object.

Note that this method implements caching and will return a cached IBM::StorageSystem::VDisk::Copy object should one exist from a previous retrieval.

Note also that previous retrievals of such objects may happen implicitly on invocation of the copy, get_copy, or get_copys methods so if you are certain that you wish to force any existing cached objects to be refreshed, then you should use the get_copy or get_copys methods.

get_copy ( $id )

Returns the VDisk volume copy specified by the value of the numerical ID argument as an IBM::StorageSystem::VDisk::Copy object.

Note that this method is non-caching and will always force a retrieval of fresh information from the StorageSystem.

Doing so will usually result in a performance penalty - compare this with the operation of the caching method copy.

get_copys

        my @vdisks = $ibm->get_vdisks;

        foreach my $vdisk ( @vdisks ) {
                my @copies = $vdisk->get_copys;
                
                foreach my $copy ( @copies ) {
                        print $copy->sync
                }
        }

Returns all VDisk copies for the specified VDisk as an array of IBM::StorageSystem::VDisk::Copy objects.

Note that this method is non-caching and the information is always retrieved from the target system ignoring any cached results.

copy_count

Returns the copy count of the volume.

fast_write_state

Specifies the cache state for the volume. The value can be empty, not_empty, corrupt, or repairing. A cache state of corrupt indicates that the volume requires recovery by using one of the recovervdisk commands. A cache state of repairing indicates that repairs initiated by a recovervdisk command are in progress.

fc_map_count

Specifies the number of FlashCopy mappings that the volume belongs to.

filesystem

Expressed as a value string (long object name with a maximum of 63 characters), specifies the full name for file system which owns this volume; otherwise, it is blank.

formatted

Indicates whether the volume was formatted when it was created. The value can be yes or no.

free_capacity

Specifies the difference between the real_capacity and used_capacity values.

id

Returns the VDisk numerical ID.

mdisk_grp_id

Specifies the ID of the storage pool that the volume belongs to. If the volume has more than one copy, these fields display many.

mdisk_grp_name

Specifies the name of the storage pool that the volume belongs to. If the volume has more than one copy, these fields display many.

mdisk_id

Specifies the MDisk numerical ID that is used for sequential and image mode volumes. If the volume has more than one copy, these fields display many.

mdisk_name

Specifies the MDisk name that is used for sequential and image mode volumes. If the volume has more than one copy, these fields display many.

mirror_write_priority

Specifies the mirror write algorithm priority being used if the volume is mirrored.

name

Specifies the volume name.

overallocation

Expressed as a percentage, specifies the ratio of volume capacity to real_capacity values. This value is always 100 for non-space-efficient volumes.

Remember: This value can be any percentage (but not blank) for compressed volume copies.

preferred_node_id

Specifies the ID of the preferred node for the volume.

Remember: This value must be numeric. (The value is zero if no node is configured in the I/O group that contains the preferred node.)

se_copy_count

Specifies the number of space-efficient copies.

Remember: This value represents only space-efficient copies and is not used for compressed volume copies.

status

The value can be online, offline or degraded.

sync_rate

Specifies the rate for synchronization for mirrored copies.

throttling

Specifies the throttle rate of the volume.

type

Specifies the virtualization type of the volume. The value can be striped, sequential, image or many. The value many indicates that the volume has more than one copy, which can have different virtualization types.

udid

Specifies the unit number for the volume. Only OpenVMS hosts require a unit number.

vdisk_UID

Specifies the UID of the volume.

AUTHOR

Luke Poskitt, <ltp at cpan.org>

BUGS

Please report any bugs or feature requests to bug-ibm-v7000-vdisk at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IBM-StorageSystem-VDisk. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

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

    perldoc IBM::StorageSystem::VDisk

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 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 http://dev.perl.org/licenses/ for more information.