shu-san-scripts 0.1.0 → 0.1.1
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.
- data/README.rdoc +54 -0
- metadata +33 -46
- data/.document +0 -5
- data/.rvmrc +0 -27
- data/Gemfile +0 -40
- data/Gemfile.lock +0 -35
- data/HISTORY +0 -41
- data/Rakefile +0 -45
- data/VERSION +0 -1
- data/bin/store +0 -50
- data/lib/SANStore.rb +0 -24
- data/lib/SANStore/cli.rb +0 -29
- data/lib/SANStore/cli/base.rb +0 -102
- data/lib/SANStore/cli/commands.rb +0 -30
- data/lib/SANStore/cli/commands/help.rb +0 -106
- data/lib/SANStore/cli/commands/list_vols.rb +0 -87
- data/lib/SANStore/cli/commands/new_vol.rb +0 -119
- data/lib/SANStore/cli/logger.rb +0 -88
- data/lib/SANStore/cri.rb +0 -12
- data/lib/SANStore/cri/base.rb +0 -153
- data/lib/SANStore/cri/command.rb +0 -104
- data/lib/SANStore/cri/core_ext.rb +0 -8
- data/lib/SANStore/cri/core_ext/string.rb +0 -41
- data/lib/SANStore/cri/option_parser.rb +0 -186
- data/lib/SANStore/helpers/uuid.rb +0 -35
- data/lib/SANStore/iSCSI/comstar.rb +0 -45
- data/lib/SANStore/zfs/zfs.rb +0 -36
- data/shu-san-scripts.gemspec +0 -94
- data/test/helper.rb +0 -18
- data/test/test_shu-san-scripts.rb +0 -7
data/README.rdoc
CHANGED
@@ -38,6 +38,60 @@ should get you started.
|
|
38
38
|
assume the host they are running on is somewhat disposable. Your needs
|
39
39
|
may differ...
|
40
40
|
|
41
|
+
== Synopsis
|
42
|
+
|
43
|
+
General help can be obtained by running +store --help+, or +store+ with no
|
44
|
+
arguments
|
45
|
+
|
46
|
+
A command-line tool for managing iSCSI targets on OpenSolaris.
|
47
|
+
|
48
|
+
Available commands:
|
49
|
+
|
50
|
+
help Show help for a command
|
51
|
+
new_vol Create a new iSCSI volume in the SAN volume store.
|
52
|
+
|
53
|
+
Global options:
|
54
|
+
|
55
|
+
-h --help show this help message and quit
|
56
|
+
-C --no-color disable color
|
57
|
+
-V --verbose make store command output more detailed
|
58
|
+
-v --version show version information and quit
|
59
|
+
|
60
|
+
Help on individual commands can then be obtained using the command as an
|
61
|
+
argument to +store help+. For instance
|
62
|
+
|
63
|
+
# store help new_vol
|
64
|
+
|
65
|
+
produces
|
66
|
+
|
67
|
+
store new_volume [--volume-store ZFS_PATH][--name GUID] [--size INTEGER]
|
68
|
+
|
69
|
+
aliases: new add add_vol
|
70
|
+
|
71
|
+
Create a new iSCSI volume in the SAN volume store.
|
72
|
+
|
73
|
+
By default, this command creates a 20G ZFS volume, and marks it for sharing
|
74
|
+
as an iSCSI target on the local network.
|
75
|
+
|
76
|
+
Warning: By default this commands sets up the iSCSI target with NO security.
|
77
|
+
This is fine for testing and use in the labs, but obviously is not ideal if
|
78
|
+
you care about the data stored on this new volume...
|
79
|
+
|
80
|
+
options:
|
81
|
+
|
82
|
+
-n --name the name of the new volume. This must be a valid ZFS volume name, and
|
83
|
+
defaults to an RFC 4122 GUID.
|
84
|
+
|
85
|
+
-s --size the size of the new iSCSI volume. Note that while ZFS allows you to change
|
86
|
+
the size of the new volume relatively easily, because the iSCSI initiator
|
87
|
+
sees this volume as a raw device changing the size later may be very easy or
|
88
|
+
very difficult depending on the initiators operating system (and the specific
|
89
|
+
file system being used). In other words, choose with care: by default this
|
90
|
+
command uses a size of 20G, which should be enough for most tasks in the
|
91
|
+
labs.
|
92
|
+
|
93
|
+
-v --volume_store specifify the ZFS root of the new iSCSI volume. Defaults to "store/volumes".
|
94
|
+
|
41
95
|
== Contributing to the SHU SAN Scripts
|
42
96
|
|
43
97
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Love
|
@@ -65,8 +65,23 @@ dependencies:
|
|
65
65
|
name: uuidtools
|
66
66
|
prerelease: false
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
type: :
|
68
|
+
type: :runtime
|
69
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 11
|
75
|
+
segments:
|
76
|
+
- 1
|
77
|
+
- 2
|
78
|
+
version: "1.2"
|
79
|
+
version_requirements: *id004
|
80
|
+
name: ansi
|
81
|
+
prerelease: false
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
type: :development
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
70
85
|
none: false
|
71
86
|
requirements:
|
72
87
|
- - ~>
|
@@ -77,12 +92,12 @@ dependencies:
|
|
77
92
|
- 0
|
78
93
|
- 0
|
79
94
|
version: 1.0.0
|
80
|
-
version_requirements: *
|
95
|
+
version_requirements: *id005
|
81
96
|
name: bundler
|
82
97
|
prerelease: false
|
83
98
|
- !ruby/object:Gem::Dependency
|
84
99
|
type: :development
|
85
|
-
requirement: &
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
86
101
|
none: false
|
87
102
|
requirements:
|
88
103
|
- - ~>
|
@@ -93,12 +108,12 @@ dependencies:
|
|
93
108
|
- 6
|
94
109
|
- 0
|
95
110
|
version: 1.6.0
|
96
|
-
version_requirements: *
|
111
|
+
version_requirements: *id006
|
97
112
|
name: jeweler
|
98
113
|
prerelease: false
|
99
114
|
- !ruby/object:Gem::Dependency
|
100
115
|
type: :development
|
101
|
-
requirement: &
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
102
117
|
none: false
|
103
118
|
requirements:
|
104
119
|
- - ~>
|
@@ -109,12 +124,12 @@ dependencies:
|
|
109
124
|
- 6
|
110
125
|
- 0
|
111
126
|
version: 0.6.0
|
112
|
-
version_requirements: *
|
127
|
+
version_requirements: *id007
|
113
128
|
name: yard
|
114
129
|
prerelease: false
|
115
130
|
- !ruby/object:Gem::Dependency
|
116
131
|
type: :development
|
117
|
-
requirement: &
|
132
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
118
133
|
none: false
|
119
134
|
requirements:
|
120
135
|
- - ~>
|
@@ -125,12 +140,12 @@ dependencies:
|
|
125
140
|
- 8
|
126
141
|
- 1
|
127
142
|
version: 1.8.1
|
128
|
-
version_requirements: *
|
143
|
+
version_requirements: *id008
|
129
144
|
name: vclog
|
130
145
|
prerelease: false
|
131
146
|
- !ruby/object:Gem::Dependency
|
132
147
|
type: :development
|
133
|
-
requirement: &
|
148
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
134
149
|
none: false
|
135
150
|
requirements:
|
136
151
|
- - ">="
|
@@ -139,12 +154,12 @@ dependencies:
|
|
139
154
|
segments:
|
140
155
|
- 0
|
141
156
|
version: "0"
|
142
|
-
version_requirements: *
|
157
|
+
version_requirements: *id009
|
143
158
|
name: minitest
|
144
159
|
prerelease: false
|
145
160
|
- !ruby/object:Gem::Dependency
|
146
161
|
type: :development
|
147
|
-
requirement: &
|
162
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
148
163
|
none: false
|
149
164
|
requirements:
|
150
165
|
- - ">="
|
@@ -153,49 +168,21 @@ dependencies:
|
|
153
168
|
segments:
|
154
169
|
- 0
|
155
170
|
version: "0"
|
156
|
-
version_requirements: *
|
171
|
+
version_requirements: *id010
|
157
172
|
name: riot
|
158
173
|
prerelease: false
|
159
174
|
description: See the README file.
|
160
175
|
email: david@homeunix.org.uk
|
161
|
-
executables:
|
162
|
-
|
176
|
+
executables: []
|
177
|
+
|
163
178
|
extensions: []
|
164
179
|
|
165
180
|
extra_rdoc_files:
|
166
181
|
- LICENSE.txt
|
167
182
|
- README.rdoc
|
168
183
|
files:
|
169
|
-
- .document
|
170
|
-
- .rvmrc
|
171
|
-
- Gemfile
|
172
|
-
- Gemfile.lock
|
173
|
-
- HISTORY
|
174
184
|
- LICENSE.txt
|
175
185
|
- README.rdoc
|
176
|
-
- Rakefile
|
177
|
-
- VERSION
|
178
|
-
- bin/store
|
179
|
-
- lib/SANStore.rb
|
180
|
-
- lib/SANStore/cli.rb
|
181
|
-
- lib/SANStore/cli/base.rb
|
182
|
-
- lib/SANStore/cli/commands.rb
|
183
|
-
- lib/SANStore/cli/commands/help.rb
|
184
|
-
- lib/SANStore/cli/commands/list_vols.rb
|
185
|
-
- lib/SANStore/cli/commands/new_vol.rb
|
186
|
-
- lib/SANStore/cli/logger.rb
|
187
|
-
- lib/SANStore/cri.rb
|
188
|
-
- lib/SANStore/cri/base.rb
|
189
|
-
- lib/SANStore/cri/command.rb
|
190
|
-
- lib/SANStore/cri/core_ext.rb
|
191
|
-
- lib/SANStore/cri/core_ext/string.rb
|
192
|
-
- lib/SANStore/cri/option_parser.rb
|
193
|
-
- lib/SANStore/helpers/uuid.rb
|
194
|
-
- lib/SANStore/iSCSI/comstar.rb
|
195
|
-
- lib/SANStore/zfs/zfs.rb
|
196
|
-
- shu-san-scripts.gemspec
|
197
|
-
- test/helper.rb
|
198
|
-
- test/test_shu-san-scripts.rb
|
199
186
|
homepage: http://github.com/dlove24/shu-san-scripts
|
200
187
|
licenses:
|
201
188
|
- ISC
|
@@ -225,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
212
|
requirements: []
|
226
213
|
|
227
214
|
rubyforge_project:
|
228
|
-
rubygems_version: 1.8.
|
215
|
+
rubygems_version: 1.8.10
|
229
216
|
signing_key:
|
230
217
|
specification_version: 3
|
231
218
|
summary: Scripts used to set-up and manage iSCSI targets on OpenSolaris (ZFS) systems.
|
data/.document
DELETED
data/.rvmrc
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
ruby_string="ruby-1.8.7-p352"
|
2
|
-
gemset_name="san-scripts"
|
3
|
-
|
4
|
-
if rvm list strings | grep -q "${ruby_string}" ; then
|
5
|
-
|
6
|
-
# Load or create the specified environment
|
7
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
8
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
|
9
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
|
10
|
-
else
|
11
|
-
rvm --create "${ruby_string}@${gemset_name}"
|
12
|
-
fi
|
13
|
-
|
14
|
-
# Ensure that Bundler is installed, install it if it is not.
|
15
|
-
if ! command -v bundle ; then
|
16
|
-
gem install bundler
|
17
|
-
fi
|
18
|
-
|
19
|
-
# Bundle while reducing excess noise.
|
20
|
-
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
|
21
|
-
|
22
|
-
else
|
23
|
-
|
24
|
-
# Notify the user to install the desired interpreter before proceeding.
|
25
|
-
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
|
26
|
-
|
27
|
-
fi
|
data/Gemfile
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### Sources
|
3
|
-
###
|
4
|
-
|
5
|
-
# Main Ruby Gems site
|
6
|
-
source "http://rubygems.org"
|
7
|
-
|
8
|
-
###
|
9
|
-
### Core Gems. These are required in _all_ environments (additional environments
|
10
|
-
### follow).
|
11
|
-
###
|
12
|
-
|
13
|
-
# Command Line Interface Library
|
14
|
-
gem "cri", "~> 2.0.2"
|
15
|
-
|
16
|
-
# Library extensions
|
17
|
-
gem "facets", ">= 2.4"
|
18
|
-
|
19
|
-
# GUID library
|
20
|
-
gem "uuidtools", "~> 2.1.2"
|
21
|
-
|
22
|
-
###
|
23
|
-
### Development Gems. All _additional_ gems required by development (as opposed to
|
24
|
-
### production environments). If it is required at run-time, it
|
25
|
-
### belongs above.
|
26
|
-
group :development do
|
27
|
-
|
28
|
-
# Gem management tools
|
29
|
-
gem "bundler", "~> 1.0.0"
|
30
|
-
gem "jeweler", "~> 1.6.0"
|
31
|
-
|
32
|
-
# Documentation Tools
|
33
|
-
gem "yard", "~> 0.6.0"
|
34
|
-
gem "vclog", "~> 1.8.1"
|
35
|
-
|
36
|
-
# Testing Tools
|
37
|
-
gem "minitest", ">= 0"
|
38
|
-
gem "riot"
|
39
|
-
|
40
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
ansi (1.3.0)
|
5
|
-
cri (2.0.2)
|
6
|
-
facets (2.9.2)
|
7
|
-
git (1.2.5)
|
8
|
-
jeweler (1.6.4)
|
9
|
-
bundler (~> 1.0)
|
10
|
-
git (>= 1.2.5)
|
11
|
-
rake
|
12
|
-
minitest (2.6.0)
|
13
|
-
rake (0.9.2)
|
14
|
-
riot (0.12.5)
|
15
|
-
rr
|
16
|
-
rr (1.0.4)
|
17
|
-
uuidtools (2.1.2)
|
18
|
-
vclog (1.8.1)
|
19
|
-
ansi (>= 1.2)
|
20
|
-
facets (>= 2.4)
|
21
|
-
yard (0.6.8)
|
22
|
-
|
23
|
-
PLATFORMS
|
24
|
-
ruby
|
25
|
-
|
26
|
-
DEPENDENCIES
|
27
|
-
bundler (~> 1.0.0)
|
28
|
-
cri (~> 2.0.2)
|
29
|
-
facets (>= 2.4)
|
30
|
-
jeweler (~> 1.6.0)
|
31
|
-
minitest
|
32
|
-
riot
|
33
|
-
uuidtools (~> 2.1.2)
|
34
|
-
vclog (~> 1.8.1)
|
35
|
-
yard (~> 0.6.0)
|
data/HISTORY
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
RELEASE HISTORY
|
2
|
-
|
3
|
-
v0.0.2 / 2011-09-23
|
4
|
-
|
5
|
-
Regenerate gemspec for version 0.0.2 (David Love david@homeunix.org.uk)
|
6
|
-
|
7
|
-
Changes:
|
8
|
-
|
9
|
-
* 3 General Enhancements
|
10
|
-
|
11
|
-
* Version bump to 0.0.1
|
12
|
-
* Version bump to 0.0.0
|
13
|
-
* Initial commit to shu-san-scripts.
|
14
|
-
|
15
|
-
* 1 Patch Enhancements
|
16
|
-
|
17
|
-
* Version bump to 0.0.2. Added infrastructure needed for minimally working version
|
18
|
-
|
19
|
-
|
20
|
-
HEAD / 2011-09-25
|
21
|
-
|
22
|
-
Current Development (David Love)
|
23
|
-
|
24
|
-
Changes:
|
25
|
-
|
26
|
-
* 3 General Enhancements
|
27
|
-
|
28
|
-
* Version bump to 0.0.3
|
29
|
-
* Regenerate gemspec for version 0.0.2
|
30
|
-
* Regenerate gemspec for version 0.0.2
|
31
|
-
|
32
|
-
* 1 Bug Fixes
|
33
|
-
|
34
|
-
* Format options as well as the text description
|
35
|
-
|
36
|
-
* 3 Patch Enhancements
|
37
|
-
|
38
|
-
* Add ability to generate the correct ZFS commands. Don't actually act on them yet
|
39
|
-
* Added support for sequential UUID's
|
40
|
-
* Require the Facets library in the main gem as well
|
41
|
-
|
data/Rakefile
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "shu-san-scripts"
|
18
|
-
gem.homepage = "http://github.com/dlove24/shu-san-scripts"
|
19
|
-
gem.license = "ISC"
|
20
|
-
gem.summary = %Q{Scripts used to set-up and manage iSCSI targets on OpenSolaris (ZFS) systems.}
|
21
|
-
gem.description = %Q{See the README file.}
|
22
|
-
gem.email = "david@homeunix.org.uk"
|
23
|
-
gem.authors = ["David Love"]
|
24
|
-
# dependencies defined in Gemfile
|
25
|
-
end
|
26
|
-
Jeweler::RubygemsDotOrgTasks.new
|
27
|
-
|
28
|
-
require 'rake/testtask'
|
29
|
-
Rake::TestTask.new(:test) do |test|
|
30
|
-
test.libs << 'lib' << 'test'
|
31
|
-
test.pattern = 'test/**/test_*.rb'
|
32
|
-
test.verbose = true
|
33
|
-
end
|
34
|
-
|
35
|
-
task :default => :test
|
36
|
-
|
37
|
-
require 'rake/rdoctask'
|
38
|
-
Rake::RDocTask.new do |rdoc|
|
39
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
40
|
-
|
41
|
-
rdoc.rdoc_dir = 'rdoc'
|
42
|
-
rdoc.title = "shu-san-scripts #{version}"
|
43
|
-
rdoc.rdoc_files.include('README*')
|
44
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
45
|
-
end
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.0
|
data/bin/store
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
### Copyright (c) 2011 David Love <david@homeunix.org.uk>
|
4
|
-
###
|
5
|
-
### Permission to use, copy, modify, and/or distribute this software for
|
6
|
-
### any purpose with or without fee is hereby granted, provided that the
|
7
|
-
### above copyright notice and this permission notice appear in all copies.
|
8
|
-
###
|
9
|
-
### THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
-
### WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
-
### MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
-
### ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
-
### WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
-
### ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
-
### OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
-
###
|
17
|
-
|
18
|
-
### @author David Love
|
19
|
-
###
|
20
|
-
### Boot straping Command. Used to initalize various aspects of the Mercury
|
21
|
-
### environment.
|
22
|
-
###
|
23
|
-
### @note The sub-commands provided by the bootstrap command assume (at-least)
|
24
|
-
### a minimally working Ruby environment, with the required gems installed. Various
|
25
|
-
### 'First Boot' scripts are available in the `scripts` directory for different
|
26
|
-
### platforms which will achieve at least this minimal state
|
27
|
-
###
|
28
|
-
|
29
|
-
# Add lib to load path
|
30
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
|
31
|
-
|
32
|
-
# Load the rubygems library
|
33
|
-
require 'rubygems'
|
34
|
-
|
35
|
-
# Load core application library
|
36
|
-
require 'SANStore'
|
37
|
-
|
38
|
-
# Load command line handler
|
39
|
-
require 'SANStore/cri'
|
40
|
-
require 'SANStore/cli'
|
41
|
-
|
42
|
-
# Load the commands from the cmds dir
|
43
|
-
plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../cmds')
|
44
|
-
|
45
|
-
Dir[plugin_dir + '/*.rb'].sort.each{|file|
|
46
|
-
require file
|
47
|
-
}
|
48
|
-
|
49
|
-
# Run base
|
50
|
-
SANStore::CLI::Base.new.run(ARGV)
|