shu-san-scripts 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/SANStore/iSCSI/comstar.rb +9 -1
  2. metadata +4 -4
@@ -38,10 +38,14 @@ class COMStar
38
38
  # relevant volume later
39
39
  SANStore::CLI::Logger.instance.log_level(:low, :update, "Storing the volume GUID as the logical unit alias")
40
40
  modify_lu = %x[stmfadm modify-lu --lu-prop alias=#{volume_guid} #{id}]
41
+
42
+ # Create a new target group
43
+ SANStore::CLI::Logger.instance.log_level(:low, :create, "Creating target group #{id}")
44
+ %x[stmfadm create-tg #{id}]
41
45
 
42
46
  # Link the new disk target to the iSCSI framework
43
47
  SANStore::CLI::Logger.instance.log_level(:low, :update, "Attaching logical unit #{id} into the iSCSI framework")
44
- vol_frame = %x[stmfadm add-view #{id}]
48
+ vol_frame = %x[stmfadm add-view --target-group #{id} #{id}]
45
49
 
46
50
  # Create the target...
47
51
  SANStore::CLI::Logger.instance.log_level(:low, :create, "iSCSI block target")
@@ -51,6 +55,10 @@ class COMStar
51
55
  # Store the volume GUID as the alias so we can find it later
52
56
  SANStore::CLI::Logger.instance.log_level(:low, :update, "Storing the volume GUID as the iSCSI target alias")
53
57
  %x[itadm modify-target --alias #{volume_guid} #{target_name}]
58
+
59
+ # Add the new target to the correct target group
60
+ SANStore::CLI::Logger.instance.log_level(:low, :update, "Adding the target #{target_name} to its target group")
61
+ %x[svcadm disable stmf; sleep 2; stmfadm add-tg-member -g #{id} #{target_name}; svcadm enable stmf]
54
62
 
55
63
  # Return the target name to the caller
56
64
  return target_name
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shu-san-scripts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
8
  - 3
10
- version: 0.2.3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Love
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-29 00:00:00 Z
18
+ date: 2011-11-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime