opennebula-cli 5.11.90.pre → 5.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f9d505a4c075609888337b302394b8ad09f564
4
- data.tar.gz: 5f91c8dd57ee2e6ebe71f6a5563d289e68ed97ee
3
+ metadata.gz: c983e27446fa44ae16be7dd9ab0edc0088a60ada
4
+ data.tar.gz: 88f7040d5528afa511e6838cf210fa20d90e4881
5
5
  SHA512:
6
- metadata.gz: 45a4ca86499b26e4f8d94178384b7266da3764e0c0169226b1b8f3e582ba09298b01387f852dea0b9d05e66420ea74a2ee84295101aca55366d9adfa92d402e6
7
- data.tar.gz: 547591723faffe0aa33786c3f4ee863576348a618e30ede74df643e98c664afca036dae467f277cce9ef3f063f93391e64ae5e48123156968769ab0e255c6244
6
+ metadata.gz: dbe1aa18b032fff185982ea8569494f8bde7a12abcadad9c4b47107661f845c11711c3cf4c252be9ce9800f31477d6a5fb7865d59864f356511dbcff9b3f90cb
7
+ data.tar.gz: 8f163f00d441e0cbce141ea40f0f5c4478e239ec85fa655055e5ca5d23c099a43d277b8a92223af5d70d119e420fe83a123a883125813ce35a983ba3b3ce0b09
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
data/bin/oneacl CHANGED
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -29,8 +29,9 @@ else
29
29
  end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
- Gem.use_paths(GEMS_LOCATION)
33
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
32
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
+ require 'rubygems'
34
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
34
35
  end
35
36
 
36
37
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -29,8 +29,9 @@ else
29
29
  end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
- Gem.use_paths(GEMS_LOCATION)
33
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
32
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
+ require 'rubygems'
34
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
34
35
  end
35
36
 
36
37
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -97,6 +98,52 @@ CommandParser::CmdParser.new(ARGV) do
97
98
  CREAT_OPTIONS = [IM, VMM, OneClusterHelper::CLUSTER, TYPE]
98
99
  SYNC_OPTIONS = [OneClusterHelper::CLUSTER, FORCE, SSH]
99
100
 
101
+ ########################################################################
102
+ # Monitoring PLOT options
103
+ ########################################################################
104
+ START_T = {
105
+ :name => 'start',
106
+ :large => '--start date',
107
+ :description => 'Start date to show data',
108
+ :format => String
109
+ }
110
+
111
+ END_T = {
112
+ :name => 'end',
113
+ :large => '--end date',
114
+ :description => 'End date to show data',
115
+ :format => String
116
+ }
117
+
118
+ UNIT = {
119
+ :name => 'unit',
120
+ :large => '--unit unit',
121
+ :description => 'Unit to format data',
122
+ :format => String
123
+ }
124
+
125
+ TABLE = {
126
+ :name => 'table',
127
+ :large => '--table',
128
+ :description => 'Show monitoring information in table format'
129
+ }
130
+
131
+ N_ELEMS = {
132
+ :name => 'n_elems',
133
+ :large => '--n elements',
134
+ :description => 'Number of records to show',
135
+ :format => Integer
136
+ }
137
+
138
+ CSV_WITH_SEP = {
139
+ :name => 'csv',
140
+ :large => '--csv separator',
141
+ :description => 'Show data in CSV format',
142
+ :format => String
143
+ }
144
+
145
+ PLOT_OPTS = [START_T, END_T, UNIT, TABLE, N_ELEMS, CSV_WITH_SEP]
146
+
100
147
  ########################################################################
101
148
  # Formatters for arguments
102
149
  ########################################################################
@@ -304,4 +351,25 @@ CommandParser::CmdParser.new(ARGV) do
304
351
  :options => [OneClusterHelper::CLUSTER] do
305
352
  helper.forceupdate(args[0], options)
306
353
  end
354
+
355
+ monitoring_desc = <<-EOT.unindent
356
+ Show monitoring metrics in a graphic
357
+ EOT
358
+
359
+ command :monitoring,
360
+ monitoring_desc,
361
+ :hostid,
362
+ :attr,
363
+ :options => PLOT_OPTS do
364
+ helper.perform_action(args[0], options, 'monitoring') do |host|
365
+ rc = host.info
366
+
367
+ if OpenNebula.is_error?(rc)
368
+ STDERR.puts rc.message
369
+ exit(-1)
370
+ end
371
+
372
+ helper.monitoring(host, args[1], options)
373
+ end
374
+ end
307
375
  end
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -29,8 +29,9 @@ else
29
29
  end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
- Gem.use_paths(GEMS_LOCATION)
33
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
32
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
+ require 'rubygems'
34
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
34
35
  end
35
36
 
36
37
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -29,8 +29,9 @@ else
29
29
  end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
- Gem.use_paths(GEMS_LOCATION)
33
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
32
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
+ require 'rubygems'
34
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
34
35
  end
35
36
 
36
37
  $LOAD_PATH << RUBY_LIB_LOCATION
data/bin/onevdc CHANGED
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
data/bin/onevm CHANGED
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1249,7 +1250,12 @@ CommandParser::CmdParser.new(ARGV) do
1249
1250
  helper.perform_action(args[0], options,
1250
1251
  'Updating VM configuration') do |vm|
1251
1252
  if template.empty?
1252
- vm.info
1253
+ rc = vm.info
1254
+
1255
+ if OpenNebula.is_error?(rc)
1256
+ STDERR.puts "ERROR: #{rc.message}"
1257
+ exit(-1)
1258
+ end
1253
1259
 
