opennebula-cli 4.14.2 → 4.90.0.beta1
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.
- checksums.yaml +4 -4
- data/NOTICE +1 -1
- data/bin/oneacct +1 -1
- data/bin/oneacl +1 -1
- data/bin/onecluster +4 -1
- data/bin/onedatastore +4 -1
- data/bin/oneflow +26 -1
- data/bin/oneflow-template +57 -1
- data/bin/onegroup +4 -1
- data/bin/onehost +24 -15
- data/bin/oneimage +5 -3
- data/bin/onemarket +178 -0
- data/bin/onemarketapp +282 -0
- data/bin/onesecgroup +18 -1
- data/bin/oneshowback +1 -1
- data/bin/onetemplate +30 -21
- data/bin/oneuser +12 -6
- data/bin/oneuser.backup +522 -0
- data/bin/onevcenter +287 -1
- data/bin/onevdc +4 -1
- data/bin/onevm +78 -56
- data/bin/onevnet +10 -4
- data/bin/onevrouter +305 -0
- data/bin/onezone +4 -1
- data/lib/cli_helper.rb +1 -1
- data/lib/command_parser.rb +1 -1
- data/lib/one_helper/oneacct_helper.rb +1 -1
- data/lib/one_helper/oneacl_helper.rb +11 -5
- data/lib/one_helper/onecluster_helper.rb +1 -1
- data/lib/one_helper/onedatastore_helper.rb +17 -7
- data/lib/one_helper/onegroup_helper.rb +1 -1
- data/lib/one_helper/onehost_helper.rb +2 -5
- data/lib/one_helper/oneimage_helper.rb +1 -15
- data/lib/one_helper/onemarket_helper.rb +152 -0
- data/lib/one_helper/onemarketapp_helper.rb +223 -0
- data/lib/one_helper/onequota_helper.rb +1 -1
- data/lib/one_helper/onesecgroup_helper.rb +46 -3
- data/lib/one_helper/onetemplate_helper.rb +146 -11
- data/lib/one_helper/oneuser_helper.rb +1 -1
- data/lib/one_helper/onevdc_helper.rb +1 -1
- data/lib/one_helper/onevm_helper.rb +37 -53
- data/lib/one_helper/onevnet_helper.rb +23 -11
- data/lib/one_helper/onevrouter_helper.rb +221 -0
- data/lib/one_helper/onezone_helper.rb +1 -1
- data/lib/one_helper.rb +193 -25
- metadata +21 -10
data/bin/onevrouter
ADDED
@@ -0,0 +1,305 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# -------------------------------------------------------------------------- #
|
4
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
5
|
+
# #
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
|
+
# not use this file except in compliance with the License. You may obtain #
|
8
|
+
# a copy of the License at #
|
9
|
+
# #
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
11
|
+
# #
|
12
|
+
# Unless required by applicable law or agreed to in writing, software #
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
15
|
+
# See the License for the specific language governing permissions and #
|
16
|
+
# limitations under the License. #
|
17
|
+
#--------------------------------------------------------------------------- #
|
18
|
+
|
19
|
+
ONE_LOCATION=ENV["ONE_LOCATION"]
|
20
|
+
|
21
|
+
if !ONE_LOCATION
|
22
|
+
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
|
23
|
+
else
|
24
|
+
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
|
25
|
+
end
|
26
|
+
|
27
|
+
$: << RUBY_LIB_LOCATION
|
28
|
+
$: << RUBY_LIB_LOCATION+"/cli"
|
29
|
+
|
30
|
+
require 'command_parser'
|
31
|
+
require 'one_helper/onevrouter_helper'
|
32
|
+
require 'one_helper/onetemplate_helper'
|
33
|
+
require 'one_helper/onevm_helper'
|
34
|
+
|
35
|
+
cmd=CommandParser::CmdParser.new(ARGV) do
|
36
|
+
usage "`onevrouter` <command> [<args>] [<options>]"
|
37
|
+
version OpenNebulaHelper::ONE_VERSION
|
38
|
+
|
39
|
+
helper = OneVirtualRouterHelper.new
|
40
|
+
|
41
|
+
before_proc do
|
42
|
+
helper.set_client(options)
|
43
|
+
end
|
44
|
+
|
45
|
+
########################################################################
|
46
|
+
# Global Options
|
47
|
+
########################################################################
|
48
|
+
set :option, CommandParser::OPTIONS+OpenNebulaHelper::CLIENT_OPTIONS
|
49
|
+
|
50
|
+
list_options = CLIHelper::OPTIONS
|
51
|
+
list_options << OpenNebulaHelper::XML
|
52
|
+
list_options << OpenNebulaHelper::NUMERIC
|
53
|
+
list_options << OpenNebulaHelper::DESCRIBE
|
54
|
+
|
55
|
+
########################################################################
|
56
|
+
# Formatters for arguments
|
57
|
+
########################################################################
|
58
|
+
set :format, :groupid, OpenNebulaHelper.rname_to_id_desc("GROUP") do |arg|
|
59
|
+
OpenNebulaHelper.rname_to_id(arg, "GROUP")
|
60
|
+
end
|
61
|
+
|
62
|
+
set :format, :userid, OpenNebulaHelper.rname_to_id_desc("USER") do |arg|
|
63
|
+
OpenNebulaHelper.rname_to_id(arg, "USER")
|
64
|
+
end
|
65
|
+
|
66
|
+
set :format, :vrouterid, OneVirtualRouterHelper.to_id_desc do |arg|
|
67
|
+
helper.to_id(arg)
|
68
|
+
end
|
69
|
+
|
70
|
+
set :format, :vrouterid_list, OneVirtualRouterHelper.list_to_id_desc do |arg|
|
71
|
+
helper.list_to_id(arg)
|
72
|
+
end
|
73
|
+
|
74
|
+
set :format, :filterflag, OneVirtualRouterHelper.filterflag_to_i_desc do |arg|
|
75
|
+
helper.filterflag_to_i(arg)
|
76
|
+
end
|
77
|
+
|
78
|
+
set :format, :templateid, OpenNebulaHelper.rname_to_id_desc("VMTEMPLATE") do |arg|
|
79
|
+
OpenNebulaHelper.rname_to_id(arg, "VMTEMPLATE")
|
80
|
+
end
|
81
|
+
|
82
|
+
########################################################################
|
83
|
+
# Commands
|
84
|
+
########################################################################
|
85
|
+
|
86
|
+
create_desc = <<-EOT.unindent
|
87
|
+
Creates a new Virtual Router from the given description
|
88
|
+
EOT
|
89
|
+
|
90
|
+
command :create, create_desc, :file do
|
91
|
+
helper.create_resource(options) do |obj|
|
92
|
+
begin
|
93
|
+
template = File.read(args[0])
|
94
|
+
|
95
|
+
obj.allocate(template)
|
96
|
+
rescue => e
|
97
|
+
STDERR.puts e.messsage
|
98
|
+
exit -1
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
instantiate_desc = <<-EOT.unindent
|
104
|
+
Creates a new VM instance from the given Template. This VM can be
|
105
|
+
managed with the 'onevm' command.
|
106
|
+
|
107
|
+
The NIC elements defined in the Virtual Router will be used. The
|
108
|
+
source Template can be modified adding or replacing attributes with
|
109
|
+
the optional file argument, or with the options.
|
110
|
+
EOT
|
111
|
+
|
112
|
+
instantiate_options = [
|
113
|
+
OneTemplateHelper::VM_NAME,
|
114
|
+
OneTemplateHelper::MULTIPLE,
|
115
|
+
OneVMHelper::HOLD
|
116
|
+
]
|
117
|
+
|
118
|
+
command :instantiate, instantiate_desc, :vrouterid, :templateid, [:file, nil],
|
119
|
+
:options=>instantiate_options+OpenNebulaHelper::TEMPLATE_OPTIONS do
|
120
|
+
exit_code=0
|
121
|
+
|
122
|
+
if args[1] && OpenNebulaHelper.create_template_options_used?(options)
|
123
|
+
STDERR.puts "You cannot use both template file and template"<<
|
124
|
+
" creation options."
|
125
|
+
next -1
|
126
|
+
end
|
127
|
+
|
128
|
+
number = options[:multiple] || 1
|
129
|
+
user_inputs = nil
|
130
|
+
|
131
|
+
helper.perform_action(args[0], options, "instantiated") do |vr|
|
132
|
+
name = options[:name] || ""
|
133
|
+
|
134
|
+
t = OpenNebula::Template.new_with_id(args[1], helper.client)
|
135
|
+
|
136
|
+
on_hold = options[:hold] != nil
|
137
|
+
|
138
|
+
extra_template = ""
|
139
|
+
rc = t.info
|
140
|
+
|
141
|
+
if OpenNebula.is_error?(rc)
|
142
|
+
STDERR.puts rc.message
|
143
|
+
exit(-1)
|
144
|
+
end
|
145
|
+
|
146
|
+
if args[2]
|
147
|
+
extra_template = File.read(args[2])
|
148
|
+
else
|
149
|
+
res = OpenNebulaHelper.create_template(options, t)
|
150
|
+
|
151
|
+
if res.first != 0
|
152
|
+
STDERR.puts res.last
|
153
|
+
next -1
|
154
|
+
end
|
155
|
+
|
156
|
+
extra_template = res.last
|
157
|
+
end
|
158
|
+
|
159
|
+
user_inputs = OneTemplateHelper.get_user_inputs(t.to_hash) unless user_inputs
|
160
|
+
|
161
|
+
extra_template << "\n" << user_inputs
|
162
|
+
|
163
|
+
vr.instantiate(number, args[1], name, on_hold, extra_template)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
delete_desc = <<-EOT.unindent
|
168
|
+
Deletes the given Virtual Router
|
169
|
+
EOT
|
170
|
+
|
171
|
+
command :delete, delete_desc, [:range, :vrouterid_list] do
|
172
|
+
helper.perform_actions(args[0],options,"deleted") do |obj|
|
173
|
+
obj.delete
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
chgrp_desc = <<-EOT.unindent
|
178
|
+
Changes the Virtual Router group
|
179
|
+
EOT
|
180
|
+
|
181
|
+
command :chgrp, chgrp_desc,[:range, :vrouterid_list], :groupid do
|
182
|
+
helper.perform_actions(args[0],options,"Group changed") do |obj|
|
183
|
+
obj.chown(-1, args[1].to_i)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
chown_desc = <<-EOT.unindent
|
188
|
+
Changes the Virtual Router owner and group
|
189
|
+
EOT
|
190
|
+
|
191
|
+
command :chown, chown_desc, [:range, :vrouterid_list], :userid,
|
192
|
+
[:groupid,nil] do
|
193
|
+
gid = args[2].nil? ? -1 : args[2].to_i
|
194
|
+
helper.perform_actions(args[0],options,"Owner/Group changed") do |obj|
|
195
|
+
obj.chown(args[1].to_i, gid)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
chmod_desc = <<-EOT.unindent
|
200
|
+
Changes the Virtual Router permissions
|
201
|
+
EOT
|
202
|
+
|
203
|
+
command :chmod, chmod_desc, [:range, :vrouterid_list], :octet do
|
204
|
+
helper.perform_actions(args[0],options, "Permissions changed") do |obj|
|
205
|
+
obj.chmod_octet(args[1])
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
update_desc = <<-EOT.unindent
|
210
|
+
Update the Virtual Router contents. If a path is not provided the editor
|
211
|
+
will be launched to modify the current content.
|
212
|
+
EOT
|
213
|
+
|
214
|
+
command :update, update_desc, :vrouterid, [:file, nil],
|
215
|
+
:options=>OpenNebulaHelper::APPEND do
|
216
|
+
helper.perform_action(args[0],options,"modified") do |obj|
|
217
|
+
if options[:append]
|
218
|
+
str = OpenNebulaHelper.append_template(args[0], obj, args[1])
|
219
|
+
else
|
220
|
+
str = OpenNebulaHelper.update_template(args[0], obj, args[1])
|
221
|
+
end
|
222
|
+
|
223
|
+
obj.update(str, options[:append])
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
rename_desc = <<-EOT.unindent
|
228
|
+
Renames the Virtual Router
|
229
|
+
EOT
|
230
|
+
|
231
|
+
command :rename, rename_desc, :vrouterid, :name do
|
232
|
+
helper.perform_action(args[0],options,"renamed") do |obj|
|
233
|
+
obj.rename(args[1])
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
nic_attach_desc = <<-EOT.unindent
|
238
|
+
Attaches a NIC to a VirtualRouter, and each one of its VMs. When using
|
239
|
+
--file add only one NIC instance.
|
240
|
+
EOT
|
241
|
+
|
242
|
+
command :"nic-attach", nic_attach_desc, :vrouterid,
|
243
|
+
:options => [OneVMHelper::FILE, OneVMHelper::NETWORK, OneVMHelper::IP] do
|
244
|
+
|
245
|
+
if options[:file].nil? and options[:network].nil?
|
246
|
+
STDERR.puts "Provide a template file or a network:"
|
247
|
+
STDERR.puts "\t--file <file>"
|
248
|
+
STDERR.puts "\t--network <network>"
|
249
|
+
exit -1
|
250
|
+
end
|
251
|
+
|
252
|
+
if options[:file]
|
253
|
+
template = File.read(options[:file])
|
254
|
+
else
|
255
|
+
network_id = options[:network]
|
256
|
+
ip = options[:ip]
|
257
|
+
if ip
|
258
|
+
template = "NIC = [ NETWORK_ID = #{network_id}, IP = #{ip} ]"
|
259
|
+
else
|
260
|
+
template = "NIC = [ NETWORK_ID = #{network_id} ]"
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
helper.perform_action(args[0],options,"Attach NIC") do |vr|
|
265
|
+
vr.nic_attach(template)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
nic_detach_desc = <<-EOT.unindent
|
270
|
+
Detaches a NIC from a VirtualRouter, and each one of its VMs
|
271
|
+
EOT
|
272
|
+
|
273
|
+
command :"nic-detach", nic_detach_desc, :vrouterid, :nicid do
|
274
|
+
nicid = args[1].to_i
|
275
|
+
|
276
|
+
helper.perform_action(args[0],options,"Detach NIC") do |vr|
|
277
|
+
vr.nic_detach(nicid)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
list_desc = <<-EOT.unindent
|
282
|
+
Lists the Virtual Routers in the pool
|
283
|
+
EOT
|
284
|
+
|
285
|
+
command :list, list_desc, [:filterflag, nil], :options=>list_options do
|
286
|
+
helper.list_pool(options, false, args[0])
|
287
|
+
end
|
288
|
+
|
289
|
+
show_desc = <<-EOT.unindent
|
290
|
+
Shows information for the given Virtual Router
|
291
|
+
EOT
|
292
|
+
|
293
|
+
command :show, show_desc, :vrouterid,
|
294
|
+
:options=>[OpenNebulaHelper::XML, OneVMHelper::ALL_TEMPLATE] do
|
295
|
+
helper.show_resource(args[0],options)
|
296
|
+
end
|
297
|
+
|
298
|
+
top_desc = <<-EOT.unindent
|
299
|
+
Lists Virtual Routers continuously
|
300
|
+
EOT
|
301
|
+
|
302
|
+
command :top, top_desc, [:filterflag, nil], :options=>list_options do
|
303
|
+
helper.list_pool(options, true, args[0])
|
304
|
+
end
|
305
|
+
end
|
data/bin/onezone
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -105,6 +105,9 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
105
105
|
str = OpenNebulaHelper.update_template(args[0], obj, args[1])
|
106
106
|
end
|
107
107
|
|
108
|
+
helper.set_client(options)
|
109
|
+
obj = helper.retrieve_resource(obj.id)
|
110
|
+
|
108
111
|
obj.update(str, options[:append])
|
109
112
|
end
|
110
113
|
end
|
data/lib/cli_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/command_parser.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -44,7 +44,7 @@ private
|
|
44
44
|
def self.resource_mask(str)
|
45
45
|
resource_type=str.split("/")[0]
|
46
46
|
|
47
|
-
mask = "
|
47
|
+
mask = "----------------"
|
48
48
|
|
49
49
|
resource_type.split("+").each{|type|
|
50
50
|
case type
|
@@ -74,6 +74,12 @@ private
|
|
74
74
|
mask[11] = "S"
|
75
75
|
when "VDC"
|
76
76
|
mask[12] = "v"
|
77
|
+
when "VROUTER"
|
78
|
+
mask[13] = "R"
|
79
|
+
when "MARKETPLACE"
|
80
|
+
mask[14] = "M"
|
81
|
+
when "MARKETPLACEAPP"
|
82
|
+
mask[15] = "A"
|
77
83
|
end
|
78
84
|
}
|
79
85
|
mask
|
@@ -113,8 +119,8 @@ private
|
|
113
119
|
d['STRING'].split(" ")[0]
|
114
120
|
end
|
115
121
|
|
116
|
-
column :
|
117
|
-
:size =>
|
122
|
+
column :RES_VHNIUTGDCOZSvRMA, "Resource to which the rule applies",
|
123
|
+
:size => 20 do |d|
|
118
124
|
OneAclHelper::resource_mask d['STRING'].split(" ")[1]
|
119
125
|
end
|
120
126
|
|
@@ -131,7 +137,7 @@ private
|
|
131
137
|
OneAclHelper::right_mask d['STRING'].split(" ")[2]
|
132
138
|
end
|
133
139
|
|
134
|
-
default :ID, :USER, :
|
140
|
+
default :ID, :USER, :RES_VHNIUTGDCOZSvRMA, :RID, :OPE_UMAC, :ZONE
|
135
141
|
end
|
136
142
|
|
137
143
|
table
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -44,6 +44,16 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
|
44
44
|
d["ID"]
|
45
45
|
end
|
46
46
|
|
47
|
+
column :USER, "Username of the Datastore owner", :left,
|
48
|
+
:size=>10 do |d|
|
49
|
+
helper.user_name(d, options)
|
50
|
+
end
|
51
|
+
|
52
|
+
column :GROUP, "Group of the Datastore", :left,
|
53
|
+
:size=>10 do |d|
|
54
|
+
helper.group_name(d, options)
|
55
|
+
end
|
56
|
+
|
47
57
|
column :NAME, "Name of the Datastore", :left, :size=>13 do |d|
|
48
58
|
d["NAME"]
|
49
59
|
end
|
@@ -65,15 +75,15 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
|
65
75
|
end
|
66
76
|
end
|
67
77
|
|
68
|
-
column :
|
69
|
-
OpenNebulaHelper.
|
78
|
+
column :CLUSTERS, "Cluster IDs", :left, :size=>12 do |d|
|
79
|
+
OpenNebulaHelper.clusters_str(d["CLUSTERS"]["ID"])
|
70
80
|
end
|
71
81
|
|
72
82
|
column :IMAGES, "Number of Images", :size=>6 do |d|
|
73
83
|
if d["IMAGES"]["ID"].nil?
|
74
84
|
"0"
|
75
85
|
else
|
76
|
-
d["IMAGES"]["ID"].size
|
86
|
+
[d["IMAGES"]["ID"]].flatten.size
|
77
87
|
end
|
78
88
|
end
|
79
89
|
|
@@ -95,7 +105,7 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
|
95
105
|
Datastore::SHORT_DATASTORE_STATES[state]
|
96
106
|
end
|
97
107
|
|
98
|
-
default :ID, :NAME, :SIZE, :AVAIL, :
|
108
|
+
default :ID, :USER, :GROUP, :NAME, :SIZE, :AVAIL, :CLUSTERS, :IMAGES,
|
99
109
|
:TYPE, :DS, :TM, :STAT
|
100
110
|
end
|
101
111
|
|
@@ -114,7 +124,6 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
|
114
124
|
end
|
115
125
|
|
116
126
|
def factory_pool(user_flag=-2)
|
117
|
-
#TBD OpenNebula::UserPool.new(@client, user_flag)
|
118
127
|
OpenNebula::DatastorePool.new(@client)
|
119
128
|
end
|
120
129
|
|
@@ -127,7 +136,8 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
|
127
136
|
puts str % ["NAME", datastore.name]
|
128
137
|
puts str % ["USER", datastore['UNAME']]
|
129
138
|
puts str % ["GROUP", datastore['GNAME']]
|
130
|
-
puts str % ["
|
139
|
+
puts str % ["CLUSTERS",
|
140
|
+
OpenNebulaHelper.clusters_str(datastore.retrieve_elements("CLUSTERS/ID"))]
|
131
141
|
|
132
142
|
puts str % ["TYPE", datastore.type_str]
|
133
143
|
puts str % ["DS_MAD", datastore['DS_MAD']]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -378,7 +378,6 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
|
378
378
|
puts str % ["STATE", host.state_str]
|
379
379
|
puts str % ["IM_MAD", host['IM_MAD']]
|
380
380
|
puts str % ["VM_MAD", host['VM_MAD']]
|
381
|
-
puts str % ["VN_MAD", host['VN_MAD']]
|
382
381
|
puts str % ["LAST MONITORING TIME", OpenNebulaHelper.time_to_str(host['LAST_MON_TIME'])]
|
383
382
|
puts
|
384
383
|
|
@@ -440,9 +439,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
|
440
439
|
wilds.each do |wild|
|
441
440
|
if wild['IMPORT_TEMPLATE']
|
442
441
|
wild_tmplt = Base64::decode64(wild['IMPORT_TEMPLATE']).split("\n")
|
443
|
-
name =
|
444
|
-
line[/^NAME/]
|
445
|
-
}[0].split("=")[1].gsub("\"", " ").strip
|
442
|
+
name = wild['VM_NAME']
|
446
443
|
import = wild_tmplt.select { |line|
|
447
444
|
line[/^IMPORT_VM_ID/]
|
448
445
|
}[0].split("=")[1].gsub("\"", " ").strip
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -146,20 +146,6 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
},
|
149
|
-
{
|
150
|
-
:name => "fstype",
|
151
|
-
:large => "--fstype fstype",
|
152
|
-
:description => "Type of file system to be built. This can be \n"<<
|
153
|
-
" "*31<<"any value understood by mkfs unix command.",
|
154
|
-
:format => String,
|
155
|
-
:proc => lambda do |o, options|
|
156
|
-
if !options[:type] || !(options[:type].upcase=='DATABLOCK')
|
157
|
-
[-1, "FSTYPE is only used for DATABLOCK type images"]
|
158
|
-
else
|
159
|
-
[0, o]
|
160
|
-
end
|
161
|
-
end
|
162
|
-
},
|
163
149
|
OpenNebulaHelper::DRY
|
164
150
|
]
|
165
151
|
|