# $Id$ # # Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary StorageDisk ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::StorageDisk =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP StorageDisk. A related class is L, which represents access to an ONTAP StorageDisk. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the StorageDisk element are the attributes of the StorageDisk ComponentState. Additionally, the command_interface used to obtain the ComponentState object is also an attribute of the object. This makes it easier to obtain the component object corresponding to the CS object, using L. =over =item command_interface The command_interface with which the CS object was obtained. (Available in all CS objects regardless of requested_fields and the mode/interface) =item C<< is_foreign >> Foreign LUN possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< lun >> LUN ID (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $lun = $obj->lun(); # $lun contains a reference to the array of values my @lun = $obj->lun(); # @lun contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { lun = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< target_side_switch_port >> Target Side Switch Port (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_side_switch_port = $obj->target_side_switch_port(); # $target_side_switch_port contains a reference to the array of values my @target_side_switch_port = $obj->target_side_switch_port(); # @target_side_switch_port contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_side_switch_port = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< rpm >> Revolutions Per Minute Filled in for CMode CLI/ZAPI iter, 7Mode CLI Mapping for CMode ZAPI iter: Maps to: 7M CLI : -R (Programmatic name : 'rpm') of 'aggr status' command =item C<< disk_iops_total >> Total Disk IOPs Across All Active Paths Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< raid_group >> Raid Group Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< node_name >> Name of Node that Reported this Record Filled in for CMode CLI/ZAPI iter =item C<< primary_port_name >> Primary Path Disk Port Name Filled in for CMode CLI/ZAPI iter =item C<< usable_size >> Usable Size Filled in for CMode CLI/ZAPI iter =item C<< count >> Number of errors for this disk Filled in for CMode CLI/ZAPI iter =item C<< firmware_revision >> Firmware Revision Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< "revision" >> Filled in for 7Mode CLI. Maps to: 7M CLI : 'rev' of 'storage show disk' command =item C<< uid >> Disk Unique ID Filled in for CMode CLI/ZAPI iter =item C<< percent_rated_life_used >> Percentage of Rated Life Used ranges from 0 to 255 Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< usable_size_blocks >> Number of Usable Blocks Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< prefailed >> Marked for Rapid RAID Recovery? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< grown_defect_list_count >> Number of Defects Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< node_for_pool >> Node for which pool suggestion corresponds to possible value(s) are, ,local (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $node_for_pool = $obj->node_for_pool(); # $node_for_pool contains a reference to the array of values my @node_for_pool = $obj->node_for_pool(); # @node_for_pool contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { node_for_pool = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< percent_spares_consumed >> Percentage of Total Spare Sectors Used ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_shareable >> Disk is Capable of Being Shared? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< port_speed >> Port Speed (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $port_speed = $obj->port_speed(); # $port_speed contains a reference to the array of values my @port_speed = $obj->port_speed(); # @port_speed contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { port_speed = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< effective_type >> Effective Disk Type possible value(s) are, ATA , BSAS , FCAL , FSAS , LUN , MSATA , SAS , SATA , SSD , VMDISK Filled in for CMode CLI/ZAPI iter =item C<< media_scrub_count >> Number of Media Scrubs Completed Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vmdisk_backing_serial_number >> Serial Number of the Underlying Disk Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< physical_size >> Physical Size Filled in for CMode CLI/ZAPI iter, 7M CLI. Maps to: 7M CLI : 'physicalsize' of 'aggr status' command =item C<< secondary_port >> Secondary Path Disk Port Filled in for CMode CLI/ZAPI iter =item C<< bay >> Bay Filled in for CMode CLI/ZAPI iter, 7Mode CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'bay' of 'aggr status' command =item C<< path_link_errors >> Link Error count on path (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_link_errors = $obj->path_link_errors(); # $path_link_errors contains a reference to the array of values my @path_link_errors = $obj->path_link_errors(); # @path_link_errors contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { path_link_errors = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_spare_zeroing >> Spare Disk Zeroing? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< serial_number >> Serial Number Filled in for CMode CLI/ZAPI iter, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'serial-number' of 'disk show' command =item C<< raid_controller >> Node with Active RAID Control possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< physical_size_blocks >> Number of Physical Blocks Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< dr_home_id >> Disaster Recovery Home System ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vmdisk_backing_disk_model >> Disk Model of the Underlying Disk Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< model >> Model Filled in for CMode CLI/ZAPI iter,7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'model' of 'storage show disk' command =item C<< is_spare_media_scrubbing >> Spare Disk Media Scrub Active? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vmdisk_hypervisor_area_name >> Hypervisor storage area for virtual machine disk (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $vmdisk_hypervisor_area_name = $obj->vmdisk_hypervisor_area_name(); # $vmdisk_hypervisor_area_name contains a reference to the array of values my @vmdisk_hypervisor_area_name = $obj->vmdisk_hypervisor_area_name(); # @vmdisk_hypervisor_area_name contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { vmdisk_hypervisor_area_name = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< copy_percent >> Percentage of Copy Complete ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter =item C<< pool_suggestion >> Pool suggestion for the partitions (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $pool_suggestion = $obj->pool_suggestion(); # $pool_suggestion contains a reference to the array of values my @pool_suggestion = $obj->pool_suggestion(); # @pool_suggestion contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { pool_suggestion = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< shm_time_interval >> Seconds Since SHM Err Counting Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< spare_pool >> Spare Pool Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< storage_pool >> Storage Pool Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< import_in_progress >> Foreign LUN import in progress possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_local_attach >> Indicates if the disk is local to this cluster possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< lun_io_kbps >> Kbytes/sec on Disk (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $lun_io_kbps = $obj->lun_io_kbps(); # $lun_io_kbps contains a reference to the array of values my @lun_io_kbps = $obj->lun_io_kbps(); # @lun_io_kbps contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { lun_io_kbps = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< shelf >> Shelf Filled in for CMode CLI/ZAPI, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'shelf' of 'aggr status' command =item C<< zeroing_percent >> Percentage of Zeroing Complete ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter =item C<< type >> Disk Type possible value(s) are, ATA , BSAS , EATA , FCAL , FSAS , LUN , MSATA , SAS , SATA , SCSI , SSD , XATA , XSAS , VMDISK Filled in for CMode CLI/ZAPI iter, 7M CLI. Maps to: 7M CLI : 'type' of 'aggr status' command =item C<< "usedsize" >> Filled in for 7Mode CLI. Maps to: 7M CLI : 'usedsize' of 'aggr status' command =item C<< right_size_sectors >> Number of Right-size Sectors Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< disk_port >> Disk Port (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_port = $obj->disk_port(); # $disk_port contains a reference to the array of values my @disk_port = $obj->disk_port(); # @disk_port contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_port = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_internal_disk >> Is Disk Internal? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< is_spare_zeroed >> Spare Disk Zeroed? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< lun_iops >> Number IOPS per second on disk (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $lun_iops = $obj->lun_iops(); # $lun_iops contains a reference to the array of values my @lun_iops = $obj->lun_iops(); # @lun_iops contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { lun_iops = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< owner_str >> owner-id and owner string Filled in for CMode CLI/ZAPI iter =item C<< dr_home >> Disaster Recovery Home possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< diskpathnames >> list of path based disk names (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $diskpathnames = $obj->diskpathnames(); # $diskpathnames contains a reference to the array of values my @diskpathnames = $obj->diskpathnames(); # @diskpathnames contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { diskpathnames = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< hidden_uid >> Disk Unique ID Filled in for CMode CLI/ZAPI iter =item C<< position >> Disk Position Filled in for CMode CLI/ZAPI iter =item C<< target_port_access_state >> Failover optimization type (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_port_access_state = $obj->target_port_access_state(); # $target_port_access_state contains a reference to the array of values my @target_port_access_state = $obj->target_port_access_state(); # @target_port_access_state contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_port_access_state = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< effective_rpm >> Effective RPM Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< array_name >> Array Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_sanown_failed >> Can't Access Ownership Data possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< data_owner >> Owner of Data Partition possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< aggregate >> Aggregate Filled in for CMode CLI/ZAPI iter, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'aggregate' of 'aggr status' command =item C<< owner >> Owner possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter, 7m CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'owner' of 'disk show' command =item C<< is_disk_zeroing >> Aggregate Disk Zeroing? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< orig_owner >> Original Disk Owner Filled in for CMode CLI/ZAPI iter =item C<< poolnum >> Assigned Pool Number Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< target_wwpn >> Target Port (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_wwpn = $obj->target_wwpn(); # $target_wwpn contains a reference to the array of values my @target_wwpn = $obj->target_wwpn(); # @target_wwpn contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_wwpn = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< disk_zeroing_percent >> Percentage of Aggregate Disk Zeroing Complete ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter =item C<< is_shared >> Disk is Shared? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< bps >> Bytes Per Sector Filled in for CMode CLI/ZAPI iter =item C<< container_type >> Container Type possible value(s) are, aggregate , broken , foreign , labelmaint , maintenance , shared , spare , unassigned , unknown , volume Filled in for CMode CLI/ZAPI iter =item C<< preferred_target_port >> Whether or not target port group is preferred possible value(s) are, true,false (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $preferred_target_port = $obj->preferred_target_port(); # $preferred_target_port contains a reference to the array of values my @preferred_target_port = $obj->preferred_target_port(); # @preferred_target_port contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { preferred_target_port = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< root_owner_id >> Root Partition owner System ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_disk_zeroed >> Aggregate Disk Zeroed? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< secondary_name >> Secondary Path Name Filled in for CMode CLI/ZAPI iter =item C<< path_io_kbps >> Kbytes of I/O per second on Path (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_io_kbps = $obj->path_io_kbps(); # $path_io_kbps contains a reference to the array of values my @path_io_kbps = $obj->path_io_kbps(); # @path_io_kbps contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { path_io_kbps = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< checksum_type >> RAID Checksum Type Filled in for CMode CLI/ZAPI iter =item C<< initiator_side_switch_port >> Initiator Side Switch Port (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator_side_switch_port = $obj->initiator_side_switch_port(); # $initiator_side_switch_port contains a reference to the array of values my @initiator_side_switch_port = $obj->initiator_side_switch_port(); # @initiator_side_switch_port contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { initiator_side_switch_port = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< disk_port_name >> Disk Port Name (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_port_name = $obj->disk_port_name(); # $disk_port_name contains a reference to the array of values my @disk_port_name = $obj->disk_port_name(); # @disk_port_name contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_port_name = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_in_fdr >> Has Entry in Failed Disk Registry? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< root_owner >> Owner of Root Partition possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< copy_destination >> Copy Destination Name Filled in for CMode CLI/ZAPI iter =item C<< replacing >> Being Replaced? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< home_id >> Home System ID Filled in for CMode CLI/ZAPI iter, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'homeid' of 'disk show' command =item C<< vmdisk_backing_vendor_id >> Vendor ID of the Underlying Disk Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_error >> Has an error associated possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< initiator_iops >> Number of IOPS on Initiator (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator_iops = $obj->initiator_iops(); # $initiator_iops contains a reference to the array of values my @initiator_iops = $obj->initiator_iops(); # @initiator_iops contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { initiator_iops = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< error_text_list >> Error Text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_text_list = $obj->error_text_list(); # $error_text_list contains a reference to the array of values my @error_text_list = $obj->error_text_list(); # @error_text_list contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { error_text_list = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< is_spare_offline >> Spare Disk Offline? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< spare_zeroing_percent >> Percentage of Spare Disk Zeroing Complete ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< fsm_state >> Disk object FSM state possible value(s) are, initializing , present , unfailing , prefailing , failing , failed , unsharing , online , offlining , offline , sdc , replacing , notzeroed , zeroing , zeroed , inuse , sparing , fakezeroed , sharing , diverged Filled in for CMode CLI/ZAPI iter =item C<< initiator_io_kbps >> Kbytes of I/O per second on Initiator (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator_io_kbps = $obj->initiator_io_kbps(); # $initiator_io_kbps contains a reference to the array of values my @initiator_io_kbps = $obj->initiator_io_kbps(); # @initiator_io_kbps contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { initiator_io_kbps = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< position_str >> Disk Position string Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< percent_spares_consumed_limit >> Percentage of Threshold on Spare Sectors Consumed ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_reconstructing >> Being Reconstructed? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< is_multidisk_carrier >> Multi Disk Carrier? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< primary_port >> Primary Path Disk Port Filled in for CMode CLI/ZAPI iter =item C<< vmdisk_backing_device_id >> Device ID of the Underlying Disk Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< container_name >> Container name/names Filled in for CMode CLI/ZAPI iter =item C<< physical_size_mb >> Physical Size (MB) Filled in for CMode CLI/ZAPI iter =item C<< container_type_str >> Container Type string Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< home_str >> home-id and home string Filled in for CMode CLI/ZAPI iter =item C<< reserver_id >> Reservation System ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< target_iops >> Number of IOPS to Target (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_iops = $obj->target_iops(); # $target_iops contains a reference to the array of values my @target_iops = $obj->target_iops(); # @target_iops contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_iops = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_sed >> Is this a Self-Encrypting Drive (SED)? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< pool >> Assigned Pool Filled in for CMode CLI/ZAPI iter, 7Mode CLI. Maps to: 7M CLI : -p (Programmatic name : 'pool') of 'disk show' command =item C<< home >> Home possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'home' of 'disk show' command =item C<< path_iops >> Number of IOPS on Path (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_iops = $obj->path_iops(); # $path_iops contains a reference to the array of values my @path_iops = $obj->path_iops(); # @path_iops contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { path_iops = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< storage_pool_uuid >> Storage Pool Uuid Filled in for CMode CLI/ZAPI iter =item C<< carrier_id >> Carrier ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< average_latency >> Average I/O Latency Across All Active Paths Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vmdisk_hypervisor_file_name >> Hypervisor file for virtual machine disk (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $vmdisk_hypervisor_file_name = $obj->vmdisk_hypervisor_file_name(); # $vmdisk_hypervisor_file_name contains a reference to the array of values my @vmdisk_hypervisor_file_name = $obj->vmdisk_hypervisor_file_name(); # @vmdisk_hypervisor_file_name contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { vmdisk_hypervisor_file_name = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_disk_offline >> Aggregate Disk Offline? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< stack_id >> Stack ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< host_adapter >> Primary Path Host Adapter Filled in for CMode CLI/ZAPI iter =item C<< type_str >> Disk Type string Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< outage_reason >> Outage Reason Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< target_lun_in_use_count >> Number of LUNs in the in-use state on this target (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_lun_in_use_count = $obj->target_lun_in_use_count(); # $target_lun_in_use_count contains a reference to the array of values my @target_lun_in_use_count = $obj->target_lun_in_use_count(); # @target_lun_in_use_count contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_lun_in_use_count = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< disk_io_kbps_total >> Total Disk Throughput in KBPS Across All Active Paths Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_power_on_lock_enabled >> Is Power-On Lock Protection Enabled? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< sectors_written >> Number of Sectors Written Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< power_on_seconds >> Seconds Powered On Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< physical_size_512b >> Physical Size in Units of 512 Bytes Filled in for CMode CLI/ZAPI iter =item C<< state >> State possible value(s) are, broken , copy , maintenance , partner , pending , present , reconstructing , removed , spare , unfail , zeroing Filled in for CMode CLI/ZAPI iter, 7M CLI. Maps to: 7M CLI : -r (Programmatic name : 'raid-disk') of 'aggr status' command =item C<< path_lun_in_use_count >> Number of LUNs in the in-use state on this path (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_lun_in_use_count = $obj->path_lun_in_use_count(); # $path_lun_in_use_count contains a reference to the array of values my @path_lun_in_use_count = $obj->path_lun_in_use_count(); # @path_lun_in_use_count contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { path_lun_in_use_count = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< lun_path_use_state >> The Use State of the LUN on this path (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $lun_path_use_state = $obj->lun_path_use_state(); # $lun_path_use_state contains a reference to the array of values my @lun_path_use_state = $obj->lun_path_use_state(); # @lun_path_use_state contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { lun_path_use_state = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< data_owner_id >> Data Partition owner System ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< usable_size_mb >> Usable Size (MB) Filled in for CMode CLI/ZAPI iter =item C<< is_sparecore >> Sparecore Disk? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< reservation_key >> Reservation Key Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< capacity_sectors >> Capacity in Number of Sectors Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< shelf_uid >> Shelf UID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< aggregate_list >> Aggregates using partitions on this disk (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $aggregate_list = $obj->aggregate_list(); # $aggregate_list contains a reference to the array of values my @aggregate_list = $obj->aggregate_list(); # @aggregate_list contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { aggregate_list = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_disk_media_scrubbing >> Aggregate Disk Media Scrub Active? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter =item C<< checksum_compatibility >> Checksum Compatibility possible value(s) are, advanced_zoned , block , none , zoned/advanced_zoned Filled in for CMode CLI/ZAPI iter, 7Mode CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'checksum_compatibility' of 'aggr status' command =item C<< media_scrub_last_done_seconds >> Seconds since Media Scrub Done Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< nodelist >> Controller name possible value(s) are, ,local (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $nodelist = $obj->nodelist(); # $nodelist contains a reference to the array of values my @nodelist = $obj->nodelist(); # @nodelist contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { nodelist = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< key_id >> Key ID of the current Authentication Key Filled in for CMode CLI/ZAPI iter =item C<< primary_lun >> LUN ID on the primary path Filled in for CMode CLI/ZAPI iter =item C<< owner_id >> Owner System ID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< reconstruction_percent >> Percentage of Reconstruction Complete ranges from 0 to 100 Filled in for CMode CLI/ZAPI iter =item C<< reservation_type >> Reservation Type possible value(s) are, rs,we,re,ea,sa,wero,earo,wear,eaar,none Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< error_type >> Error Type possible value(s) are, onepath,onedomain,control,foreign,toobig,toosmall,invalidblocksize,targetasymmap,deviceassymmap,failovermisconfig,unknown,netapp,fwdownrev,qualfail,diskfail (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_type = $obj->error_type(); # $error_type contains a reference to the array of values my @error_type = $obj->error_type(); # @error_type contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { error_type = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< sectors_read >> Number of Sectors Read Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< disk >> Disk Name Filled in for CMode CLI/ZAPI iter, 7M CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'disk' of 'disk show' command =item C<< is_dynamically_qualified >> Dynamically Qualified? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< zeroed >> Zeroed? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter, 7M CLI. Maps to: 7M CLI : 'zeroed' of 'aggr status' command =item C<< power_on_hours >> Hours Powered On Filled in for CMode CLI/ZAPI iter =item C<< target_io_kbps >> Kbytes of I/O per second to Target (Rolling Average) (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_io_kbps = $obj->target_io_kbps(); # $target_io_kbps contains a reference to the array of values my @target_io_kbps = $obj->target_io_kbps(); # @target_io_kbps contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { target_io_kbps = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< plex >> Plex Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< rpm_hidden >> Actual RPM reported by Dblade Filled in for CMode CLI/ZAPI iter =item C<< vmdisk_device_id >> Virtual disk device ID (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $vmdisk_device_id = $obj->vmdisk_device_id(); # $vmdisk_device_id contains a reference to the array of values my @vmdisk_device_id = $obj->vmdisk_device_id(); # @vmdisk_device_id contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { vmdisk_device_id = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< initiator_lun_in_use_count >> Number of LUNs in the in-use state on this initiator (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator_lun_in_use_count = $obj->initiator_lun_in_use_count(); # $initiator_lun_in_use_count contains a reference to the array of values my @initiator_lun_in_use_count = $obj->initiator_lun_in_use_count(); # @initiator_lun_in_use_count contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { initiator_lun_in_use_count = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< path_quality >> Percentage of weighted error threshold (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_quality = $obj->path_quality(); # $path_quality contains a reference to the array of values my @path_quality = $obj->path_quality(); # @path_quality contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { path_quality = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< dr_home_str >> dr-home-id and dr-home string Filled in for CMode CLI/ZAPI iter =item C<< capacity >> Capacity (MB) Filled in for CMode CLI/ZAPI iter =item C<< effective_type_str >> Effective Disk Type string Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< path_error_count >> Path Error Count Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< initiator >> Initiator Port (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator = $obj->initiator(); # $initiator contains a reference to the array of values my @initiator = $obj->initiator(); # @initiator contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { initiator = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< tpgn >> Target Port Group Number (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $tpgn = $obj->tpgn(); # $tpgn contains a reference to the array of values my @tpgn = $obj->tpgn(); # @tpgn contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { tpgn = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< media_scrub_last_done >> Minutes Since Media Scrub Done Filled in for CMode CLI/ZAPI iter =item C<< state_list >> Disk FSM state summary from all nodes (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $state_list = $obj->state_list(); # $state_list contains a reference to the array of values my @state_list = $obj->state_list(); # @state_list contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { state_list = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< raid_flags >> RAID Flags possible value(s) are, copying , in_fdr , media_scrubbing , notzeroed , offline , prefailed , replacing , reconstructing , sparecore , zeroed , zeroing (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $raid_flags = $obj->raid_flags(); # $raid_flags contains a reference to the array of values my @raid_flags = $obj->raid_flags(); # @raid_flags contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { raid_flags = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter =item C<< disk_cluster_name >> Disks Cluster Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vendor >> Vendor Name Filled in for CMode CLI/ZAPI iter, 7Mode CLI. Mapping for CMode ZAPI iter: Maps to: 7M CLI : 'vendor' of 'storage show disk' command =back =cut package NACL::CS::StorageDisk; use strict; use warnings; use Params::Validate qw(validate validate_pos HASHREF); use NATE::Log qw(log_global); use NACL::Exceptions::NoElementsFound qw(:try); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => "aggregate", scalar => "array_name", scalar => "assigned_pool", scalar => "bay", scalar => "bps", scalar => "blocksread", scalar => "datecode", scalar => "blockswritten", scalar => "capacity", scalar => "capacity_sectors", scalar => "chan", scalar => "checksum", scalar => "checksum_type", scalar => "container", scalar => "copydestination", scalar => "copypercent", scalar => "count", scalar => "detailstate", scalar => "disk", array => "diskpathnames", scalar => "disk_type", scalar => "effective_disk_type", scalar => "effective_type", array => "errors", scalar => "grown_defect_list_count", scalar => "homeid", scalar => "home", scalar => "home_str", scalar => "hostadapter", array => "initiator_io_kbps", array => "initiator_iops", array => "initiator_lun_in_use_count", array => "initiator_side_switch_port", array => "initiator", scalar => "immediate", scalar => "fake_ssd", scalar => "is_bcs", scalar => "is_dynamically_qualified", scalar => "is_fdr", scalar => "is_offline", scalar => "is_prefailed", scalar => "is_reconstructing", scalar => "is_replacing", scalar => "is_scrubbing", scalar => "is_sparecore", scalar => "is_zeroed", scalar => "is_zeroing", scalar => "qual_flags", array => "lun", array => "lun_io_kbps", array => "lun_iops", array => "lun_path_use_state", scalar => "model", array => "nodelist", scalar => "outage_reason", scalar => "ownerid", scalar => "last_block", scalar => "owner", scalar => "owner_str", array => "path_io_kbps", array => "path_iops", array => "path_link_errors", array => "path_lun_in_use_count", array => "path_quality", scalar => "percent_rated_life_used", scalar => "percent_spares_consumed", scalar => "percent_spares_consumed_limit", scalar => "physical_blocks", scalar => "physicalblocks", scalar => "physicalsize", scalar => "plex", scalar => "pool", array => "port_speed", scalar => "position", scalar => "poweron_hours", scalar => "poweron_seconds", scalar => "primaryport", scalar => "prefailed", scalar => "raidgroup", scalar => "raidtype", scalar => "reconstructionpercent", scalar => "reserver", scalar => "revision", scalar => "rightsize_sectors", scalar => "rpm", scalar => "sanown_failed", scalar => "scrub_count", scalar => "scrub_last_done", scalar => "scrub_last_done_seconds", scalar => "secondaryname", scalar => "secondaryport", scalar => "sectorcount", scalar => "sectors_read", scalar => "sectors_written", scalar => "serialnumber", scalar => "shelf", scalar => "shm_timeinterval", scalar => "spare_pool", scalar => "state", array => "target_io_kbps", array => "target_iops", array => "target_lun_in_use_count", array => "target_port_access_state", array => "target_side_switch_port", array => "target_wwpn", array => "tpgn", scalar => "type", scalar => "uuid", scalar => "usedblocks", scalar => "usedsize", scalar => "vendor", scalar => "zeroed", scalar => "zeroingpercent", scalar => "container_type", scalar => "disk_iops_total", scalar => "raid_group", scalar => "node_name", scalar => "primary_port_name", scalar => "usable_size", scalar => "uid", scalar => "firmware_revision", scalar => "firmware", scalar => "usable_size_blocks", scalar => "force_owner", scalar => "media_scrub_count", scalar => "physical_size", scalar => "secondary_port", scalar => "is_spare_zeroing", scalar => "serial_number", scalar => "raid_controller", scalar => "physical_size_blocks", scalar => "is_spare_media_scrubbing", scalar => "copy_percent", scalar => "shm_time_interval", scalar => "zeroing_percent", array => "disk_port", scalar => "right_size_sectors", scalar => "is_spare_zeroed", scalar => "hidden_uid", scalar => "effective_rpm", scalar => "is_sanown_failed", scalar => "is_disk_zeroing", scalar => "poolnum", scalar => "scrubcount", scalar => "disk_zeroing_percent", scalar => "is_disk_zeroed", scalar => "secondary_name", array => "disk_port_name", scalar => "is_in_fdr", scalar => "copy_destination", scalar => "home_id", scalar => "is_spare_offline", scalar => "spare_zeroing_percent", scalar => "position_str", scalar => "primary_port", scalar => "is_multidisk_carrier", scalar => "physical_size_mb", scalar => "container_type_str", scalar => "reserver_id", scalar => "carrier_id", scalar => "average_latency", scalar => "is_disk_offline", scalar => "host_adapter", scalar => "type_str", scalar => "disk_io_kbps_total", scalar => "physical_size_512b", scalar => "power_on_seconds", scalar => "usable_size_mb", scalar => "is_disk_media_scrubbing", scalar => "checksum_compatibility", scalar => "media_scrub_last_done_seconds", scalar => "owner_id", scalar => "reconstruction_percent", scalar => "power_on_hours", scalar => "rpm_hidden", scalar => "path_error_count", scalar => "effective_type_str", scalar => "media_scrub_last_done", array => "raid_flags", scalar => "dr_home_id", scalar => "dr_home", array => "preferred_target_port", scalar => "dr_home_str", scalar => "used_size_blocks", scalar => "used_size", scalar => "orig_owner", scalar => "allow_mixing", scalar => "mini_disk_header_present", scalar => "is_foreign", scalar => "import_in_progress", scalar => "reservation_key", scalar => "reservation_type", array => "vmdisk_hypervisor_area_name", array => "vmdisk_hypervisor_file_name", scalar => "data_owner", scalar => "is_shared", scalar => "root_owner_id", scalar => "root_owner", scalar => "stack_id", scalar => "data_owner_id", scalar => "shelf_uid", scalar => "storage_pool", scalar => "primary_lun", scalar => "disk_cluster_name", array => "vmdisk_device_id", scalar => "fsm_state", scalar => "container_name", array => "aggregate_list", array => "state_list", scalar => "is_error", array => "error_text_list", array => "error_type", scalar => "vmdisk_backing_serial_number", scalar => "vmdisk_backing_disk_model", scalar => "vmdisk_backing_vendor_id", scalar => "vmdisk_backing_device_id", scalar => "is_shareable", scalar => "is_internal_disk", scalar => "is_sed", scalar => "is_power_on_lock_enabled", scalar => "key_id", scalar => "storage_pool_uuid", array => "node_for_pool", array => "pool_suggestion", scalar => "is_local_attach", scalar => "replacing", ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); sub isa { $Log->enter() if $may_enter; my ($pkg_or_obj, $kind) = @_; my $isa = $pkg_or_obj->_build_isa( kind => $kind, alias => 'NACL::CS::Disk' ); $Log->exit() if $may_exit; return $isa; } =head1 METHODS =head2 fetch my $StorageDisk_state = NACL::CS::StorageDisk->fetch(command_interface => $ci, ...); my @StorageDisk_states = NACL::CS::StorageDisk->fetch(command_interface => $ci, ...); (Class method) Discovers which elements are present and returns their state in ComponentState objects. Called in scalar context it returns only one state object, in list context it returns all state objects. See L for a more detailed description along with a complete explanation of the options it accepts. Uses CMode CLI/ZAPI. Invokes storage-disk-get-iter API for CMode ZAPI iter. =over =item Exceptions =over =item C When there are no elements matching the query specified or elements of that type doesn't exist, then this exception will be thrown. =back =back =cut sub fetch { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', check => '_check_cmode_zapi', zapi_type => 'iter' }, { method => '_fetch_7mode_cli', interface => 'CLI', set => '7Mode|Nodescope', }, ], show_cmd => 'storage disk show', exception_text => 'No matching storage disk(s) found', frontend => 'NACL::CS::StorageDisk::fetch', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@args, api => 'storage_disk_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, %opts) = @_; my %filter = %{$opts{filter}}; my @requested_fields = @{$opts{requested_fields}}; # ZAPI returns only the pool-number, not the pool name. So if # "pool" (i.e. the name) is specified through either filter/requested_fields, # transform it into a form the ZAPI understands. if (exists $filter{pool} && !exists $filter{poolnum}) { my $pool = delete $filter{pool}; my $final_pool; if ($pool =~ /Pool(\d+)/i) { $final_pool = $1; } elsif ($pool eq 'NONE') { $final_pool = '-'; } else { $final_pool = $pool; } $filter{poolnum} = $final_pool; } if (grep {$_ eq 'pool'} @requested_fields) { push @requested_fields, 'poolnum'; } my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( %opts, requested_fields => \@requested_fields, filter => \%filter, map => { 'is-foreign' => ['disk-inventory-info', 'is-foreign'], 'lun' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'lun-number' ], 'target-side-switch-port' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-side-switch-port', ], 'rpm' => ['disk-inventory-info', 'rpm'], 'disk-iops-total' => ['disk-stats-info', 'disk-iops'], 'raid-group' => [ 'disk-raid-info', 'disk-aggregate-info', 'raid-group-name' ], 'firmware-revision' => ['disk-inventory-info', 'firmware-revision'], 'percent-rated-life-used' => [ 'disk-inventory-info', 'storage-ssd-info', 'percent-rated-life-used' ], 'usable-size-blocks' => ['disk-raid-info', 'used-blocks'], 'grown-defect-list-count' => ['disk-inventory-info', 'grown-defect-list-count'], 'percent-spares-consumed' => [ 'disk-inventory-info', 'storage-ssd-info', 'percent-spares-consumed', ], 'port-speed' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-port-speed', ], 'media-scrub-count' => ['disk-inventory-info', 'media-scrub-count'], 'vmdisk-backing-serial-number' => [ 'disk-inventory-info', 'vmdisk-backing-info', 'vmdisk-backing-serial-number' ], 'bay' => ['disk-inventory-info', 'shelf-bay'], 'bps' => ['disk-inventory-info', 'bytes-per-sector'], 'path-link-errors' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'path-link-errors', ], 'is-spare-zeroing' => ['disk-raid-info', 'disk-spare-info', 'is-zeroing'], 'serial-number' => ['disk-inventory-info', 'serial-number'], 'raid-controller' => ['disk-raid-info', 'active-node-name'], 'physical-size-blocks' => ['disk-raid-info', 'physical-blocks'], 'dr-home-id' => ['disk-ownership-info', 'dr-home-node-id'], 'vmdisk-backing-disk-model' => [ 'disk-inventory-info', 'vmdisk-backing-info', 'vmdisk-backing-disk-model' ], 'model' => ['disk-inventory-info', 'model'], 'is-spare-media-scrubbing' => [ 'disk-raid-info', 'disk-spare-info', 'is-media-scrubbing', ], 'vmdisk-hypervisor-area-name' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'vmdisk-hypervisor-area-name', ], 'shm-time-interval' => [ 'disk-inventory-info', 'health-monitor-time-interval' ], 'spare-pool' => ['disk-raid-info', 'spare-pool'], 'storage-pool' => [ 'disk-raid-info', 'disk-shared-info', 'storage-pool' ], 'import-in-progress' => ['disk-inventory-info', 'import-in-progress'], 'is-local-attach' => [ 'disk-metrocluster-info', make_zapi_skip('is-local-attach') ], 'lun-io-kbps' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'lun-io-kbps', ], 'shelf' => ['disk-inventory-info', 'shelf'], 'right-size-sectors' => ['disk-inventory-info', 'right-size-sectors'], 'disk-port' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'disk-port', ], 'is-spare-zeroed' => [ 'disk-raid-info', 'disk-spare-info', 'is-zeroed' ], 'lun-iops' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'lun-iops', ], 'dr-home' => ['disk-ownership-info', 'dr-home-node-name'], 'diskpathnames' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'disk-name' ], 'target-port-access-state' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-port-access-state', ], 'effective-rpm' => ['disk-raid-info', 'effective-rpm'], 'array-name' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'array-name' ], 'is-sanown-failed' => ['disk-ownership-info', 'is-failed'], 'data-owner' => ['disk-ownership-info', 'data-owner'], 'aggregate' => [ 'disk-raid-info', 'disk-aggregate-info', 'aggregate-name', ], 'owner' => ['disk-ownership-info', 'owner-node-name'], 'poolnum' => ['disk-ownership-info', 'pool'], 'target-wwpn' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-wwpn', ], 'is-shared' => ['disk-inventory-info', 'is-shared'], 'preferred-target-port' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'preferred-target-port', ], 'root-owner-id' => ['disk-ownership-info', 'root-owner-id'], 'path-io-kbps' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'path-io-kbps', ], 'initiator-side-switch-port' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-side-switch-port', ], 'disk-port-name' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'disk-port-name', ], 'is-in-fdr' => ['disk-raid-info', 'disk-outage-info', 'is-in-fdr'], 'root-owner' => ['disk-ownership-info', 'root-owner'], 'home-id' => ['disk-ownership-info', 'home-node-id'], 'vmdisk-backing-vendor-id' => [ 'disk-inventory-info', 'vmdisk-backing-info', 'vmdisk-backing-vendor-id' ], 'initiator-iops' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-iops', ], 'is-spare-offline' => ['disk-raid-info', 'disk-spare-info', 'is-offline'], 'spare-zeroing-percent' => [ 'disk-raid-info', 'disk-spare-info', 'zeroing-percent-complete' ], 'initiator-io-kbps' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-io-kbps', ], 'position-str' => ['disk-raid-info', 'position'], 'position' => ['disk-raid-info', 'position'], 'percent-spares-consumed-limit' => [ 'disk-inventory-info', 'storage-ssd-info', 'percent-spares-consumed-limit' ], 'is-multidisk-carrier' => [ 'disk-inventory-info', make_zapi_skip('disk-inventory-info'), 'is-multidisk-carrier' ], 'vmdisk-backing-device-id' => [ 'disk-inventory-info', 'vmdisk-backing-info', 'vmdisk-backing-device-id' ], 'container-type-str' => ['disk-raid-info', 'container-type'], 'container-type' => ['disk-raid-info', 'container-type'], 'reserver-id' => ['disk-ownership-info', 'reserved-by-node-id'], 'target-iops' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-iops', ], 'home' => ['disk-ownership-info', 'home-node-name'], 'path-iops' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'path-iops', ], 'carrier-id' => ['disk-inventory-info', 'carrier-id'], 'average-latency' => ['disk-stats-info', 'average-latency'], 'vmdisk-hypervisor-file-name' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'vmdisk-hypervisor-file-name', ], 'stack-id' => ['disk-inventory-info', 'stack-id'], 'type-str' => ['disk-inventory-info', 'disk-type'], 'type' => ['disk-inventory-info', 'disk-type'], 'outage-reason' => ['disk-raid-info', 'disk-outage-info', 'reason',], 'target-lun-in-use-count' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-lun-in-use-count', ], 'disk-io-kbps-total' => ['disk-stats-info', 'disk-io-kbps'], 'sectors-written' => ['disk-stats-info', 'sectors-written'], 'power-on-seconds' => ['disk-stats-info', 'power-on-time-interval'], 'path-lun-in-use-count' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'path-lun-in-use-count', ], 'lun-path-use-state' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'lun-path-use-state', ], 'data-owner-id' => ['disk-ownership-info', 'data-owner-id'], 'capacity-sectors' => ['disk-inventory-info', 'capacity-sectors'], 'reservation-key' => ['disk-inventory-info', 'reservation-key'], 'shelf-uid' => ['disk-inventory-info', 'shelf-uid'], 'aggregate-list' => [ 'disk-raid-info', 'disk-shared-info', make_zapi_array('aggregate-list'), make_zapi_skip('shared-aggregate-info'), make_zapi_skip('aggregate-name'), ], 'checksum-compatibility' => ['disk-inventory-info', 'checksum-compatibility'], 'media-scrub-last-done-seconds' => [ 'disk-inventory-info', 'media-scrub-last-done-time-interval' ], 'nodelist' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'node', ], 'owner-id' => ['disk-ownership-info', 'owner-node-id'], 'reservation-type' => ['disk-inventory-info', 'reservation-type'], 'disk' => 'disk-name', 'sectors-read' => ['disk-stats-info', 'sectors-read'], 'is-dynamically-qualified' => ['disk-inventory-info', 'is-dynamically-qualified'], 'target-io-kbps' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'target-io-kbps', ], 'plex' => ['disk-raid-info', 'disk-aggregate-info', 'plex-name'], 'vmdisk-device-id' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'vmdisk-device-id', ], 'initiator-lun-in-use-count' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-lun-in-use-count', ], 'path-quality' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'path-quality', ], 'path-error-count' => ['disk-stats-info', 'path-error-count'], 'effective-type-str' => ['disk-raid-info', 'effective-disk-type'], 'effective-type' => ['disk-raid-info', 'effective-disk-type'], 'initiator' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'initiator-port', ], 'tpgn' => [ make_zapi_array('disk-paths'), make_zapi_skip('disk-path-info'), 'tpgn', ], 'disk-cluster-name' => ['disk-inventory-info', 'disk-cluster-name'], 'vendor' => ['disk-inventory-info', 'vendor'], 'uid' => ['disk-uid'], }, fix_response => sub { # ZAPI returns array-name in multiple disk-paths entries, so it # ends up constructing the value as an array (with all values of # the array being the same). However, this is a scalar field, # so let's fix it my %fix_opts = @_; my $arr_name = $fix_opts{cli}{'array-name'}; if (defined $arr_name && ref $arr_name eq 'ARRAY') { $fix_opts{cli}{'array-name'} = $arr_name->[0]; } # Use the value of used-blocks to set the value for usable-size if (exists $fix_opts{zapi}{'disk-raid-info'}) { my $used_blocks = $fix_opts{zapi}{'disk-raid-info'}->[0]{'used-blocks'}; # 1 block = 4096 bytes my $usable_size = $used_blocks * 4096; $fix_opts{cli}{'usable-size'} = $usable_size; } return %fix_opts; }, fix_desired_attributes => sub { # ZAPI only returns number of used blocks, not usable-size. So, the # approach will be to add "used-blocks" to desired-attributes # if "usable-size" is present in either filter/requested_fields. my %opts = @_; my $desired_attributes = $opts{desired_attributes}; if (exists $filter{'usable-size'} || grep {$_ eq 'usable-size'} @requested_fields) { $desired_attributes->{'disk-raid-info'}{'used-blocks'} = ''; } }, api => "storage-disk-get-iter", ); foreach my $cs (@state_objs) { my $poolnum = $cs->poolnum(); if (defined $poolnum) { my $pool; if ($poolnum eq '-') { $pool = 'NONE'; } else { $pool = "Pool$poolnum"; } $cs->pool($pool); } } # ZAPI could not filter by usable-size, so let's do it here if (exists $filter{'usable-size'}) { $pkg->_apply_filter( state_objs => \@state_objs, filter => {'usable-size' => $filter{'usable-size'}}, ); } $Log->exit() if $may_exit; return @state_objs; } sub _fetch_7mode_cli { $Log->enter() if $may_enter; my $pkg = shift; my %opts = validate @_, $pkg->_fetch_backend_validate_spec(); my $apiset = $opts{apiset}; my $requested_fields = $opts{requested_fields}; my $filter = $opts{filter}; my (@diskshow_args); my @state_objs; # Provide a large timeout so that the command will not timeout if there is # a lot of output to display my $timeout = $opts{'timeout'} || 1200; push @diskshow_args, ('connectrec-timeout' => $timeout); my @orig_requested_fields = @{$opts{requested_fields}}; my %orig_filter = %{$opts{filter}}; $pkg->_remove_relational_regex_filters( filter => \%orig_filter, requested_fields => \@orig_requested_fields ); $requested_fields = \@orig_requested_fields; $filter = \%orig_filter; # The only server-side filtering possible in 7Mode is if the # caller limits to one disk name, then we can get info on just # that disk. Otherwise, we get info on all disks and # filter out undesired entries somewhere below. if (defined $filter->{disk}) { push @diskshow_args, (disk => $filter->{disk}); } if ($filter->{owner}) { if ($filter->{owner} eq '-') { push @diskshow_args, ('not-owned' => 1); } else { push @diskshow_args, ('owner-name' => $filter->{owner}); } } elsif ($filter->{homeid}) { if ($filter->{homeid} eq '-') { push @diskshow_args, ('not-owned' => 1); } else { push @diskshow_args, (sysid => $filter->{homeid}); } } else { push @diskshow_args, (verbose => 1); } my ($response, $caught_exception); my %temp_hash; try { $response = $apiset->disk_show(@diskshow_args); } catch NACL::APISet::Exceptions::UnexpectedOutputException with { # A caught exception indicates that the disk being looked for # does not exist. We catch the exception and return immediately. The # 'fetch' frontend decides whether to throw a NoElementsFound # exception based on the value of 'allow_empty' $caught_exception = 1; }; if ($caught_exception) { $Log->exit() if $may_exit; return; } my $output = $response->get_parsed_output(); foreach my $row (@$output) { # If owner is "not owned" set then there wont be any homeID for the disks if ($row->{owner} =~ /not\s+owned/i) { $row->{owner} = '-'; $row->{homeid} = '-'; $row->{home} = '-'; } else { if ($row->{owner}) { $row->{owner} =~ /^(.*)\(/; $row->{owner} = $1; } if ($row->{dr_home}) { $row->{dr_home} =~ /.*\((.*)\)/; $row->{homeid} = $1; } } my $state_base_field_settings = $pkg->_hash_copy( source => $row, copy => [qw(disk pool home owner homeid)], map => { 'serial_number' => 'serialnumber', 'chksum' => 'checksum_compatibility' }, ); my $obj = $pkg->new(command_interface => $opts{command_interface}); $obj->_set_fields(row => $state_base_field_settings); push @state_objs, $obj; $temp_hash{$obj->disk()} = $obj; } ## end foreach my $row (@$output) my %commands = $pkg->_handle_commands_returning_common_fields( common_fields => [qw(bay shelf)], commands => { 'aggr_status_r' => [ qw(rpm type physicalsize usedsize chan state zeroed aggregate raidgroup zeroingpercentage container-type) ], 'storage_show_disk' => [qw(revision vendor model)] }, preferred_command => 'storage_show_disk', requested_fields => $requested_fields, filter => $filter ); if (exists $commands{'aggr_status_r'}) { # call "aggr status -r" to get fill in all the other fields. my $aggr_status_response = $apiset->aggr_status('raid-disk' => 1); my $aggr_output = $aggr_status_response->get_parsed_output(); # Details of spare disks and disks assigned to aggregates are listed # Extract info of all the spare disks. my @spare_disk_array; my $spare_output = $aggr_output->[0]->{spare_disks}; my ($spare_disks) = values(%{$spare_output->[0]}); # The format of the output of "aggr status -r" changes when # "syncmirror_local" feature is licensed on the "command_interface". if (ref $spare_disks eq 'ARRAY') { foreach my $spare_output (@{$aggr_output->[0]->{spare_disks}}) { my ($spare_disks) = values(%$spare_output); push(@spare_disk_array, @$spare_disks); } } else { push(@spare_disk_array, @$spare_output); } # This code is common for spare disks and those assigned to # aggregates, so placing it in this anonmous subroutine to # elimiinate code duplication. my $extract_disk_info = sub { my ($disk_hash) = validate_pos(@_, {type => HASHREF}); # Unforunately the APISet parser is currently inconsistent # in the name it gives this field. For spare disks it's # named "phys(MB/blks)", but for those assigned to aggregates # they're named "phys_mb/blks" my $physicalsize = $disk_hash->{'phys(MB/blks)'} || $disk_hash->{'phys_mb/blks'}; my $usedsize = $disk_hash->{'used(MB/blks)'} || $disk_hash->{'used_mb/blks'}; $physicalsize =~ /(.*)\//; $disk_hash->{physicalsize} = $1; $usedsize =~ /(.*)\//; $disk_hash->{usedsize} = $1; my $disk_info = $pkg->_hash_copy( source => $disk_hash, copy => [qw(bay rpm shelf type physicalsize chan usedsize)], map => { 'raid_disk' => 'state', 'is_zeroed' => 'zeroed', } ); return $disk_info; }; foreach my $spare_disk_info (@spare_disk_array) { my $disk_name = $spare_disk_info->{device}; if (defined $temp_hash{$disk_name}) { my $obj = $temp_hash{$disk_name}; my $disk_info = $extract_disk_info->($spare_disk_info); $disk_info->{zeroed} = ($disk_info->{zeroed} eq '') ? 'true' : 'false'; $disk_info->{aggregate} = '-'; $disk_info->{raidgroup} = '-'; $disk_info->{plex} = '-'; $disk_info->{'container-type'} = 'spare'; $obj->_set_fields(row => $disk_info); } ##if (defined $temp_hash{ } ## end foreach my $spare_disk_info... # Extract info of all the disks which are present in aggregates. foreach my $aggr (@{$aggr_output->[0]->{aggregate}}) { my $aggr_name = $aggr->{aggregate}; foreach my $plex_info (@{$aggr->{plex}}) { my $plex_name = $plex_info->{plex_name}; foreach my $plex_raid (@{$plex_info->{raid_group}}) { my $raid_name = $plex_raid->{raid_group_name}; foreach my $plex_disk (@{$plex_raid->{disks}}) { my $disk_name = $plex_disk->{device}; if (defined $temp_hash{$disk_name}) { my $obj = $temp_hash{$disk_name}; my $disk_info = $extract_disk_info->($plex_disk); $disk_info->{state} = '-' if ($disk_info->{state} eq '?'); $disk_info->{aggregate} = $aggr_name; $disk_info->{plex} = $plex_name; $disk_info->{raidgroup} = $raid_name; $disk_info->{zeroed} = '-'; $disk_info->{zeroingpercent} = '-'; $disk_info->{'container-type'} = 'aggregate'; $obj->_set_fields(row => $disk_info); } ##if (defined $temp_hash( } ## end foreach my $plex_disk ( @{ ... } ## end foreach my $plex_raid ( @{ ... } ## end foreach my $plex_info ( @{ ... } ## end foreach my $aggr ( @{ $aggr_output... foreach my $broken_disk (@{$aggr_output->[0]->{broken_disks}}) { my $disk_name = $broken_disk->{'device'}; if (defined $temp_hash{$disk_name}) { my $obj = $temp_hash{$disk_name}; my $disk_info = $extract_disk_info->($broken_disk); $disk_info->{'state'} = "broken"; $obj->_set_fields(row => $disk_info); } } foreach my $partner_disk (@{$aggr_output->[0]->{partner_disks}}) { my $disk_name = $partner_disk->{device}; if (defined($disk_name && $temp_hash{$disk_name})) { my $obj = $temp_hash{$disk_name}; my $disk_info = $extract_disk_info->($partner_disk); $disk_info->{'container-type'} = 'partner'; $obj->_set_fields(row => $disk_info); } ##if (defined $temp_hash{ } ## end foreach my $partner_disk_info... } # Check if any of the fields filled only by running the command # "storage show disk" are required in the state object if (exists $commands{'storage_show_disk'}) { my @show_disk_args; push @show_disk_args, ('specific' => 1); if (defined $filter->{disk}) { push @show_disk_args, ('disk-name' => $filter->{disk}); } # call "storage show disk" to get fill in revision, model and vendor # fields. my $storage_show_disk_response = $apiset->storage_show_disk(@show_disk_args); my $disk_show_output = $storage_show_disk_response->get_parsed_output(); foreach my $disk_show_info (@{$disk_show_output}) { my $disk_name = $disk_show_info->{disk}; next if (!$temp_hash{$disk_name}); my $obj = $temp_hash{$disk_name}; my $disk_info = $pkg->_hash_copy( source => $disk_show_info, copy => [qw(model vendor)], map => {'rev' => 'revision',}, ); $obj->_set_fields(row => $disk_info); } } # Adding '-' as the state value if "state" is not defined. foreach my $state_obj (@state_objs) { $state_obj->state() || $state_obj->state('-'); if (($state_obj->{state} eq '-') && ($state_obj->{owner} eq '-')) { $state_obj->container_type('unassigned'); } } return @state_objs; } ## end sub _fetch_7mode_cli sub _check_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, %opts) = @_; my $filter = $opts{filter}; my @requested = $opts{requested_fields}; if ('orig-owner' ~~ @requested || defined $filter->{'orig-owner'}) { $Log->exit() if $may_exit; NACL::Exceptions::InvalidChoice->throw("'orig-owner' is not supported " . " by the ZAPI, hence ZAPI cannot be used. "); } } =head1 CANNED FILTERS See http://wikid.netapp.com/w/QA/projects/Libraries_Initiative/Project/Common_Infrastructure/Users_Guide/Component_Layer_Users_Guide#Canned_filters for a description of canned filters. =head1 Returns StorageDisk which are spare. =cut sub _canned_filter_spare { return { 'container-type' => 'spare'}; } 1;