opennebula-cli 7.2.1 → 7.3.80.pre

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d3c61d8bb2de013784883b2ec6e6a39fb5ca302cf6bc117bb0f0399b2e4b1f5
4
- data.tar.gz: 2da75d6d5be0cc53362846e8ff723cfd323fe4f27d5604ed9be70b32eaaf85bc
3
+ metadata.gz: ddabe36ca91b760ad2cc9c641d585f9fc9591567267620b59db910f0a865e2ce
4
+ data.tar.gz: 212ffde1d9910ce5daf0f60884f4d8e9721dc57d2368fb705dd51534d6493b0b
5
5
  SHA512:
6
- metadata.gz: 0b0779b82ef031d48c624709593f562daba5c813ca69c0ad8ac1aab61f72afe7c7f79d78c07ffa0eaf65bd7c4f7f570c3515fb2dbe934307bff0c2e781558508
7
- data.tar.gz: 0d524fd9e4bc6c0f8f7bc11fb4552048017d8087d885943c5efb7e942d3f920aec44321e523ba78ec9c97f41df477fec1ee1c2c23e36f4ac8670750f93624776
6
+ metadata.gz: cb603d35ae289e02fc13bf767ce336d40a82252b896963c37f90669d2b95392e4e7b4feff3d23fd0a3ae6ba46ab4302f0d26149eff4d4c4df85f0295eba4d29f
7
+ data.tar.gz: ae5a2a2ca0d6eb53b69b2619dd2b0c01706e873d38bdaee7e24d346168e637912616bbfd64cd92ecf46712bf0e5d3bf7e155d89f64c345b1a20ee5fba9171c6c
data/bin/oneflow CHANGED
@@ -35,6 +35,7 @@ $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
35
35
 
36
36
  require 'json'
37
37
  require 'tempfile'
38
+ require 'uri'
38
39
 
39
40
  require 'command_parser'
40
41
  require 'opennebula/oneflow_client'
@@ -60,6 +61,10 @@ def check_document_type(response)
60
61
  end
61
62
  end
62
63
 
64
+ def path_escape(path_segment)
65
+ URI::DEFAULT_PARSER.escape(path_segment, /[^A-Za-z0-9\-._~]/)
66
+ end
67
+
63
68
  CommandParser::CmdParser.new(ARGV) do
64
69
  usage '`oneflow` <command> [<args>] [<options>]'
65
70
  version OpenNebulaHelper::ONE_VERSION
@@ -112,6 +117,14 @@ CommandParser::CmdParser.new(ARGV) do
112
117
  Service.list_to_id(arg, 'SERVICE')
113
118
  end
114
119
 
120
+ set :format, :sched_id, 'Scheduled action ID' do |arg|
121
+ if arg.match?(/\A\d+\z/)
122
+ [0, arg]
123
+ else
124
+ [-1, 'Scheduled action ID must be an integer number']
125
+ end
126
+ end
127
+
115
128
  set :format,
116
129
  :vm_action,
117
130
  'Actions supported: #{Role::SCHEDULE_ACTIONS.join(', ')}' do |arg|
@@ -338,8 +351,9 @@ CommandParser::CmdParser.new(ARGV) do
338
351
 
339
352
  json = Service.build_json_action(args[2], params)
340
353
  client = helper.client(options)
354
+ role = path_escape(args[1])
341
355
 
