opennebula-cli 7.0.2 → 7.2.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +1 -1
  3. data/bin/oneacl +1 -1
  4. data/bin/onebackupjob +1 -1
  5. data/bin/onecluster +1 -1
  6. data/bin/onedatastore +1 -1
  7. data/bin/oneflow +1 -1
  8. data/bin/oneflow-template +1 -1
  9. data/bin/oneform +150 -0
  10. data/bin/onegroup +1 -1
  11. data/bin/onehook +1 -1
  12. data/bin/onehost +1 -1
  13. data/bin/oneimage +1 -1
  14. data/bin/oneirb +1 -1
  15. data/bin/onelog +1 -1
  16. data/bin/onemarket +1 -1
  17. data/bin/onemarketapp +4 -1
  18. data/bin/onesecgroup +1 -1
  19. data/bin/oneshowback +1 -1
  20. data/bin/onetemplate +16 -5
  21. data/bin/oneuser +3 -2
  22. data/bin/onevdc +1 -1
  23. data/bin/onevm +51 -6
  24. data/bin/onevmgroup +1 -1
  25. data/bin/onevnet +1 -1
  26. data/bin/onevntemplate +3 -2
  27. data/bin/onevrouter +1 -1
  28. data/bin/onezone +12 -6
  29. data/lib/cli_helper.rb +153 -1
  30. data/lib/command_parser.rb +1 -1
  31. data/lib/one_helper/oneacct_helper.rb +3 -1
  32. data/lib/one_helper/oneacl_helper.rb +3 -1
  33. data/lib/one_helper/onebackupjob_helper.rb +3 -1
  34. data/lib/one_helper/onecluster_helper.rb +4 -1
  35. data/lib/one_helper/onedatastore_helper.rb +4 -1
  36. data/lib/one_helper/oneflow_helper.rb +1 -1
  37. data/lib/one_helper/oneflowtemplate_helper.rb +1 -1
  38. data/lib/one_helper/oneform_helper.rb +255 -0
  39. data/lib/one_helper/onegroup_helper.rb +133 -98
  40. data/lib/one_helper/onehook_helper.rb +5 -2
  41. data/lib/one_helper/onehost_helper.rb +6 -3
  42. data/lib/one_helper/oneimage_helper.rb +3 -1
  43. data/lib/one_helper/onemarket_helper.rb +3 -1
  44. data/lib/one_helper/onemarketapp_helper.rb +4 -1
  45. data/lib/one_helper/onequota_helper.rb +105 -22
  46. data/lib/one_helper/onesecgroup_helper.rb +3 -1
  47. data/lib/one_helper/onetemplate_helper.rb +3 -2
  48. data/lib/one_helper/oneuser_helper.rb +165 -156
  49. data/lib/one_helper/onevdc_helper.rb +3 -1
  50. data/lib/one_helper/onevm_helper.rb +6 -2
  51. data/lib/one_helper/onevmgroup_helper.rb +3 -1
  52. data/lib/one_helper/onevnet_helper.rb +16 -5
  53. data/lib/one_helper/onevntemplate_helper.rb +3 -2
  54. data/lib/one_helper/onevrouter_helper.rb +3 -1
  55. data/lib/one_helper/onezone_helper.rb +16 -5
  56. data/lib/one_helper.rb +53 -18
  57. data/share/schemas/xsd/group.xsd +8 -0
  58. data/share/schemas/xsd/group_pool.xsd +8 -0
  59. data/share/schemas/xsd/opennebula_configuration.xsd +6 -10
  60. data/share/schemas/xsd/shared.xsd +8 -0
  61. data/share/schemas/xsd/user.xsd +8 -0
  62. data/share/schemas/xsd/user_pool.xsd +8 -0
  63. data/share/schemas/xsd/vm.xsd +20 -0
  64. data/share/schemas/xsd/vnet.xsd +2 -1
  65. data/share/schemas/xsd/vnet_pool.xsd +1 -0
  66. metadata +7 -4
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, 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 #
@@ -15,6 +15,7 @@
15
15
  #--------------------------------------------------------------------------- #
16
16
 
17
17
  require 'cli_helper'
18
+ require 'opennebula/system'
18
19
 
19
20
  class OneQuotaHelper
20
21
 
@@ -25,6 +26,10 @@ class OneQuotaHelper
25
26
  "VMS_USED" => "0",
26
27
  "CPU" => LIMIT_DEFAULT,
27
28
  "CPU_USED" => "0",
29
+ "PCI_DEV" => LIMIT_DEFAULT,
30
+ "PCI_DEV_USED" => "0",
31
+ "PCI_NIC" => LIMIT_DEFAULT,
32
+ "PCI_NIC_USED" => "0",
28
33
  "MEMORY" => LIMIT_DEFAULT,
29
34
  "MEMORY_USED" => "0",
30
35
  "RUNNING_VMS" => LIMIT_DEFAULT,
@@ -33,6 +38,10 @@ class OneQuotaHelper
33
38
  "RUNNING_CPU_USED" => "0",
34
39
  "RUNNING_MEMORY" => LIMIT_DEFAULT,
35
40
  "RUNNING_MEMORY_USED" => "0",
41
+ "RUNNING_PCI_DEV" => LIMIT_DEFAULT,
42
+ "RUNNING_PCI_DEV_USED" => "0",
43
+ "RUNNING_PCI_NIC" => LIMIT_DEFAULT,
44
+ "RUNNING_PCI_NIC_USED" => "0",
36
45
  "SYSTEM_DISK_SIZE" => LIMIT_DEFAULT,
37
46
  "SYSTEM_DISK_SIZE_USED" => "0"
38
47
  }
@@ -56,6 +65,10 @@ class OneQuotaHelper
56
65
  # RUNNING_MEMORY = <Max. running memory (MB)>
57
66
  # CPU = <Max. allocated CPU>
58
67
  # RUNNING_CPU = <Max. running CPU>
68
+ # PCI_DEV = <Max. allocated PCI>
69
+ # RUNNING_PCI_DEV = <Max. running PCI>
70
+ # PCI_NIC = <Max. allocated network PCI>
71
+ # RUNNING_PCI_NIC = <Max. running network PCI>
59
72
  # SYSTEM_DISK_SIZE = <Max. allocated system disk (MB)>
60
73
  # ]
61
74
  #
@@ -241,12 +254,20 @@ class OneQuotaHelper
241
254
  "CPU_USED" => "0",
242
255
  "MEMORY" => limit,
243
256
  "MEMORY_USED" => "0",
257
+ "PCI_DEV" => limit,
258
+ "PCI_DEV_USED" => "0",
259
+ "PCI_NIC" => limit,
260
+ "PCI_NIC_USED" => "0",
244
261
  "RUNNING_VMS" => limit,
245
262
  "RUNNING_VMS_USED" => "0",
246
263
  "RUNNING_CPU" => limit,
247
264
  "RUNNING_CPU_USED" => "0",
248
265
  "RUNNING_MEMORY" => limit,
249
266
  "RUNNING_MEMORY_USED" => "0",
267
+ "RUNNING_PCI_DEV" => limit,
268
+ "RUNNING_PCI_DEV_USED" => "0",
269
+ "RUNNING_PCI_NIC" => limit,
270
+ "RUNNING_PCI_NIC_USED" => "0",
250
271
  "SYSTEM_DISK_SIZE" => limit,
251
272
  "SYSTEM_DISK_SIZE_USED" => "0"
252
273
  }]
@@ -267,7 +288,7 @@ class OneQuotaHelper
267
288
  end
268
289
  end
269
290
 
270
- column :"VMS", "", :right, :size=>11 do |d|
291
+ column :"VMS", "", :right, :size=>9 do |d|
271
292
  if !d.nil?
272
293
  elem = 'VMS'
273
294
  limit = d[elem]
@@ -275,14 +296,14 @@ class OneQuotaHelper
275
296
  limit, "VM_QUOTA/VM/#{elem}")
276
297
 
277
298
  if limit == LIMIT_UNLIMITED
278
- "%4d / -" % [d["VMS_USED"]]
299
+ "%3d / -" % [d["VMS_USED"]]
279
300
  else
280
- "%4d / %4d" % [d["VMS_USED"], limit]
301
+ "%3d / %3d" % [d["VMS_USED"], limit]
281
302
  end
282
303
  end
283
304
  end
284
305
 
285
- column :"MEMORY", "", :right, :size=>19 do |d|
306
+ column :"MEMORY", "", :right, :size=>15 do |d|
286
307
  if !d.nil?
287
308
  elem = 'MEMORY'
288
309
  limit = d[elem]
@@ -290,11 +311,11 @@ class OneQuotaHelper
290
311
  limit, "VM_QUOTA/VM/#{elem}")
291
312
 
292
313
  if limit == LIMIT_UNLIMITED
