Class: MintPress::InfrastructureOci::OCIStorage
- Inherits:
-
MintPress::Infrastructure::ISCSIBlockDevice
- Object
- MintPress::Infrastructure::MountPoint
- MintPress::Infrastructure::BlockDevice
- MintPress::Infrastructure::ISCSIBlockDevice
- MintPress::InfrastructureOci::OCIStorage
- Includes:
- MintLogger, Mixins::GenericProvider, Mixins::Properties
- Defined in:
- src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb
Direct Known Subclasses
Properties (Read/Write)
-
#volume_id ⇒ String (Default Value: Proc.new { find_volume_id })
'Volume ID in OCI for this volume.'
Property Attributes- default ⇒ Proc.new { find_volume_id }
33
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 33 property :volume_id, type: String, description: 'Volume ID in OCI for this volume.', default: Proc.new { find_volume_id }
-
#attachment_id ⇒ String
'The attachment ID that links this block device with an instance.'
Property Attributes34
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 34 property :attachment_id, type: String, description: 'The attachment ID that links this block device with an instance.'
-
#attachment_state ⇒ String
'The state of the attachment.'
Property Attributes35
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 35 property :attachment_state, type: String, description: 'The state of the attachment.'
-
#device_node (Default Value: Proc.new { get_oci_device_node })
Property Attributes- default ⇒ Proc.new { get_oci_device_node }
37
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 37 property :device_node, default: Proc.new { get_oci_device_node }
-
#device_path ⇒ String
'The device path for this device on this host.'
Property Attributes40
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 40 property :device_path, type: String, description: 'The device path for this device on this host.'
-
#availability_domain ⇒ String (Default Value: Proc.new { self.host.values[0].availability_domain })
'The availability domain ID that will be used for all the storage built using this provider.'
Property Attributes- default ⇒ Proc.new { self.host.values[0].availability_domain }
42
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 42 property :availability_domain, type: String, description: 'The availability domain ID that will be used for all the storage built using this provider.', default: Proc.new { self.host.values[0].availability_domain }
-
#compartment ⇒ String (Default Value: Proc.new { self.platform.compartment })
'The compartment ID that will be used for all the VMs built using this provider.'
Property Attributes- default ⇒ Proc.new { self.platform.compartment }
43
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 43 property :compartment, type: String, description: 'The compartment ID that will be used for all the VMs built using this provider.', default: Proc.new { self.platform.compartment }
-
#volume_state ⇒ String
'State of the Volume. Indicates whether the Volume is available or not.'
Property Attributes44
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 44 property :volume_state, type: String, description: 'State of the Volume. Indicates whether the Volume is available or not.'
-
#platform ⇒ MintPress::InfrastructureOci::OciPlatform (Default Value: Proc.new {
if opts[:provider]
MintPress::InfrastructureOci::OciPlatform.new(:provider => opts[:provider])
else
MintPress::InfrastructureOci::OciPlatform.new
end
})
'This incapsulates all properties required for the OCI provider.'
Property Attributes- default ⇒ Proc.new { if opts[:provider] MintPress::InfrastructureOci::OciPlatform.new(:provider => opts[:provider]) else MintPress::InfrastructureOci::OciPlatform.new end }
47 48 49 50 51 52 53
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 47 property :platform, type: MintPress::InfrastructureOci::OciPlatform, default: Proc.new { if opts[:provider] MintPress::InfrastructureOci::OciPlatform.new(:provider => opts[:provider]) else MintPress::InfrastructureOci::OciPlatform.new end }, description: 'This incapsulates all properties required for the OCI provider.'
-
#size_mb (Default Value: Proc.new { find_storage_size })
Property Attributes- default ⇒ Proc.new { find_storage_size }
56
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 56 property :size_mb, default: Proc.new { find_storage_size }
-
#iqn (Default Value: Proc.new { find_iqn })
Property Attributes- default ⇒ Proc.new { find_iqn }
57
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 57 property :iqn, default: Proc.new { find_iqn }
-
#iqn_ip_port (Default Value: Proc.new { find_iqn_ip_port })
Property Attributes- default ⇒ Proc.new { find_iqn_ip_port }
58
# File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_storage.rb', line 58 property :iqn_ip_port, default: Proc.new { find_iqn_ip_port }
-
#iqn ⇒ String
'The IQN value for this volume against the instance. This is required to run the iSCSI commands to mount this on the Host.'
Property Attributes232
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 232 property :iqn, type: String, description: 'The IQN value for this volume against the instance. This is required to run the iSCSI commands to mount this on the Host.'
-
#iqn_ip_port ⇒ String
'The IQN IP:Port value, required by iSCSI.'
Property Attributes233
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 233 property :iqn_ip_port, type: String, description: 'The IQN IP:Port value, required by iSCSI.'
-
#name ⇒ String
Property Attributes16
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 16 property :name, type: String
-
#storage_name ⇒ String (Default Value: Proc.new { r = self.name
if host.keys.length == 1
r = [host.values[0].name,self.name].join('-')
end
r })
The name of the block device in the storage system - this defaults to "hostname-block_device_name"
Property Attributes- default ⇒ Proc.new { r = self.name if host.keys.length == 1 r = [host.values[0].name,self.name].join('-') end r }
18 19 20 21 22 23 24 25 26
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 18 property :storage_name, type: String, default: Proc.new { r = self.name if host.keys.length == 1 r = [host.values[0].name,self.name].join('-') end r }
-
#is_netdev ⇒ [TrueClass, FalseClass] (Default Value: false)
Is this at the other end of a network - for example, iscsi? Defaults to false, unless this is iscsi in which case it defaults to true
Property Attributes- default ⇒ false
31
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 31 property :is_netdev, type: [TrueClass, FalseClass], default: false
-
#storage_group ⇒ String (Default Value: Proc.new { parent.name })
The disk group on the storage - if not specified, this will default to the name of the parent. Note that not all systems utilize this (AWS, for example, does not)
Property Attributes- default ⇒ Proc.new { parent.name }
35
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 35 property :storage_group, type: String, default: Proc.new { parent.name }
-
#storage_class ⇒ String (Default Value: 'Default')
This allows child classes to 'guess' an appropraite IO type Offline - For offline-ish backups. This maps to AWS Glacier and similar backup storage, where access my take real time Capacity - This maps to a 'default' slow type that is usually spinning disk Throughput - This maps to a type which _only_ cares about throughput, but not IOPS Latency - This maps to a low latency disk type Default - whatever the 'default' disk for this platform is Note that this _can_ be overridden with extra allowed_values in child classes to specify exact disks, but this is discouraged! FIXME: This list will almost certainly change as JJ does more mapping!
Property Attributes- allowed_values ⇒ ['Offline', 'Capacity', 'Throughput', 'Latency', 'Default']
- default ⇒ 'Default'
49
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 49 property :storage_class, type: String, allowed_values: ['Offline', 'Capacity', 'Throughput', 'Latency', 'Default'], default: 'Default'
-
#size_mb ⇒ Integer
How large, in megabytes, should this device be?
Property Attributes52
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 52 property :size_mb, type: Integer
-
#mount_point ⇒ String
Where should it be mounted on the filesystem?
Property Attributes54
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 54 property :mount_point, type: String
-
#virtual_name ⇒ String (Default Value: Proc.new { self.name })
This is the name given to an LVM or requiavlent
Property Attributes- default ⇒ Proc.new { self.name }
57
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 57 property :virtual_name, type: String, default: Proc.new { self.name }
-
#shared ⇒ [TrueClass, FalseClass] (Default Value: false)
Does this need to be created as a sharable volume? Note that some storage providers WILL reject this!
Property Attributes- default ⇒ false
61
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 61 property :shared, type: [TrueClass, FalseClass], default: false
-
#volume_managed ⇒ [TrueClass, FalseClass] (Default Value: true)
Do we use the platform's advanced volume manager (LVM on linux), or are these "raw" volumes?
Property Attributes- default ⇒ true
64
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 64 property :volume_managed, type: [TrueClass, FalseClass], default: true
-
#filesystem ⇒ String (Default Value: 'default')
'default' will take the default for the installed target platform - YMMV ;) For now, i've stubbed out allowed_values because of things like oracleasm being able to consume this!
Property Attributes- default ⇒ 'default'
68
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 68 property :filesystem, type: String, default: 'default'
-
#device_node ⇒ String (Default Value: Proc.new { self.parent.allocate_block_device(self) })
If this is left blank, one will be allocated for you This probably does NOT work on mutli-attachments for now, but hopefully this also isn't required in those cases!
Property Attributes- default ⇒ Proc.new { self.parent.allocate_block_device(self) }
73
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 73 property :device_node, type: String, default: Proc.new { self.parent.allocate_block_device(self) }
-
#thin_provision ⇒ [TrueClass, FalseClass]
If this is unset, it will use the platform default
Property Attributes83
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 83 property :thin_provision, type: [TrueClass, FalseClass]
-
#create_partition ⇒ [TrueClass, FalseClass] (Default Value: false)
Should we create a partition? This defaults to false, since dedicated block device partitions are pain if you later want to resize the disk or such like
Property Attributes- default ⇒ false
87
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 87 property :create_partition, type: [TrueClass, FalseClass], default: false
-
#use_gpt ⇒ [TrueClass, FalseClass] (Default Value: true)
If we do create a partition, should it be GPT? Default is true
Property Attributes- default ⇒ true
90
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 90 property :use_gpt, type: [TrueClass, FalseClass], default: true
-
#host ⇒ Hash of ⇒ MintPress::Infrastructure::Host
Which host is this storage attached to?
Property Attributes96
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 96 property :host, type: MintPress::Infrastructure::Host, hash: true
-
#name ⇒ String
Property Attributes10
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 10 property :name, type: String
-
#mount_point ⇒ String
Path to mount the filesystem on the target
Property Attributes12
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 12 property :mount_point, type: String
-
#device_node ⇒ String
Device node to mount - '/dev/sda5' or '/dev/large_vg/large_lvol' for example
Property Attributes14
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 14 property :device_node, type: String
-
#filesystem ⇒ String
Filesystem type - for example, ext4, xfs, nfs
Property Attributes16
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 16 property :filesystem, type: String
-
#persistant ⇒ [TrueClass, FalseClass] (Default Value: true)
Should it persist in /etc/fstab?
Property Attributes- default ⇒ true
18
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 18 property :persistant, default: true, type: [TrueClass, FalseClass]
-
#pass ⇒ Integer (Default Value: 2)
Pass for fstab entry
Property Attributes- default ⇒ 2
20
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 20 property :pass, type: Integer, default: 2
-
#dump ⇒ Integer (Default Value: Proc.new { self.pass })
Dump setting for fstab entry
Property Attributes- default ⇒ Proc.new { self.pass }
22
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 22 property :dump, type: Integer, default: Proc.new { self.pass }
-
#options ⇒ Array of ⇒ String (Default Value: 'defaults')
Filesystem options for fstab
Property Attributes- default ⇒ 'defaults'
24
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 24 property :options, type: String, array: true, default: 'defaults'
-
#host ⇒ Hash of ⇒ MintPress::Infrastructure::Host
The hosts to which this mountpoint applies
Property Attributes26
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 26 property :host, type: MintPress::Infrastructure::Host, hash: true
-
#is_netdev ⇒ [TrueClass, FalseClass] (Default Value: false)
Is this at the other end of a network? Defaults to 'false', unless the class is iscsi in which case it defaults to 'true'
Property Attributes- default ⇒ false
29
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/mount.rb', line 29 property :is_netdev, type: [TrueClass, FalseClass], default: false
Properties (Read Only)
-
#implemented_providers ⇒ Array of ⇒ String
'List of infrastructure providers that this class can work with'
Property Attributes- read_only ⇒ true
93
# File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/block_storage.rb', line 93 property :implemented_providers, type: String, array: true, read_only: true, description: 'List of infrastructure providers that this class can work with'
Constant Summary
Constants included from MintLogger
MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN
Instance Attribute Summary
Attributes included from Mixins::Properties
#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root
Instance Method Summary collapse
-
#attach ⇒ Object
FIXME: refactor for proper shared volume support.
-
#attached? ⇒ Boolean
FIXME: refactor for proper shared volume support.
-
#create ⇒ Object
Method to create a Block Storage on OCI.
-
#destroy ⇒ Object
Delete the storage.
-
#detach ⇒ Object
Detach Storage from an Instance.
-
#exists? ⇒ Boolean
Method to search if the OCI Storage exists.
- #find_iqn ⇒ Object
- #find_iqn_ip_port ⇒ Object
- #find_storage_size ⇒ Object
- #find_volume_id ⇒ Object
-
#get_oci_device_node ⇒ Object
Method to get the device node also called device_path of the disk.
-
#initialize(opts = {}) ⇒ OCIStorage
constructor
A new instance of OCIStorage.
Methods included from Mixins::GenericProvider
included, #register_provider, #register_sub_provider
Methods included from MintLogger::Utils::Common
#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send
Methods included from Mixins::Properties
#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref
Methods inherited from MintPress::Infrastructure::ISCSIBlockDevice
Methods inherited from MintPress::Infrastructure::BlockDevice
#force_kill, #get_device_node, #prepare, #unprepare
Methods inherited from MintPress::Infrastructure::MountPoint
#mount, #mounted?, #unmount, #unpersist