342
- client.post("#{RESOURCE_PATH}/#{service_id}/role/#{args[1]}/action",
356
+ client.post("#{RESOURCE_PATH}/#{service_id}/role/#{role}/action",
343
357
  json)
344
358
  end
345
359
  end
@@ -371,6 +385,43 @@ CommandParser::CmdParser.new(ARGV) do
371
385
 
372
386
  ###
373
387
 
388
+ sched_delete_desc = <<-EOT.unindent
389
+ Delete a scheduled action from all the Virtual Machines of a given role.
390
+ EOT
391
+
392
+ command :'sched-delete',
393
+ sched_delete_desc,
394
+ :service_id,
395
+ :role_name,
396
+ :sched_id do
397
+ Service.perform_action(args[0]) do |service_id|
398
+ role = path_escape(args[1])
399
+
400
+ helper.client(options).delete(
401
+ "#{RESOURCE_PATH}/#{service_id}/role/#{role}/sched_action/#{args[2]}"
402
+ )
403
+ end
404
+ end
405
+
406
+ ###
407
+
408
+ sched_delete_desc = <<-EOT.unindent
409
+ Delete a scheduled action from all the Virtual Machines of a given service.
410
+ EOT
411
+
412
+ command [:service, :'sched-delete'],
413
+ sched_delete_desc,
414
+ :service_id,
415
+ :sched_id do
416
+ Service.perform_action(args[0]) do |service_id|
417
+ helper.client(options).delete(
418
+ "#{RESOURCE_PATH}/#{service_id}/sched_action/#{args[1]}"
419
+ )
420
+ end
421
+ end
422
+
423
+ ###
424
+
374
425
  update_desc = <<-EOT.unindent
375
426
  Update the template contents. If a path is not provided the editor will
376
427
  be launched to modify the current content.
data/bin/onegroup CHANGED
@@ -260,4 +260,37 @@ CommandParser::CmdParser.new(ARGV) do
260
260
 
261
261
  exit 0
262
262
  end
263
+
264
+ vlan_desc = <<-EOT.unindent
265
+ Set the VLAN rules for the group. If a path is not provided the
266
+ editor will be launched to modify the current rules.
267
+ EOT
268
+
269
+ command :vlan, vlan_desc, :groupid, [:file, nil] do
270
+ helper.perform_action(args[0], options, 'modified') do |group|
271
+ rc = group.info
272
+
273
+ if OpenNebula.is_error?(rc)
274
+ puts rc.message
275
+ exit(-1)
276
+ end
277
+
278
+ if args[1]
279
+ str = File.read(args[1])
280
+ else
281
+ group.delete_element('VLAN_RULES/ID')
282
+
283
+ current_rules = group.template_like_str('VLAN_RULES')
284
+
285
+ str = OpenNebulaHelper.editor_input(current_rules)
286
+ end
287
+
288
+ rc = group.set_vlan_rules(str)
289
+
290
+ if OpenNebula.is_error?(rc)
291
+ puts rc.message
292
+ exit(-1)
293
+ end
294
+ end
295
+ end
263
296
  end
data/bin/oneimage CHANGED
@@ -255,7 +255,7 @@ CommandParser::CmdParser.new(ARGV) do
255
255
  if !OpenNebula.is_error?(res)
256
256
  puts "ID: #{res}"
257
257
  else
258
- puts res.message
258
+ STDERR.puts res.message
259
259
  exit(-1)
260
260
  end
261
261
  end
@@ -543,8 +543,13 @@ CommandParser::CmdParser.new(ARGV) do
543
543
  EOT
544
544
 
545
545
  command :orphans, show_desc do
546
- puts helper.check_orphans
546
+ orphans = helper.check_orphans
547
+ if OpenNebula.is_error?(orphans)
548
+ STDERR.puts orphans.message
549
+ return -1
550
+ end
547
551
 
552
+ puts orphans
548
553
  return 0
549
554
  end
550
555
  end
data/bin/onesecgroup CHANGED
@@ -122,7 +122,8 @@ CommandParser::CmdParser.new(ARGV) do
122
122
  if !OpenNebula.is_error?(res)
123
123
  puts "ID: #{res}"
124
124
  else
125
- puts res.message
125
+ STDERR.puts res.message
126
+ exit(-1)
126
127
  end
127
128
  end
128
129
  end
data/bin/onevm CHANGED
@@ -345,6 +345,10 @@ CommandParser::CmdParser.new(ARGV) do
345
345
  format_int(arg)
346
346
  end
347
347
 
348
+ set :format, :vmgroupid, OpenNebulaHelper.rname_to_id_desc('VMGROUP') do |arg|
349
+ OpenNebulaHelper.rname_to_id(arg, 'VMGROUP')
350
+ end
351
+
348
352
  ########################################################################
349
353
  # Commands
350
354
  ########################################################################
@@ -1410,7 +1414,6 @@ CommandParser::CmdParser.new(ARGV) do
1410
1414
  EOT
1411
1415
 
1412
1416
  command :backupmode, backupmode_set_desc, :vmid, :mode do
1413
- vm_ref = args[0]
1414
1417
  backup_mode = args[1]
1415
1418
 
1416
1419
  if !helper.backup_mode_valid?(backup_mode)
@@ -1421,8 +1424,9 @@ CommandParser::CmdParser.new(ARGV) do
1421
1424
  exit(-1)
1422
1425
  end
1423
1426
 
1424
- # TODO: Ensure other BACKUP_CONFIG is not overwritten
1425
- helper.set_backup_mode(vm_ref, backup_mode)
1427
+ helper.perform_action(args[0], options, 'Updating backup mode') do |vm|
1428
+ vm.updateconf("BACKUP_CONFIG = [\"MODE\"=\"#{backup_mode}\"]", true)
1429
+ end
1426
1430
  end
1427
1431
 
1428
1432
  updateconf_desc = <<-EOT.unindent
@@ -1443,7 +1447,7 @@ CommandParser::CmdParser.new(ARGV) do
1443
1447
  VIDEO = ["TYPE", "IOMMU", "ATS", "VRAM", "RESOLUTION"]
1444
1448
  RAW = ["DATA", "DATA_VMX", "TYPE", "VALIDATE"]
1445
1449
  CPU_MODEL = ["MODEL", "FEATURES"]
1446
- BACKUP_CONFIG = ["FS_FREEZE", "KEEP_LAST", "BACKUP_VOLATILE", "MODE", "INCREMENT_MODE"]
1450
+ BACKUP_CONFIG = ["FS_FREEZE", "KEEP_LAST", "BACKUP_VOLATILE", "MODE", "INCREMENT_MODE", "INTERACTIVE"]
1447
1451
  CONTEXT (any value, ETH* if CONTEXT_ALLOW_ETH_UPDATES set in oned.conf, **variable substitution will be made**)
1448
1452
  EOT
1449
1453
 
@@ -1902,8 +1906,23 @@ CommandParser::CmdParser.new(ARGV) do
1902
1906
  end
1903
1907
  end
1904
1908
 
1905
- # Deprecated commands, remove these commands in release 8.x
1909
+ vmgroup_add_desc = <<-EOT.unindent
1910
+ Adds the VM to a VM group and role.
1911
+ EOT
1906
1912
 
1907
- deprecated_command(:'delete-chart', 'sched-delete')
1908
- deprecated_command(:'update-chart', 'sched-update')
1913
+ command :"vmgroup-add", vmgroup_add_desc, :vmid, :vmgroupid, :role do
1914
+ helper.perform_action(args[0], options, 'VM added to group') do |vm|
1915
+ vm.vmgroup_add(args[1].to_i, args[2])
1916
+ end
1917
+ end
1918
+
1919
+ vmgroup_del_desc = <<-EOT.unindent
1920
+ Removes the VM from its VM group.
1921
+ EOT
1922
+
1923
+ command :"vmgroup-del", vmgroup_del_desc, :vmid do
1924
+ helper.perform_action(args[0], options, 'VM removed from group') do |vm|
1925
+ vm.vmgroup_del
1926
+ end
1927
+ end
1909
1928
  end
data/bin/onevnet CHANGED
@@ -197,16 +197,6 @@ CommandParser::CmdParser.new(ARGV) do
197
197
  end
198
198
  end
199
199
 
200
- addleases_desc = <<-EOT.unindent
201
- (DEPRECATED, use addar) Adds a lease to the Virtual Network
202
- EOT
203
-
204
- command :addleases, addleases_desc, :vnetid, :ip, [:mac, nil] do
205
- helper.perform_action(args[0], options, 'lease added') do |vn|
206
- vn.addleases(args[1], args[2])
207
- end
208
- end
209
-
210
200
  rmar_desc = <<-EOT.unindent
211
201
  Removes an address range from the Virtual Network
212
202
  EOT
@@ -217,16 +207,6 @@ CommandParser::CmdParser.new(ARGV) do
217
207
  end
218
208
  end
219
209
 
220
- rmleases_desc = <<-EOT.unindent
221
- (DEPRECATED, use rmar) Removes a lease from the Virtual Network
222
- EOT
223
-
224
- command :rmleases, rmleases_desc, :vnetid, :ip do
225
- helper.perform_action(args[0], options, 'lease removed') do |vn|
226
- vn.rmleases(args[1])
227
- end
228
- end
229
-
230
210
  free_desc = <<-EOT.unindent
231
211
  Frees a reserved address range from the Virtual Network
232
212
  EOT
@@ -445,8 +425,13 @@ CommandParser::CmdParser.new(ARGV) do
445
425
  EOT
446
426
 
447
427
  command :orphans, show_desc do
448
- puts helper.check_orphans
428
+ orphans = helper.check_orphans
429
+ if OpenNebula.is_error?(orphans)
430
+ STDERR.puts orphans.message
431
+ return -1
432
+ end
449
433
 
434
+ puts orphans
450
435
  return 0
451
436
  end
452
437
 
data/bin/onevntemplate CHANGED
@@ -252,10 +252,10 @@ CommandParser::CmdParser.new(ARGV) do
252
252
  end
253
253
 
254
254
  extra_template = res.last
255
+ end
255
256
 
256
- if OneVNetHelper.add_ar_options_used?(options)
257
- extra_template << OpenNebulaHelper.create_ar(options)
258
- end
257
+ if OneVNetHelper.add_ar_options_used?(options)
258
+ extra_template << OpenNebulaHelper.create_ar(options)
259
259
  end
260
260
 
261
261
  if c_i
data/lib/ods_helper.rb CHANGED
@@ -539,3 +539,186 @@ class ODSHelper < OpenNebulaHelper::OneHelper
539
539
  end
540
540
 
541
541
  end
542
+
543
+ # Print events progress
544
+ class EventProgressPrinter
545
+
546
+ SPINNER = ['/', '-', '\\', '|']
547
+
548
+ STARTED = 'started'
549
+ SUCCESS = 'success'
550
+ FAILURE = 'failure'
551
+
552
+ def initialize(output: $stdout)
553
+ @output = output
554
+ @spinner_index = 0
555
+ @spinner_thread = nil
556
+ @current_line = nil
557
+ @transient_lines = 0
558
+ @mutex = Mutex.new
559
+ end
560
+
561
+ def print_event(name, state, context = nil)
562
+ return if name.nil? || name.to_s.empty?
563
+
564
+ state = state.to_s
565
+
566
+ stop_spinner
567
+ clear_transient if interactive?
568
+
569
+ if state == STARTED
570
+ print_active_event(name, state, context)
571
+ else
572
+ print_event_line(name, state, context)
573
+ end
574
+ end
575
+
576
+ def close
577
+ stop_spinner
578
+ clear_transient if interactive?
579
+ show_cursor if interactive?
580
+ end
581
+
582
+ private
583
+
584
+ def print_active_event(name, state, context)
585
+ if context.nil? || (context.respond_to?(:empty?) && context.empty?)
586
+ start_spinner(name)
587
+ return
588
+ end
589
+
590
+ lines = print_event_line(name, state, context)
591
+ @transient_lines = lines if interactive?
592
+ start_spinner(name) if interactive?
593
+ end
594
+
595
+ def print_event_line(name, state, context = nil)
596
+ @output.puts "#{state_label(state)} #{name}"
597
+ 1 + print_context(context, state_indent(state))
598
+ end
599
+
600
+ def start_spinner(name)
601
+ unless interactive?
602
+ @output.puts "#{state_label(STARTED)} #{name}"
603
+ return
604
+ end
605
+
606
+ stop_spinner
607
+ hide_cursor
608
+
609
+ @current_line = name
610
+
611
+ @spinner_thread = Thread.new do
612
+ loop do
613
+ @mutex.synchronize do
614
+ @output.print "\r#{spinner_label} #{@current_line}"
615
+ @output.flush
616
+ @spinner_index = (@spinner_index + 1) % SPINNER.size
617
+ end
618
+
619
+ sleep 0.15
620
+ end
621
+ end
622
+ end
623
+
624
+ def stop_spinner
625
+ return unless @spinner_thread
626
+
627
+ @spinner_thread.kill
628
+ @spinner_thread.join
629
+ @spinner_thread = nil
630
+
631
+ clear_line if interactive?
632
+ show_cursor
633
+ end
634
+
635
+ def print_context(context, indent)
636
+ lines = 0
637
+
638
+ (context.is_a?(Array) ? context : [context]).each do |detail|
639
+ next if detail.nil?
640
+ next if detail.respond_to?(:empty?) && detail.empty?
641
+
642
+ detail.to_s.each_line do |line|
643
+ @output.puts "#{indent}#{line.chomp}"
644
+ lines += 1
645
+ end
646
+ end
647
+
648
+ lines
649
+ end
650
+
651
+ def clear_transient
652
+ return if @transient_lines.zero?
653
+
654
+ @output.print "\e[#{@transient_lines}F"
655
+ @output.print "\e[J"
656
+ @output.flush
657
+ @transient_lines = 0
658
+ end
659
+
660
+ def spinner_label
661
+ colorize("[#{SPINNER[@spinner_index]}]", CLIHelper::ANSI_YELLOW)
662
+ end
663
+
664
+ def state_label(state)
665
+ color =
666
+ if state == SUCCESS
667
+ CLIHelper::ANSI_GREEN
668
+ elsif state == FAILURE
669
+ CLIHelper::ANSI_RED
670
+ else
671
+ CLIHelper::ANSI_YELLOW
672
+ end
673
+
674
+ colorize(state_label_text(state), color)
675
+ end
676
+
677
+ def state_label_text(state)
678
+ if state == SUCCESS
679
+ '[OK]'
680
+ elsif state == FAILURE
681
+ '[FAIL]'
682
+ else
683
+ '[..]'
684
+ end
685
+ end
686
+
687
+ def state_indent(state)
688
+ ' ' * (state_label_text(state).length + 1)
689
+ end
690
+
691
+ def colorize(text, color)
692
+ return text unless interactive?
693
+
694
+ "#{color}#{text}#{CLIHelper::ANSI_RESET}"
695
+ end
696
+
697
+ def clear_line
698
+ @output.print "\r"
699
+ @output.print ' ' * terminal_width
700
+ @output.print "\r"
701
+ @output.flush
702
+ end
703
+
704
+ def terminal_width
705
+ Integer(`tput cols 2>/dev/null`.strip)
706
+ rescue StandardError
707
+ 120
708
+ end
709
+
710
+ def hide_cursor
711
+ @output.print "\e[?25l"
712
+ @output.flush
713
+ end
714
+
715
+ def show_cursor
716
+ @output.print "\e[?25h"
717
+ @output.flush
718
+ end
719
+
720
+ def interactive?
721
+ @output.tty?
722
+ end
723
+
724
+ end
@@ -313,6 +313,26 @@ class OneGroupHelper < OpenNebulaHelper::OneHelper
313
313
 
314
314
  helper = OneQuotaHelper.new(@client)
315
315
  helper.format_quota(group_hash['GROUP'], default_quotas, group.id)
316
+
317
+ CLIHelper.print_header(str_h1 % 'VLAN RULES', false)
318
+
319
+ rules = [group_hash['GROUP']['VLAN_RULES']['RULE']].flatten rescue []
320
+ rules.compact!
321
+
322
+ CLIHelper::ShowTable.new(nil, self) do
323
+ column :VLAN_ID, 'VLAN Identifier range', :left, :size => 15 do |d|
324
+ d['ID']
325
+ end
326
+
327
+ column :SCOPE, 'Scope of the rule', :left, :size => 15 do |d|
328
+ d['SCOPE']
329
+ end
330
+
331
+ column :VNTEMPLATE, 'VN Template ID range', :left, :size => 15 do |d|
332
+ d['VNTEMPLATE'] || '-'
333
+ end
334
+ end.show(rules)
335
+ puts
316
336
  end
317
337
 
318
338
  end
@@ -16,7 +16,6 @@
16
16
 
17
17
  require 'time'
18
18
  require 'fileutils'
19
- require 'HostSyncManager'
20
19
  require 'one_helper'
21
20
  require 'one_helper/onevm_helper'
22
21
  require 'opennebula/host'
@@ -198,6 +197,16 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
198
197
 
199
198
  NUM_THREADS = 15
200
199
  def sync(host_ids, options)
200
+ # HostSyncManager lives in the driver tree and is only shipped with the
201
+ # server packages. It is required lazily here so that a CLI-only install
202
+ # (opennebula-tools) keeps working for every other onehost subcommand,
203
+ # and only 'onehost sync' degrades when the driver libs are absent.
204
+ begin
205
+ require 'HostSyncManager'
206
+ rescue LoadError
207
+ return -1, "'onehost sync' is only available on the frontend."
208
+ end
209
+
201
210
  if Process.uid.zero? || Process.gid.zero?
202
211
  STDERR.puts("Cannot run 'onehost sync' as root")
203
212
  exit(-1)
@@ -18,6 +18,7 @@ require 'one_helper'
18
18
  require 'one_helper/onevm_helper'
19
19
  require 'opennebula/image'
20
20
  require 'opennebula/image_pool'
21
+ require 'opennebula/template_pool'
21
22
 
22
23
  # CLI helper for oneimage command
23
24
  class OneImageHelper < OpenNebulaHelper::OneHelper
@@ -273,8 +274,11 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
273
274
  pool = factory_pool
274
275
  tmpl_pool = OpenNebula::TemplatePool.new(@client, -2)
275
276
 
276
- pool.info
277
- tmpl_pool.info
277
+ rc = pool.info
278
+ return rc if OpenNebula.is_error?(rc)
279
+
280
+ rc = tmpl_pool.info
281
+ return rc if OpenNebula.is_error?(rc)
278
282
 
279
283
  pool.each do |img|
280
284
  next if img['TYPE'].to_i == 6 # skip backup images
@@ -366,6 +370,9 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
366
370
  CLIHelper.print_header(str_h1 % 'BACKUP INFORMATION', false)
367
371
  puts format(str, 'VM', vms[0])
368
372
 
373
+ disk_ids = image.retrieve_elements('BACKUP_DISK_IDS/ID')
374
+ puts format(str, 'DISK IDS', disk_ids.join(',')) if disk_ids
375
+
369
376
  if image.has_elements?('/IMAGE/BACKUP_INCREMENTS/INCREMENT')
370
377
  puts format(str, 'TYPE', 'INCREMENTAL')
371
378
 
@@ -657,11 +657,6 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
657
657
  end
658
658
  end
659
659
 
660
- def set_backup_mode(vm_ref, backup_mode)
661
- vm = retrieve_resource(vm_ref)
662
- vm.updateconf("BACKUP_CONFIG = [\"MODE\"=\"#{backup_mode}\"]")
663
- end
664
-
665
660
  private
666
661
 
667
662
  def factory(id = nil)
@@ -125,11 +125,10 @@ class OneVMGroupHelper < OpenNebulaHelper::OneHelper
125
125
  puts format(str, 'USER', vmgroup['UNAME'])
126
126
  puts format(str, 'GROUP', vmgroup['GNAME'])
127
127
  puts format(str, 'LOCK', OpenNebulaHelper.level_lock_to_str(vmgroup['LOCK/LOCKED']))
128
+ puts
128
129
 
129
130
  CLIHelper.print_header(str_h1 % 'PERMISSIONS', false)
130
131
 
131
- puts
132
-
133
132
  ['OWNER', 'GROUP', 'OTHER'].each do |e|
134
133
  mask = '---'
135
134
  mask[0] = 'u' if vmgroup["PERMISSIONS/#{e}_U"] == '1'
@@ -17,6 +17,7 @@ require 'one_helper'
17
17
  require 'one_helper/onevm_helper'
18
18
  require 'opennebula/virtual_network'
19
19
  require 'opennebula/virtual_network_pool'
20
+ require 'opennebula/template_pool'
20
21
 
21
22
  # OneVnet Command Helper
22
23
  class OneVNetHelper < OpenNebulaHelper::OneHelper
@@ -238,8 +239,11 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
238
239
  pool = factory_pool
239
240
  tmpl_pool = OpenNebula::TemplatePool.new(@client, -2)
240
241
 
241
- pool.info
242
- tmpl_pool.info
242
+ rc = pool.info
243
+ return rc if OpenNebula.is_error?(rc)
244
+
245
+ rc = tmpl_pool.info
246
+ return rc if OpenNebula.is_error?(rc)
243
247
 
244
248
  pool.each do |img|
245
249
  attrs = { :id => img['ID'],
data/lib/one_helper.rb CHANGED
@@ -1564,6 +1564,9 @@ Bash symbols must be escaped on STDIN passing'
1564
1564
  when 'VM'
1565
1565
  require 'opennebula/virtual_machine_pool'
1566
1566
  OpenNebula::VirtualMachinePool.new(client)
1567
+ when 'VMGROUP'
1568
+ require 'opennebula/vm_group_pool'
1569
+ OpenNebula::VMGroupPool.new(client)
1567
1570
  when 'ZONE'
1568
1571
  require 'opennebula/zone_pool'
1569
1572
  OpenNebula::ZonePool.new(client)
@@ -1872,7 +1875,11 @@ Bash symbols must be escaped on STDIN passing'
1872
1875
  user, object=*res
1873
1876
 
1874
1877
  template<<"#{section.upcase}=[\n"
1875
- if object.downcase == 'auto'
1878
+ if section.upcase == 'NIC' && ['auto', 'dummy'].include?(object.downcase)
1879
+ extra_attributes.each do |extra_attribute|
1880
+ key, value = extra_attribute.split('=')
1881
+ template<<" #{key.upcase}=\"#{value}\",\n"
1882
+ end
1876
1883
  template<<" NETWORK_MODE=\"#{object}\"\n"
1877
1884
  else
1878
1885
  template<<" #{name.upcase}_UNAME=\"#{user}\",\n" if user
@@ -2244,6 +2251,8 @@ Bash symbols must be escaped on STDIN passing'
2244
2251
  exp = OneTemplateHelper::FLOAT_EXP
2245
2252
  end
2246
2253
 
2254
+ noanswer = false
2255
+
2247
2256
  loop do
2248
2257
  print header
2249
2258
  answer = STDIN.readline.chop
@@ -2282,6 +2291,8 @@ Bash symbols must be escaped on STDIN passing'
2282
2291
  header += "Float in the range [#{min}..#{max}]: "
2283
2292
  end
2284
2293
 
2294
+ noanswer = false
2295
+
2285
2296
  loop do
2286
2297
  print header
2287
2298
  answer = STDIN.readline.chop
@@ -2309,6 +2320,8 @@ Bash symbols must be escaped on STDIN passing'
2309
2320
 
2310
2321
  header += 'Please type the selection number: '
2311
2322
 
2323
+ noanswer = false
2324
+
2312
2325
  loop do
2313
2326
  print header
2314
2327
  answer = STDIN.readline.chop
@@ -27,6 +27,7 @@
27
27
  <xs:element name="BACKUP_VMS" type="xs:string"/>
28
28
  <xs:element name="BACKUP_VOLATILE" type="xs:string" minOccurs="0" maxOccurs="1"/>
29
29
  <xs:element name="DATASTORE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
30
+ <xs:element name="DISK_IDS" type="xs:string" minOccurs="0" maxOccurs="1"/>
30
31
  <xs:element name="ERROR" type="xs:string" minOccurs="0" maxOccurs="1"/>
31
32
  <xs:element name="EXECUTION" type="xs:string" minOccurs="0" maxOccurs="1"/>
32
33
  <xs:element name="FS_FREEZE" type="xs:string" minOccurs="0" maxOccurs="1"/>
@@ -14,6 +14,22 @@
14
14
  <xs:element name="NETWORK_QUOTA" type="NETWORK_QUOTA" minOccurs="0"/>
15
15
  <xs:element name="VM_QUOTA" type="VM_QUOTA" minOccurs="0"/>
16
16
  <xs:element name="IMAGE_QUOTA" type="IMAGE_QUOTA" minOccurs="0"/>
17
+ <xs:element name="VLAN_RULES">
18
+ <xs:complexType>
19
+ <xs:sequence>
20
+ <xs:element name="ID" type="xs:integer"/>
21
+ <xs:element name="RULE" minOccurs="0" maxOccurs="unbounded">
22
+ <xs:complexType>
23
+ <xs:sequence>
24
+ <xs:element name="ID" type="xs:string"/>
25
+ <xs:element name="SCOPE" type="xs:string"/>
26
+ <xs:element name="VNTEMPLATE" type="xs:string"/>
27
+ </xs:sequence>
28
+ </xs:complexType>
29
+ </xs:element>
30
+ </xs:sequence>
31
+ </xs:complexType>
32
+ </xs:element>
17
33
  <xs:element name="DEFAULT_GROUP_QUOTAS">
18
34
  <xs:complexType>
19
35
  <xs:sequence>
@@ -28,6 +28,22 @@
28
28
  </xs:sequence>
29
29
  </xs:complexType>
30
30
  </xs:element>
31
+ <xs:element name="VLAN_RULES">
32
+ <xs:complexType>
33
+ <xs:sequence>
34
+ <xs:element name="ID" type="xs:integer"/>
35
+ <xs:element name="RULE" minOccurs="0" maxOccurs="unbounded">
36
+ <xs:complexType>
37
+ <xs:sequence>
38
+ <xs:element name="ID" type="xs:string"/>
39
+ <xs:element name="SCOPE" type="xs:string"/>
40
+ <xs:element name="VNTEMPLATE" type="xs:string"/>
41
+ </xs:sequence>
42
+ </xs:complexType>
43
+ </xs:element>
44
+ </xs:sequence>
45
+ </xs:complexType>
46
+ </xs:element>
31
47
  </xs:choice>
32
48
  <xs:element name="DEFAULT_GROUP_QUOTAS" minOccurs="1" maxOccurs="1">
33
49
  <xs:complexType>
@@ -223,6 +223,7 @@
223
223
 
224
224
  <xs:element name="LOG_CALL_FORMAT" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
225
225
  <xs:element name="LOG_RESULT_LENGTH" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
226
+ <xs:element name="MAC_GLOBAL_SPACE" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
226
227
  <xs:element name="MAC_PREFIX" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
227
228
  <xs:element name="MANAGER_TIMER" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
228
229
 
@@ -317,9 +317,11 @@
317
317
  <xs:sequence>
318
318
  <xs:element name="BACKUP_JOB_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
319
319
  <xs:element name="BACKUP_VOLATILE" type="xs:string" minOccurs="0" maxOccurs="1"/>
320
+ <xs:element name="DISK_IDS" type="xs:string" minOccurs="0" maxOccurs="1"/>
320
321
  <xs:element name="FS_FREEZE" type="xs:string" minOccurs="0" maxOccurs="1"/>
321
322
  <xs:element name="INCREMENTAL_BACKUP_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
322
323
  <xs:element name="INCREMENT_MODE" type="xs:string" minOccurs="0" maxOccurs="1"/>
324
+ <xs:element name="INTERACTIVE" type="xs:string" minOccurs="0" maxOccurs="1"/>
323
325
  <xs:element name="KEEP_LAST" type="xs:string" minOccurs="0" maxOccurs="1"/>
324
326
  <xs:element name="LAST_BACKUP_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
325
327
  <xs:element name="LAST_BACKUP_SIZE" type="xs:string" minOccurs="0" maxOccurs="1"/>
@@ -19,6 +19,7 @@
19
19
  <xs:element name="STATE" type="xs:integer"/>
20
20
  <xs:element name="PREV_STATE" type="xs:integer"/>
21
21
  <xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
22
+ <xs:element name="TEMPLATE_ID" type="xs:string"/>
22
23
  <xs:element name="VN_MAD" type="xs:string"/>
23
24
  <xs:element name="PHYDEV" type="xs:string"/>
24
25
  <xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
@@ -39,13 +40,16 @@
39
40
  <xs:complexType>
40
41
  <xs:sequence>
41
42
  <xs:element name="AR_ID" type="xs:string"/>
43
+ <xs:element name="CVLANS" type="xs:string" minOccurs="0"/>
42
44
  <xs:element name="GLOBAL_PREFIX" type="xs:string" minOccurs="0"/>
43
45
  <xs:element name="IP" type="xs:string" minOccurs="0"/>
44
46
  <xs:element name="MAC" type="xs:string"/>
47
+ <xs:element name="NEXT_INDEX" type="xs:integer"/>
45
48
  <xs:element name="PARENT_NETWORK_AR_ID" type="xs:string" minOccurs="0"/>
46
49
  <xs:element name="SHARED" type="xs:string" minOccurs="0"/>
47
50
  <xs:element name="SIZE" type="xs:integer"/>
48
51
  <xs:element name="TYPE" type="xs:string"/>
52
+ <xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
49
53
  <xs:element name="ULA_PREFIX" type="xs:string" minOccurs="0"/>
50
54
  <xs:element name="VN_MAD" type="xs:string" minOccurs="0"/>
51
55
  <xs:element name="MAC_END" type="xs:string" minOccurs="0"/>
@@ -22,6 +22,7 @@
22
22
  <xs:element name="STATE" type="xs:integer"/>
23
23
  <xs:element name="PREV_STATE" type="xs:integer"/>
24
24
  <xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
25
+ <xs:element name="TEMPLATE_ID" type="xs:string"/>
25
26
  <xs:element name="VN_MAD" type="xs:string"/>
26
27
  <xs:element name="PHYDEV" type="xs:string"/>
27
28
  <xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
@@ -43,13 +44,16 @@
43
44
  <xs:sequence>
44
45
  <xs:element name="ALLOCATED" type="xs:string" minOccurs="0"/>
45
46
  <xs:element name="AR_ID" type="xs:string"/>
47
+ <xs:element name="CVLANS" type="xs:string" minOccurs="0"/>
46
48
  <xs:element name="GLOBAL_PREFIX" type="xs:string" minOccurs="0"/>
47
49
  <xs:element name="IP" type="xs:string" minOccurs="0"/>
48
50
  <xs:element name="MAC" type="xs:string"/>
51
+ <xs:element name="NEXT_INDEX" type="xs:integer"/>
49
52
  <xs:element name="PARENT_NETWORK_AR_ID" type="xs:string" minOccurs="0"/>
50
53
  <xs:element name="SHARED" type="xs:string" minOccurs="0"/>
51
54
  <xs:element name="SIZE" type="xs:integer"/>
52
55
  <xs:element name="TYPE" type="xs:string"/>
56
+ <xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
53
57
  <xs:element name="ULA_PREFIX" type="xs:string" minOccurs="0"/>
54
58
  <xs:element name="VN_MAD" type="xs:string" minOccurs="0"/>
55
59
  </xs:sequence>
@@ -64,4 +68,4 @@
64
68
  </xs:sequence>
65
69
  </xs:complexType>
66
70
  </xs:element>
67
- </xs:schema>
71
+ </xs:schema>
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: 7.2.1
4
+ version: 7.3.80.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-21 00:00:00.000000000 Z
11
+ date: 2026-07-12 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: 7.2.1
19
+ version: 7.3.80.pre
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: 7.2.1
26
+ version: 7.3.80.pre
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -202,9 +202,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - ">="
205
+ - - ">"
206
206
  - !ruby/object:Gem::Version
207
- version: '0'
207
+ version: 1.3.1
208
208
  requirements: []
209
209
  rubygems_version: 3.3.5
210
210
  signing_key: