Class: Dcmgr::Drivers::IscsiTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/dcmgr/drivers/iscsi_target.rb

Direct Known Subclasses

Comstar, LinuxIscsi, SunIscsi

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



6
7
8
# File 'lib/dcmgr/drivers/iscsi_target.rb', line 6

def node
  @node
end

Class Method Details

.select_iscsi_target(iscsi_target, node) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/dcmgr/drivers/iscsi_target.rb', line 23

def self.select_iscsi_target(iscsi_target, node)
  raise ArgumentError unless node.is_a?(Isono::Node)
  case iscsi_target
  when "linux_iscsi"
    bs = Dcmgr::Drivers::LinuxIscsi.new
  when "sun_iscsi"
    bs = Dcmgr::Drivers::SunIscsi.new
  when "comstar"
    bs = Dcmgr::Drivers::Comstar.new
  else
    raise "Unknown iscsi_target type: #{iscsi_target}"
  end
  # for bs.node readable accessor.
  bs.instance_variable_set(:@node, node)
  bs
end

Instance Method Details

#create(ctx) ⇒ Object

Raises:

  • (NotImplmenetedError)


8
9
10
# File 'lib/dcmgr/drivers/iscsi_target.rb', line 8

def create(ctx)
  raise NotImplmenetedError
end

#delete(ctx) ⇒ Object

Raises:

  • (NotImplmenetedError)


12
13
14
# File 'lib/dcmgr/drivers/iscsi_target.rb', line 12

def delete(ctx)
  raise NotImplmenetedError
end

#register(volume) ⇒ Object

Register target information to the target device.

Parameters:

  • volume (Hash)

    hash data



18
19
20
21
# File 'lib/dcmgr/drivers/iscsi_target.rb', line 18

def register(volume)
  # TODO: uncomment here once all drivers were updated.
  #raise NotImplmenetedError
end