293
- "%8s / -" % [
314
+ "%6s / -" % [
294
315
  OpenNebulaHelper.unit_to_str(d["MEMORY_USED"].to_i,{},"M")
295
316
  ]
296
317
  else
297
- "%8s / %8s" % [
318
+ "%6s / %6s" % [
298
319
  OpenNebulaHelper.unit_to_str(d["MEMORY_USED"].to_i,{},"M"),
299
320
  OpenNebulaHelper.unit_to_str(limit.to_i,{},"M")
300
321
  ]
@@ -302,7 +323,7 @@ class OneQuotaHelper
302
323
  end
303
324
  end
304
325
 
305
- column :"CPU", "", :right, :size=>19 do |d|
326
+ column :"CPU", "", :right, :size=>15 do |d|
306
327
  if !d.nil?
307
328
  elem = 'CPU'
308
329
  limit = d[elem]
@@ -310,14 +331,44 @@ class OneQuotaHelper
310
331
  limit, "VM_QUOTA/VM/#{elem}")
311
332
 
312
333
  if limit == LIMIT_UNLIMITED
313
- "%8.2f / -" % [d["CPU_USED"]]
334
+ "%6.1f / -" % [d["CPU_USED"]]
335
+ else
336
+ "%6.1f / %6.2f" % [d["CPU_USED"], limit]
337
+ end
338
+ end
339
+ end
340
+
341
+ column :"PCI DEV", "", :right, :size=>9 do |d|
342
+ if !d.nil?
343
+ elem = 'PCI_DEV'
344
+ limit = d[elem]
345
+ limit = helper.get_default_limit(
346
+ limit, "VM_QUOTA/VM/#{elem}")
347
+
348
+ if limit == LIMIT_UNLIMITED
349
+ "%3d / -" % [d["PCI_DEV_USED"]]
314
350
  else
315
- "%8.2f / %8.2f" % [d["CPU_USED"], limit]
351
+ "%3d / %3d" % [d["PCI_DEV_USED"], limit]
316
352
  end
317
353
  end
318
354
  end
319
355
 
320
- column :"SYSTEM_DISK_SIZE", "", :right, :size=>19 do |d|
356
+ column :"PCI NIC", "", :right, :size=>9 do |d|
357
+ if !d.nil?
358
+ elem = 'PCI_NIC'
359
+ limit = d[elem]
360
+ limit = helper.get_default_limit(
361
+ limit, "VM_QUOTA/VM/#{elem}")
362
+
363
+ if limit == LIMIT_UNLIMITED
364
+ "%3d / -" % [d["PCI_NIC_USED"]]
365
+ else
366
+ "%3d / %3d" % [d["PCI_NIC_USED"], limit]
367
+ end
368
+ end
369
+ end
370
+
371
+ column :"DISK SIZE", "", :right, :size=>15 do |d|
321
372
  if !d.nil?
322
373
  elem = 'SYSTEM_DISK_SIZE'
323
374
  limit = d[elem]
@@ -325,11 +376,11 @@ class OneQuotaHelper
325
376
  limit, "VM_QUOTA/VM/#{elem}")
326
377
 
327
378
  if limit == LIMIT_UNLIMITED
328
- "%8s / -" % [
379
+ "%6s / -" % [
329
380
  OpenNebulaHelper.unit_to_str(d["SYSTEM_DISK_SIZE_USED"].to_i,{},"M")
330
381
  ]
331
382
  else
332
- "%8s / %8s" % [
383
+ "%6s / %6s" % [
333
384
  OpenNebulaHelper.unit_to_str(d["SYSTEM_DISK_SIZE_USED"].to_i,{},"M"),
334
385
  OpenNebulaHelper.unit_to_str(limit.to_i,{},"M")
335
386
  ]
@@ -352,7 +403,7 @@ class OneQuotaHelper
352
403
  d['CLUSTER_IDS']
353
404
  end
354
405
  end
355
- column :"RUNNING VMS", "", :right, :size=>17 do |d|
406
+ column :"RUN VMS", "", :right, :size=>9 do |d|
356
407
  if !d.nil?
357
408
  elem = 'RUNNING_VMS'
358
409
  limit = d[elem] || LIMIT_UNLIMITED
@@ -364,14 +415,14 @@ class OneQuotaHelper
364
415
  end
365
416
 
366
417
  if limit == LIMIT_UNLIMITED
367
- "%7d / -" % [d["RUNNING_VMS_USED"]]
418
+ "%3d / -" % [d["RUNNING_VMS_USED"]]
368
419
  else
369
- "%7d / %7d" % [d["RUNNING_VMS_USED"], limit]
420
+ "%3d / %3d" % [d["RUNNING_VMS_USED"], limit]
370
421
  end
371
422
  end
372
423
  end
373
424
 
374
- column :"RUNNING MEMORY", "", :right, :size=>20 do |d|
425
+ column :"RUN MEMORY", "", :right, :size=>15 do |d|
375
426
  if !d.nil?
376
427
  elem = 'RUNNING_MEMORY'
377
428
  limit = d[elem] || LIMIT_UNLIMITED
@@ -383,11 +434,11 @@ class OneQuotaHelper
383
434
  end
384
435
 
385
436
  if limit == LIMIT_UNLIMITED
386
- "%8s / -" % [
437
+ "%6s / -" % [
387
438
  OpenNebulaHelper.unit_to_str(d["RUNNING_MEMORY_USED"].to_i,{},"M")
388
439
  ]
389
440
  else
390
- "%8s / %8s" % [
441
+ "%6s / %6s" % [
391
442
  OpenNebulaHelper.unit_to_str(d["RUNNING_MEMORY_USED"].to_i,{},"M"),
392
443
  OpenNebulaHelper.unit_to_str(limit.to_i,{},"M")
393
444
  ]
@@ -395,7 +446,7 @@ class OneQuotaHelper
395
446
  end
396
447
  end
397
448
 
398
- column :"RUNNING CPU", "", :right, :size=>20 do |d|
449
+ column :"RUN CPU", "", :right, :size=>15 do |d|
399
450
  if !d.nil?
400
451
  elem = 'RUNNING_CPU'
401
452
  limit = d[elem] || LIMIT_UNLIMITED
@@ -407,9 +458,41 @@ class OneQuotaHelper
407
458
  end
408
459
 
409
460
  if limit == LIMIT_UNLIMITED
410
- "%8.2f / -" % [d["RUNNING_CPU_USED"]]
461
+ "%6.1f / -" % [d["RUNNING_CPU_USED"]]
462
+ else
463
+ "%6.1f / %6.1f" % [d["RUNNING_CPU_USED"], limit]
464
+ end
465
+ end
466
+ end
467
+
468
+ column :"RUN PCI", "", :right, :size=>12 do |d|
469
+ if !d.nil?
470
+ elem = 'RUNNING_PCI_DEV'
471
+ limit = d[elem] || LIMIT_UNLIMITED
472
+ limit = helper.get_default_limit(
473
+ limit, "VM_QUOTA/VM/#{elem}")
474
+ value = d['RUNNING_PCI_DEV_USED'] || 0
475
+
476
+ if limit == LIMIT_UNLIMITED
477
+ "%3s / -" % [value]
478
+ else
479
+ "%3s / %3s" % [value, limit]
480
+ end
481
+ end
482
+ end
483
+
484
+ column :"RUN PCI NIC", "", :right, :size=>12 do |d|
485
+ if !d.nil?
486
+ elem = 'RUNNING_PCI_NIC'
487
+ limit = d[elem] || LIMIT_UNLIMITED
488
+ limit = helper.get_default_limit(
489
+ limit, "VM_QUOTA/VM/#{elem}")
490
+ value = d['RUNNING_PCI_NIC_USED'] || 0
491
+
492
+ if limit == LIMIT_UNLIMITED
493
+ "%3s / -" % [value]
411
494
  else
412
- "%8.2f / %8.2f" % [d["RUNNING_CPU_USED"], limit]
495
+ "%3s / %3s" % [value, limit]
413
496
  end
414
497
  end
415
498
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, 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 #
@@ -15,6 +15,8 @@
15
15
  #--------------------------------------------------------------------------- #
16
16
 
17
17
  require 'one_helper'
18
+ require 'opennebula/security_group'
19
+ require 'opennebula/security_group_pool'
18
20
 
19
21
  class OneSecurityGroupHelper < OpenNebulaHelper::OneHelper
20
22
  RECOVER = {
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, 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 #
@@ -15,7 +15,8 @@
15
15
  #--------------------------------------------------------------------------- #
16
16
 
17
17
  require 'one_helper'
18
- require 'base64'
18
+ require 'opennebula/template'
19
+ require 'opennebula/template_pool'
19
20
 
20
21
  class OneTemplateHelper < OpenNebulaHelper::OneHelper
21
22
  VM_NAME={