Class: IControl::System::Disk

Inherits:
Base
  • Object
show all
Defined in:
lib/icontrol/system/disk.rb,
lib/icontrol/system.rb

Overview

The Disk interface enables you to manage the disks in the system. The disk objects come in two flavors. "Physical disks“ are the actual hardware disk drives, which can be anything from a true hard disk to a compact flash drive to a USB flash drive. Physical disks are addressed by their serial numbers. "Logical disks” are the view of the disk drives from the system’s point of view, abstracting the disk itself, making all disk drives look the same whether they are a true hard disk, a flash drive, or a full disk array. In other words, a logical disk can hold one or more physical disks. Logical disks are addressed by the LogicalDisk identifier, which includes their logical name (e.g., "HD2“, "CF1”, "MD1“) and their chassis slot identifier. It is important to note the potentially confusing relationship between logical and physical disks and their identifiers. All physical disks can be addressed by a LogicalDisk identifier, though it is not guaranteed that all physical disks have an entry in the logical disk table. The logical disk identifier for a physical disk is dependent on the connection of the disk drive to the system, so can change if the system’s disk drive configuration changes. On the other hand, all logical disks hold one or more physical disks, which can have a direct one-to-one mapping for a single disk drive or a one-to-many mapping for a disk array. To avoid problems, physical disks should be ideally addressed only by their serial numbers and logical disks only by their LogicalDisk identifiers. Addressing physical disks by their LogicalDisk identifier is supported as a convenience for any user-generated input. Be careful with these distinctions as you use this interface.

Defined Under Namespace

Classes: LogicalDisk, LogicalDiskSequence, LogicalDiskSequenceSequence, RAIDStatus, RAIDStatusSequence

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IControl::Base

Instance Method Details

#add_array_member(opts) ⇒ Object

Adds physical disk to a set of logical disk arrays. For a clustered system, this must be run on the chassis slot holding the disk array. This only works for logical disk which represent disk arrays.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String[])

    The serial numbers of the physical disks to add to each specified logical disk array.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



43
44
45
46
# File 'lib/icontrol/system/disk.rb', line 43

def add_array_member(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#add_array_member_by_logical_id(opts) ⇒ Object

Adds physical disk to a set of logical disk arrays. For a clustered system, this must be run on the chassis slot holding the disk array. This only works for logical disk which represent disk arrays. This method does exactly the same thing as "add_array_member“, except that the added physical disk are specified by their LogicalDisk identifiers, more convenient for user input than the serial numbers used in "remove_array_member”. It is supplied for convenience purposes only.

Parameters:

  • opts (Hash)

Options Hash (opts):

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



61
62
63
64
# File 'lib/icontrol/system/disk.rb', line 61

def add_array_member_by_logical_id(opts)
  opts = check_params(opts,[:names])
  super(opts)
end

#array_memberString[]

Gets a list of physical disk that are members of a logical disk. Note that this can be used for any type of logical disk – single disk drives or disk arrays. However, it may not work for all physical disk logical identifiers.

Returns:

  • (String[])

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



75
76
77
# File 'lib/icontrol/system/disk.rb', line 75

def array_member
  super
end

#array_status(opts) ⇒ RAIDStatus

Gets RAID disk array statuses for a set of physical disk. Note: RAID status will be RAID_STATUS_UNDEFINED if the disk is not a member of a RAID disk array (see get_physical_disk_is_array_member).

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String)

    The serial numbers of the disks of interest.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



89
90
91
92
# File 'lib/icontrol/system/disk.rb', line 89

def array_status(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#bay_disk_serial_number(opts) ⇒ String

Gets a list of serial numbers of disk installed for a set of disk bays.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :ids (long)

    The identifiers for the disk bays of interest.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



103
104
105
106
# File 'lib/icontrol/system/disk.rb', line 103

def bay_disk_serial_number(opts)
  opts = check_params(opts,[:ids])
  super(opts)
end

#is_array_member(opts) ⇒ boolean

Gets states indicating whether a disk is a member of a RAID disk array for a set of physical disk.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String)

    The serial numbers of the disks of interest.

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