1254
1260
  template = vm.template_like_str('TEMPLATE', true,
1255
1261
  'OS | FEATURES | INPUT | '\
@@ -1297,6 +1303,86 @@ CommandParser::CmdParser.new(ARGV) do
1297
1303
  end
1298
1304
  end
1299
1305
 
1306
+ ########################### Charters Management ############################
1307
+
1308
+ create_chart_desc = <<-EOT.unindent
1309
+ Adds a charter to the VM, these are some consecutive scheduled actions
1310
+
1311
+ You can configure the actions in /etc/one/cli/onevm.yaml
1312
+ EOT
1313
+
1314
+ command :'create-chart', create_chart_desc, [:range, :vmid_list] do
1315
+ charters = helper.get_charters
1316
+
1317
+ if charters.nil?
1318
+ STDERR.puts 'No charters found on configuration file'
1319
+ exit(-1)
1320
+ end
1321
+
1322
+ acc_t = 0
1323
+ acc_w = 0
1324
+
1325
+ charters.each do |action, time|
1326
+ sched = "+#{time[:time].to_i + acc_t}"
1327
+
1328
+ helper.schedule_actions(args[0],
1329
+ { :schedule => sched },
1330
+ action.to_s,
1331
+ time[:warning][:time] + acc_w)
1332
+
1333
+ acc_t += time[:time].to_i
1334
+ acc_w += time[:warning][:time].to_i
1335
+ end
1336
+
1337
+ 0
1338
+ end
1339
+
1340
+ delete_chart_desc = <<-EOT.unindent
1341
+ Deletes a charter from the VM
1342
+ EOT
1343
+
1344
+ command :'delete-chart', delete_chart_desc, :vmid, :sched_id do
1345
+ helper.perform_action(args[0], {}, 'Charter deleted') do |vm|
1346
+ rc = vm.info
1347
+
1348
+ if OpenNebula.is_error?(rc)
1349
+ STDERR.puts "Error #{rc.message}"
1350
+ exit(-1)
1351
+ end
1352
+
1353
+ xpath = "USER_TEMPLATE/SCHED_ACTION[ID=#{args[1]}]"
1354
+
1355
+ unless vm.retrieve_elements(xpath)
1356
+ STDERR.puts "Sched action #{args[1]} not found"
1357
+ exit(-1)
1358
+ end
1359
+
1360
+ vm.delete_element(xpath)
1361
+ rc = vm.update(vm.user_template_str)
1362
+
1363
+ if OpenNebula.is_error?(rc)
1364
+ STDERR.puts "Error deleting: #{rc.message}"
1365
+ exit(-1)
1366
+ end
1367
+ end
1368
+
1369
+ 0
1370
+ end
1371
+
1372
+ update_chart_desc = <<-EOT.unindent
1373
+ Updates a charter from a VM
1374
+ EOT
1375
+
1376
+ command :'update-chart',
1377
+ update_chart_desc,
1378
+ :vmid,
1379
+ :sched_id,
1380
+ [:file, nil] do
1381
+ helper.update_schedule_action(args[0], args[1], args[2])
1382
+
1383
+ 0
1384
+ end
1385
+
1300
1386
  # Deprecated commands
1301
1387
 
1302
1388
  deprecated_command(:shutdown, 'terminate')
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -27,8 +27,9 @@ else
27
27
  end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
- Gem.use_paths(GEMS_LOCATION)
31
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
30
+ $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
31
+ require 'rubygems'
32
+ Gem.use_paths(File.realpath(GEMS_LOCATION))
32
33
  end
33
34
 
34
35
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -350,43 +351,9 @@ CommandParser::CmdParser.new(ARGV) do
350
351
  Update Address Range variables. SIZE, IP, MAC and TYPE cannot be updated
351
352
  EOT
352
353
 
353
- command :updatear, update_ar_desc, :vnetid, :ar_id, [:file, nil] do
354
- helper.perform_action(args[0], options, 'modified') do |obj|
355
- rc = obj.info
356
-
357
- if OpenNebula.is_error?(rc)
358
- puts rc.message
359
- exit(-1)
360
- end
361
-
362
- obj.delete_element("AR_POOL/AR[AR_ID!=#{args[1]}]")
363
- obj.delete_element('AR_POOL/AR/LEASES')
364
- obj.delete_element('AR_POOL/AR/USED_LEASES')
365
- obj.delete_element('AR_POOL/AR/MAC_END')
366
- obj.delete_element('AR_POOL/AR/IP_END')
367
- obj.delete_element('AR_POOL/AR/IP6_ULA')
368
- obj.delete_element('AR_POOL/AR/IP6_ULA_END')
369
- obj.delete_element('AR_POOL/AR/IP6_GLOBAL')
370
- obj.delete_element('AR_POOL/AR/IP6_GLOBAL_END')
371
-
372
- if obj.template_like_str('AR_POOL').empty?
373
- puts "Address Range #{args[1]} does not exist for " \
374
- "Virtual Network #{args[0]}"
375
- exit(-1)
376
- end
377
-
378
- str = OpenNebulaHelper.update_template_helper(false,
379
- args[0],
380
- obj,
381
- args[2],
382
- 'AR_POOL',
383
- false)
384
-
385
- helper.set_client(options)
386
- obj = helper.retrieve_resource(obj.id)
387
-
388
- obj.update_ar(str)
389
- end
354
+ command :updatear, update_ar_desc, :vnetid, :ar_id, [:file, nil],
355
+ :options => OpenNebulaHelper::APPEND do
356
+ helper.update_ar(args[0], args[1], args[2], options)
390
357
  end
391
358
 
392
359
  rename_desc = <<-EOT.unindent