opennebula-cli 6.2.1 → 6.2.2
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/bin/onehost +20 -2
- data/bin/onemarketapp +1 -1
- data/bin/onevcenter +140 -70
- data/bin/onevm +18 -8
- data/lib/cli_helper.rb +2 -1
- data/lib/one_helper/onevcenter_helper.rb +67 -4
- data/lib/one_helper/onezone_helper.rb +17 -1
- data/share/schemas/xsd/vm.xsd +0 -1
- data/share/schemas/xsd/vm_pool.xsd +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e2632af598a5b133b2a79d76411771bb13729b53cb61e13ca2fdc9a19d03537
|
4
|
+
data.tar.gz: 80e5897f9689d6d8c40f409b99df4432378693529cca5acae1fb5bc4aa28b45f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77b4013137e6fb74bff4aa984e33cbfe4cebdb8370e29be5bc8513446d6104c57e72a7d47cfde42ed9b4bbe514ed3387b14cc264939a7b7cc2ddf7324644b429
|
7
|
+
data.tar.gz: bf7615319dcc7119541276b06ab97ab904ad5dce0ebb93b1ffe2eca4111df24b13540051f3e66a133fbefae9d4a1ce971d9594a95c593d458f2b130ae109b86f
|
data/bin/onehost
CHANGED
@@ -109,6 +109,20 @@ CommandParser::CmdParser.new(ARGV) do
|
|
109
109
|
:format => String
|
110
110
|
}
|
111
111
|
|
112
|
+
IPV4 = {
|
113
|
+
:name => 'ipv4',
|
114
|
+
:large => '--ipv4 ip1,ip2',
|
115
|
+
:description => 'Comma separated IPV4 to set',
|
116
|
+
:format => Array
|
117
|
+
}
|
118
|
+
|
119
|
+
IPV6 = {
|
120
|
+
:name => 'ipv6',
|
121
|
+
:large => '--ipv6 ip1,ip2',
|
122
|
+
:description => 'Comma separated IPV6 to set',
|
123
|
+
:format => Array
|
124
|
+
}
|
125
|
+
|
112
126
|
CREAT_OPTIONS = [IM, VMM, OneClusterHelper::CLUSTER, TYPE]
|
113
127
|
SYNC_OPTIONS = [OneClusterHelper::CLUSTER, FORCE, SSH]
|
114
128
|
|
@@ -344,12 +358,16 @@ CommandParser::CmdParser.new(ARGV) do
|
|
344
358
|
Import VM to OpenNebula
|
345
359
|
EOT
|
346
360
|
|
347
|
-
command :importvm,
|
361
|
+
command :importvm,
|
362
|
+
importvm_desc,
|
363
|
+
:hostid,
|
364
|
+
:name,
|
365
|
+
:options => [IPV4, IPV6] do
|
348
366
|
helper.perform_action(args[0], options, 'imported') do |o|
|
349
367
|
rc = o.info
|
350
368
|
next rc if OpenNebula.is_error?(rc)
|
351
369
|
|
352
|
-
o.import_wild(args[1])
|
370
|
+
o.import_wild(args[1], options[:ipv4], options[:ipv6])
|
353
371
|
end
|
354
372
|
end
|
355
373
|
|
data/bin/onemarketapp
CHANGED
data/bin/onevcenter
CHANGED
@@ -66,17 +66,56 @@ CommandParser::CmdParser.new(ARGV) do
|
|
66
66
|
helper.set_client(options)
|
67
67
|
end
|
68
68
|
|
69
|
+
############################################################################
|
70
|
+
# Authentication Options
|
71
|
+
############################################################################
|
72
|
+
|
73
|
+
VCENTER = {
|
74
|
+
:name => 'vcenter',
|
75
|
+
:large => '--vcenter vCenter',
|
76
|
+
:description => 'The vCenter hostname',
|
77
|
+
:format => String
|
78
|
+
}
|
79
|
+
|
80
|
+
USER = {
|
81
|
+
:name => 'vuser',
|
82
|
+
:large => '--vuser username',
|
83
|
+
:description => 'The username to interact with vCenter',
|
84
|
+
:format => String
|
85
|
+
}
|
86
|
+
|
87
|
+
PASS = {
|
88
|
+
:name => 'vpass',
|
89
|
+
:large => '--vpass password',
|
90
|
+
:description => 'The password for the user',
|
91
|
+
:format => String
|
92
|
+
}
|
93
|
+
|
94
|
+
PORT = {
|
95
|
+
:name => 'port',
|
96
|
+
:short => '-p port',
|
97
|
+
:large => '--port port',
|
98
|
+
:format => String,
|
99
|
+
:description => 'vCenter API port, defaults to 443 (SSL) or 80'
|
100
|
+
}
|
101
|
+
|
102
|
+
AUTH_OPTS = [VCENTER, USER, PASS, PORT]
|
103
|
+
|
104
|
+
############################################################################
|
105
|
+
# List & Import
|
106
|
+
############################################################################
|
107
|
+
|
69
108
|
OBJECT = {
|
70
|
-
:name
|
109
|
+
:name => 'object',
|
71
110
|
:short => '-o object',
|
72
111
|
:large => '--object object ',
|
73
112
|
:format => String,
|
74
113
|
:description => 'vCenter object: [datastores, templates,'\
|
75
|
-
'networks, datastores, images]'
|
114
|
+
'networks, datastores, images, hosts]'
|
76
115
|
}
|
77
116
|
|
78
117
|
HOST = {
|
79
|
-
:name
|
118
|
+
:name => 'host',
|
80
119
|
:short => '-h host_id',
|
81
120
|
:large => '--host host_id',
|
82
121
|
:format => String,
|
@@ -84,7 +123,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
84
123
|
}
|
85
124
|
|
86
125
|
DATASTORE = {
|
87
|
-
:name
|
126
|
+
:name => 'datastore',
|
88
127
|
:short => '-d datastore_id',
|
89
128
|
:large => '--datastore datastore_id',
|
90
129
|
:format => String,
|
@@ -92,55 +131,63 @@ CommandParser::CmdParser.new(ARGV) do
|
|
92
131
|
}
|
93
132
|
|
94
133
|
CONFIG = {
|
95
|
-
:name
|
134
|
+
:name => 'configuration',
|
96
135
|
:large => '--config file',
|
97
136
|
:format => String,
|
98
137
|
:description => 'Configuration file for custom options'
|
99
138
|
}
|
100
139
|
|
101
|
-
|
102
|
-
:name
|
103
|
-
:large => '--
|
104
|
-
:
|
105
|
-
:
|
140
|
+
LINKED_CLONE = {
|
141
|
+
:name => 'linked_clone',
|
142
|
+
:large => '--linked_clone linked_clone',
|
143
|
+
:format => String,
|
144
|
+
:description => 'Import template as linked clone, 0/1'
|
106
145
|
}
|
107
146
|
|
108
|
-
|
109
|
-
:name
|
110
|
-
:large => '--
|
111
|
-
:
|
112
|
-
:
|
147
|
+
COPY = {
|
148
|
+
:name => 'copy',
|
149
|
+
:large => '--copy copy',
|
150
|
+
:format => String,
|
151
|
+
:description => 'Import template as copy, 0/1'
|
113
152
|
}
|
114
153
|
|
115
|
-
|
116
|
-
:name
|
117
|
-
:large => '--
|
118
|
-
:
|
119
|
-
:
|
154
|
+
NAME = {
|
155
|
+
:name => 'name',
|
156
|
+
:large => '--name name',
|
157
|
+
:format => String,
|
158
|
+
:description => 'Import template copy with name'
|
120
159
|
}
|
121
160
|
|
122
|
-
|
123
|
-
:name
|
124
|
-
:
|
125
|
-
:large => '--port port',
|
161
|
+
FOLDER = {
|
162
|
+
:name => 'folder',
|
163
|
+
:large => '--folder folder',
|
126
164
|
:format => String,
|
127
|
-
:description => '
|
165
|
+
:description => 'Import template in folder'
|
128
166
|
}
|
129
167
|
|
130
168
|
USE_DEFAULTS = {
|
131
|
-
:name
|
169
|
+
:name => 'defaults',
|
132
170
|
:large => '--use-defaults',
|
133
171
|
:description => 'Use defaults for answers to questions',
|
134
172
|
:format => String
|
135
173
|
}
|
136
174
|
|
137
175
|
ALL = {
|
138
|
-
:name
|
176
|
+
:name => 'all',
|
139
177
|
:large => '--all',
|
140
178
|
:description => 'Import all list',
|
141
179
|
:format => String
|
142
180
|
}
|
143
181
|
|
182
|
+
CLUSTER_REF = {
|
183
|
+
:name => 'cluster_ref',
|
184
|
+
:large => '--cluster-ref cluster_ref',
|
185
|
+
:format => String,
|
186
|
+
:description => 'Cluster ref to import'
|
187
|
+
}
|
188
|
+
|
189
|
+
LIST_OPTS = [OBJECT, HOST, DATASTORE, CLIHelper::CSV_OPT] + AUTH_OPTS
|
190
|
+
|
144
191
|
############################################################################
|
145
192
|
# Global Options
|
146
193
|
############################################################################
|
@@ -161,29 +208,26 @@ CommandParser::CmdParser.new(ARGV) do
|
|
161
208
|
- listing available images:
|
162
209
|
|
163
210
|
onevcenter list -o datastores -h <host_id> -d <ds-img_id>
|
211
|
+
|
212
|
+
- listing available clusters:
|
213
|
+
|
214
|
+
onevcenter list -o hosts --vcenter <IP> --vuser <U> --vpass <P>
|
164
215
|
EOT
|
165
216
|
|
166
|
-
command :list,
|
167
|
-
list_desc,
|
168
|
-
:options => [OBJECT, HOST, DATASTORE, VCENTER, USER, PASS,
|
169
|
-
CLIHelper::CSV_OPT] do
|
217
|
+
command :list, list_desc, :options => LIST_OPTS do
|
170
218
|
begin
|
171
219
|
args = helper.parse_opts(options)
|
172
|
-
args[:filter] = true
|
173
|
-
args[:short] = true
|
174
|
-
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
175
|
-
importer = VCenterDriver::VcImporter
|
176
|
-
.new_child(helper.client, vi_client, options[:object])
|
177
220
|
|
178
|
-
|
221
|
+
args[:filter] = true
|
222
|
+
args[:short] = true
|
179
223
|
|
180
|
-
helper.
|
224
|
+
helper.list(options, args)
|
181
225
|
rescue StandardError => e
|
182
226
|
STDERR.puts e.message
|
183
227
|
exit 1
|
184
228
|
end
|
185
229
|
|
186
|
-
|
230
|
+
0
|
187
231
|
end
|
188
232
|
|
189
233
|
list_desc = <<-EOT.unindent
|
@@ -193,29 +237,22 @@ CommandParser::CmdParser.new(ARGV) do
|
|
193
237
|
- listing networks including uplinks:
|
194
238
|
|
195
239
|
onevcenter list_all -o networks -h <host_id>
|
196
|
-
|
197
240
|
EOT
|
198
241
|
|
199
|
-
command :list_all,
|
200
|
-
list_desc,
|
201
|
-
:options => [OBJECT, HOST, DATASTORE, VCENTER, USER, PASS] do
|
242
|
+
command :list_all, list_desc, :options => LIST_OPTS do
|
202
243
|
begin
|
203
244
|
args = helper.parse_opts(options)
|
204
|
-
args[:filter] = false
|
205
|
-
args[:short] = true
|
206
|
-
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
207
|
-
importer = VCenterDriver::VcImporter
|
208
|
-
.new_child(helper.client, vi_client, options[:object])
|
209
245
|
|
210
|
-
|
246
|
+
args[:filter] = false
|
247
|
+
args[:short] = true
|
211
248
|
|
212
|
-
helper.
|
249
|
+
helper.list(options, args)
|
213
250
|
rescue StandardError => e
|
214
251
|
STDERR.puts e.message
|
215
252
|
exit 1
|
216
253
|
end
|
217
254
|
|
218
|
-
|
255
|
+
0
|
219
256
|
end
|
220
257
|
|
221
258
|
import_desc = <<-EOT.unindent
|
@@ -236,21 +273,22 @@ CommandParser::CmdParser.new(ARGV) do
|
|
236
273
|
EOT
|
237
274
|
|
238
275
|
command :import,
|
239
|
-
import_desc,
|
276
|
+
import_desc,
|
277
|
+
[:oid, nil],
|
240
278
|
:options => [OBJECT, HOST, DATASTORE] do
|
241
279
|
begin
|
242
280
|
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
243
|
-
importer
|
244
|
-
|
245
|
-
|
281
|
+
importer = VCenterDriver::VcImporter.new_child(helper.client,
|
282
|
+
vi_client,
|
283
|
+
options[:object])
|
246
284
|
|
247
285
|
importer.retrieve_resources(helper.parse_opts(options))
|
248
286
|
indexes = importer.get_indexes(args.first)
|
249
287
|
|
250
288
|
if indexes.nil?
|
251
289
|
raise "Could not get any unimported #{options[:object]}"\
|
252
|
-
|
253
|
-
|
290
|
+
" resources info in host: #{options[:host]} with"\
|
291
|
+
" this input: #{args.first}"
|
254
292
|
end
|
255
293
|
|
256
294
|
importer.process_import(indexes, options) do |object_info|
|
@@ -263,18 +301,25 @@ CommandParser::CmdParser.new(ARGV) do
|
|
263
301
|
exit 1
|
264
302
|
end
|
265
303
|
|
266
|
-
|
304
|
+
0
|
267
305
|
end
|
268
306
|
|
269
307
|
command :import_defaults,
|
270
308
|
import_desc,
|
271
309
|
[:oid, nil],
|
272
|
-
:options => [OBJECT,
|
310
|
+
:options => [OBJECT,
|
311
|
+
HOST,
|
312
|
+
DATASTORE,
|
313
|
+
CONFIG,
|
314
|
+
FOLDER,
|
315
|
+
LINKED_CLONE,
|
316
|
+
COPY,
|
317
|
+
NAME] do
|
273
318
|
begin
|
274
319
|
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
275
|
-
importer
|
276
|
-
|
277
|
-
|
320
|
+
importer = VCenterDriver::VcImporter.new_child(helper.client,
|
321
|
+
vi_client,
|
322
|
+
options[:object])
|
278
323
|
|
279
324
|
if options[:object] == 'networks' && !args.first.nil?
|
280
325
|
indexes = args.first
|
@@ -283,15 +328,36 @@ CommandParser::CmdParser.new(ARGV) do
|
|
283
328
|
indexes = importer.get_indexes(args.first)
|
284
329
|
end
|
285
330
|
|
286
|
-
|
331
|
+
if options[:object] == 'templates' &&
|
332
|
+
indexes &&
|
333
|
+
indexes.split(',').length == 1
|
334
|
+
opts = {
|
335
|
+
:type => 'default',
|
336
|
+
:linked_clone => '0',
|
337
|
+
:copy => '0',
|
338
|
+
:name => '',
|
339
|
+
:folder => ''
|
340
|
+
}
|
341
|
+
|
342
|
+
if options[:linked_clone]
|
343
|
+
opts[:linked_clone] = options[:linked_clone]
|
344
|
+
end
|
345
|
+
|
346
|
+
opts[:copy] = options[:copy] if options[:copy]
|
347
|
+
opts[:name] = options[:name] if options[:name]
|
348
|
+
opts[:folder] = options[:folder] if options[:folder]
|
349
|
+
|
350
|
+
options[indexes] = opts
|
351
|
+
end
|
287
352
|
|
353
|
+
importer.process_import(indexes, options)
|
288
354
|
importer.stdout
|
289
355
|
rescue StandardError => e
|
290
356
|
STDERR.puts e.message
|
291
357
|
exit 1
|
292
358
|
end
|
293
359
|
|
294
|
-
|
360
|
+
0
|
295
361
|
end
|
296
362
|
|
297
363
|
############################################################################
|
@@ -303,11 +369,12 @@ CommandParser::CmdParser.new(ARGV) do
|
|
303
369
|
Example:
|
304
370
|
- Get available clusters:
|
305
371
|
|
306
|
-
onevcenter hosts --vcenter <vcenter> --vuser <
|
372
|
+
onevcenter hosts --vcenter <vcenter> --vuser <user> --vpass <pass>
|
307
373
|
EOT
|
374
|
+
|
308
375
|
command :hosts,
|
309
376
|
host_desc,
|
310
|
-
:options => [
|
377
|
+
:options => [CLUSTER_REF, USE_DEFAULTS] + AUTH_OPTS do
|
311
378
|
con_ops = helper.connection_options('Hosts', options)
|
312
379
|
|
313
380
|
begin
|
@@ -316,7 +383,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
316
383
|
exit 1
|
317
384
|
end
|
318
385
|
|
319
|
-
|
386
|
+
0
|
320
387
|
end
|
321
388
|
|
322
389
|
############################################################################
|
@@ -331,8 +398,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
331
398
|
|
332
399
|
onevcenter cleargs 15
|
333
400
|
EOT
|
401
|
+
|
334
402
|
command :cleartags, cleartags_desc, :vmid do
|
335
|
-
vmid
|
403
|
+
vmid = args[0]
|
336
404
|
remove_str = "\n onevm recover --delete-db #{vmid}" \
|
337
405
|
"\n\nAfter a monitoring cycle, the VM will appear "\
|
338
406
|
'as a Wild VM for reimport.'
|
@@ -349,8 +417,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
349
417
|
puts remove_str
|
350
418
|
exit 0
|
351
419
|
end
|
352
|
-
puts '.'
|
353
420
|
|
421
|
+
puts '.'
|
354
422
|
puts 'The following keys will be removed:'
|
355
423
|
keys.each {|key| puts "\t- #{key}" }
|
356
424
|
|
@@ -359,8 +427,10 @@ CommandParser::CmdParser.new(ARGV) do
|
|
359
427
|
STDERR.puts "Couldn't clear VM tags. Reason: #{e.message}"
|
360
428
|
exit 1
|
361
429
|
end
|
430
|
+
|
362
431
|
puts "\nKeys removed from VM. Is safe to remove it"
|
363
432
|
puts remove_str
|
364
|
-
|
433
|
+
|
434
|
+
0
|
365
435
|
end
|
366
436
|
end
|
data/bin/onevm
CHANGED
@@ -239,6 +239,10 @@ CommandParser::CmdParser.new(ARGV) do
|
|
239
239
|
:description => 'SSH options to use'
|
240
240
|
}
|
241
241
|
|
242
|
+
OpenNebulaHelper::TEMPLATE_OPTIONS_VM.delete_if do |v|
|
243
|
+
%w[as_gid as_uid].include?(v[:name])
|
244
|
+
end
|
245
|
+
|
242
246
|
########################################################################
|
243
247
|
# Global Options
|
244
248
|
########################################################################
|
@@ -1394,16 +1398,22 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1394
1398
|
acc_t = 0
|
1395
1399
|
acc_w = 0
|
1396
1400
|
|
1397
|
-
|
1398
|
-
|
1401
|
+
helper.perform_action(args[0], {}, 'Charter added') do |vm|
|
1402
|
+
vm.info
|
1403
|
+
|
1404
|
+
diff_stime = Time.now.to_i - vm['/VM/STIME'].to_i
|
1399
1405
|
|
1400
|
-
|
1401
|
-
|
1402
|
-
action.to_s,
|
1403
|
-
time[:warning][:time] + acc_w)
|
1406
|
+
charters.each do |action, time|
|
1407
|
+
sched = "+#{time[:time].to_i + acc_t + diff_stime}"
|
1404
1408
|
|
1405
|
-
|
1406
|
-
|
1409
|
+
helper.schedule_actions([args[0]].flatten,
|
1410
|
+
{ :schedule => sched },
|
1411
|
+
action.to_s,
|
1412
|
+
time[:warning][:time] + acc_w)
|
1413
|
+
|
1414
|
+
acc_t += time[:time].to_i
|
1415
|
+
acc_w += time[:warning][:time].to_i
|
1416
|
+
end
|
1407
1417
|
end
|
1408
1418
|
|
1409
1419
|
0
|
data/lib/cli_helper.rb
CHANGED
@@ -61,7 +61,8 @@ module CLIHelper
|
|
61
61
|
' ' * 31 << 'column=value pairs.' <<
|
62
62
|
' ' * 31 << "Valid operators #{FILTER_OPS.join(',')}" <<
|
63
63
|
' ' * 31 << 'e.g. NAME=test (match name with test)' <<
|
64
|
-
' ' * 31 << 'NAME~test (match
|
64
|
+
' ' * 31 << 'NAME~test (match every NAME containing' <<
|
65
|
+
' ' * 31 << 'the substring \'test\')'
|
65
66
|
}
|
66
67
|
|
67
68
|
OPERATOR = {
|
@@ -27,9 +27,10 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
27
27
|
module VOBJECT
|
28
28
|
|
29
29
|
DATASTORE = 1
|
30
|
-
TEMPLATE
|
31
|
-
NETWORK
|
32
|
-
IMAGE
|
30
|
+
TEMPLATE = 2
|
31
|
+
NETWORK = 3
|
32
|
+
IMAGE = 4
|
33
|
+
HOST = 5
|
33
34
|
|
34
35
|
end
|
35
36
|
|
@@ -85,6 +86,12 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
85
86
|
:columns => { :IMID => 5, :REF => 35, :PATH => 60 },
|
86
87
|
:cli => [:host, :datastore],
|
87
88
|
:dialogue => ->(arg) {}
|
89
|
+
},
|
90
|
+
VOBJECT::HOST => {
|
91
|
+
:struct => %w[HOST_LIST HOST],
|
92
|
+
:columns => { :DATACENTER => 10, :NAME => 30, :REF => 35 },
|
93
|
+
:cli => [],
|
94
|
+
:dialogue => ->(arg) {}
|
88
95
|
}
|
89
96
|
}
|
90
97
|
|
@@ -143,6 +150,8 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
143
150
|
@vobject = VOBJECT::NETWORK
|
144
151
|
when 'images'
|
145
152
|
@vobject = VOBJECT::IMAGE
|
153
|
+
when 'hosts'
|
154
|
+
@vobject = VOBJECT::HOST
|
146
155
|
else
|
147
156
|
puts "unknown #{type} type option"
|
148
157
|
puts ' -o options:'
|
@@ -150,6 +159,7 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
150
159
|
puts ' templates'
|
151
160
|
puts ' networks'
|
152
161
|
puts ' images'
|
162
|
+
puts ' hosts'
|
153
163
|
|
154
164
|
exit 0
|
155
165
|
end
|
@@ -186,6 +196,28 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
186
196
|
}
|
187
197
|
end
|
188
198
|
|
199
|
+
# General method to list vCenter objects
|
200
|
+
#
|
201
|
+
# @param options [Hash] User CLI options
|
202
|
+
# @param args [Hash] Search arguments
|
203
|
+
def list(options, args)
|
204
|
+
if !options[:host]
|
205
|
+
# This case is to list available hosts, instead other object
|
206
|
+
list_hosts(options)
|
207
|
+
else
|
208
|
+
vi_client = VCenterDriver::VIClient.new_from_host(
|
209
|
+
options[:host]
|
210
|
+
)
|
211
|
+
importer = VCenterDriver::VcImporter.new_child(
|
212
|
+
@client,
|
213
|
+
vi_client,
|
214
|
+
options[:object]
|
215
|
+
)
|
216
|
+
|
217
|
+
list_object(options, importer.retrieve_resources(args))
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
189
221
|
# This method will print a list for a vcenter_resource.
|
190
222
|
#
|
191
223
|
def list_object(options, list)
|
@@ -198,6 +230,31 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
198
230
|
table.show(list, options)
|
199
231
|
end
|
200
232
|
|
233
|
+
# List unimported hosts
|
234
|
+
#
|
235
|
+
# @param options [Hash] User CLI options
|
236
|
+
def list_hosts(options)
|
237
|
+
con_ops = connection_options('hosts', options)
|
238
|
+
vi_client = VCenterDriver::VIClient.new(con_ops)
|
239
|
+
dc_folder = VCenterDriver::DatacenterFolder.new(vi_client)
|
240
|
+
hpool = VCenterDriver::VIHelper.one_pool(OpenNebula::HostPool,
|
241
|
+
false)
|
242
|
+
|
243
|
+
VCenterDriver::VIHelper.set_client(nil, @client)
|
244
|
+
|
245
|
+
list = []
|
246
|
+
hosts = dc_folder.get_unimported_hosts(hpool, vi_client.vim.host)
|
247
|
+
|
248
|
+
hosts.each do |key, value|
|
249
|
+
value.each do |v|
|
250
|
+
v[:datacenter] = key
|
251
|
+
list << v
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
format_list.show(hosts, options)
|
256
|
+
end
|
257
|
+
|
201
258
|
# handles :cli section of TABLE
|
202
259
|
# used for executing the dialogue in some VOBJECTS
|
203
260
|
#
|
@@ -252,12 +309,18 @@ class OneVcenterHelper < OpenNebulaHelper::OneHelper
|
|
252
309
|
def format_list
|
253
310
|
config = TABLE[@vobject][:columns]
|
254
311
|
CLIHelper::ShowTable.new do
|
312
|
+
column :DATACENTER,
|
313
|
+
'Object datacenter',
|
314
|
+
:size => config[:DATACENTER] || 15 do |d|
|
315
|
+
d[:datacenter]
|
316
|
+
end
|
317
|
+
|
255
318
|
column :IMID, 'identifier for ...', :size=>config[:IMID] || 4 do |d|
|
256
319
|
d[:import_id]
|
257
320
|
end
|
258
321
|
|
259
322
|
column :REF, 'ref', :left, :adjust, :size=>config[:REF] || 15 do |d|
|
260
|
-
d[:ref]
|
323
|
+
d[:ref] || d[:cluster_ref]
|
261
324
|
end
|
262
325
|
|
263
326
|
column :NAME, 'Name', :left, :expand,
|
@@ -577,7 +577,23 @@ class OneZoneHelper < OpenNebulaHelper::OneHelper
|
|
577
577
|
puts "Endpoint changed to \"#{zone['TEMPLATE/ENDPOINT']}\" in " <<
|
578
578
|
"#{ENV['HOME']}/.one/one_endpoint"
|
579
579
|
end
|
580
|
-
|
580
|
+
|
581
|
+
return 0 unless zone['TEMPLATE/ONEFLOW_ENDPOINT']
|
582
|
+
|
583
|
+
# Set ONEFLOW_ENDPOINT
|
584
|
+
if temporary_zone
|
585
|
+
puts "Type: export ONEFLOW_URL=#{zone['TEMPLATE/ONEFLOW_ENDPOINT']}"
|
586
|
+
else
|
587
|
+
File.open(ENV['HOME'] + '/.one/oneflow_endpoint', 'w') do |f|
|
588
|
+
f.puts zone['TEMPLATE/ONEFLOW_ENDPOINT']
|
589
|
+
end
|
590
|
+
|
591
|
+
puts 'OneFlow Endpoint changed to ' \
|
592
|
+
"\"#{zone['TEMPLATE/ONEFLOW_ENDPOINT']}\" in " <<
|
593
|
+
"#{ENV['HOME']}/.one/oneflow_endpoint"
|
594
|
+
end
|
595
|
+
|
596
|
+
0
|
581
597
|
end
|
582
598
|
|
583
599
|
private
|
data/share/schemas/xsd/vm.xsd
CHANGED
@@ -121,7 +121,6 @@
|
|
121
121
|
<xs:element name="MEMORY" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
122
122
|
<xs:element name="MEMORY_COST" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
123
123
|
<xs:element name="MEMORY_MAX" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
124
|
-
<xs:element name="MEMORY_SLOTS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
125
124
|
<xs:element name="NIC" minOccurs="0" maxOccurs="unbounded">
|
126
125
|
<xs:complexType>
|
127
126
|
<xs:sequence>
|
@@ -75,6 +75,8 @@
|
|
75
75
|
<xs:element name="HID" type="xs:integer"/>
|
76
76
|
<xs:element name="CID" type="xs:integer"/>
|
77
77
|
<xs:element name="DS_ID" type="xs:integer"/>
|
78
|
+
<xs:element name="VM_MAD" type="xs:string"/>
|
79
|
+
<xs:element name="TM_MAD" type="xs:string"/>
|
78
80
|
<xs:element name="ACTION" type="xs:integer"/>
|
79
81
|
</xs:sequence>
|
80
82
|
</xs:complexType>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opennebula
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.2.
|
19
|
+
version: 6.2.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.2.
|
26
|
+
version: 6.2.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|