237
238
239
240
# File 'lib/icontrol/system/disk.rb', line 237

def is_array_member(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#is_raid_capableboolean

Gets an indication of whether the system is capable of RAID operations.

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



249
250
251
# File 'lib/icontrol/system/disk.rb', line 249

def is_raid_capable
  super
end

#listString

Gets a list of physical disk in the system, identified by serial number.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



115
116
117
# File 'lib/icontrol/system/disk.rb', line 115

def list
  super
end

#list_of_bayslong

Gets a list of disk bays in the system.

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



126
127
128
# File 'lib/icontrol/system/disk.rb', line 126

def list_of_bays
  super
end

#list_of_logical_disksLogicalDisk

Gets a list of logical disk in the system.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



137
138
139
# File 'lib/icontrol/system/disk.rb', line 137

def list_of_logical_disks
  super
end

#logical_disk_device_nameString

Gets device names for a set of logical disk. These are names like hda, hdb, etc. (Note: Currently, the strings are for descriptive purposes and are subject to change).

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



149
150
151
# File 'lib/icontrol/system/disk.rb', line 149

def logical_disk_device_name
  super
end

#logical_disk_formatString

Gets the formats for a set of logical disk. These are strings like multiboot, lvm, etc. (Note: Currently, the strings are for descriptive purposes and are subject to change).

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



162
163
164
# File 'lib/icontrol/system/disk.rb', line 162

def logical_disk_format
  super
end

#logical_disk_mediaString

Gets media types for a set of logical disk. These are strings like hd, cf, cft, etc. (Note: Currently, the strings are for descriptive purposes and are subject to change).

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



174
175
176
# File 'lib/icontrol/system/disk.rb', line 174

def logical_disk_media
  super
end

#logical_disk_sizelong

Gets sizes (in MiB) for a set of logical disk.

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



185
186
187
# File 'lib/icontrol/system/disk.rb', line 185

def logical_disk_size
  super
end

#name(opts) ⇒ String

Gets names for a set of physical disk. This name is part of the physical disk’s LogicalDisk identifier.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String)

    The serial numbers of the disks of interest.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



199
200
201
202
# File 'lib/icontrol/system/disk.rb', line 199

def name(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#remove_array_member(opts) ⇒ Object

Removes phyiscal disk from a set of logical disk arrays. For a clustered system, this must be run on the chassis slot holding the disk array. This only works for logical disk which represent disk arrays.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String[])

    The serial numbers of the physical disks to add to each specified logical disk array.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



263
264
265
266
# File 'lib/icontrol/system/disk.rb', line 263

def remove_array_member(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#remove_array_member_by_logical_id(opts) ⇒ Object

Removes physical disk from a set of logical disk arrays. For a clustered system, this must be run on the chassis slot holding the disk array. This only works for logical disk which represent disk arrays. This method does exactly the same thing as "remove_array_member“, except that the removed physical disk are specified by their LogicalDisk identifiers, more convenient for user input than the serial numbers used in "remove_array_member”. It is supplied for convenience purposes only.

Parameters:

  • opts (Hash)

Options Hash (opts):

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



282
283
284
285
# File 'lib/icontrol/system/disk.rb', line 282

def remove_array_member_by_logical_id(opts)
  opts = check_params(opts,[:names])
  super(opts)
end

#slot_id(opts) ⇒ long

Gets slot identifiers for a set of physical disk. The slot identifier is part of the physical disk’s LogicalDisk identifer.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :serial_numbers (String)

    The serial numbers of the disks of interest.

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



214
215
216
217
# File 'lib/icontrol/system/disk.rb', line 214

def slot_id(opts)
  opts = check_params(opts,[:serial_numbers])
  super(opts)
end

#versionString

Gets the version information for this interface.

Returns:

  • (String)


223
224
225
# File 'lib/icontrol/system/disk.rb', line 223

def version
  super
end