opennebula-cli 5.11.80.pre → 5.12.0.2

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: 768b86165d0c44d9ec4e0f88618a51ef1058b75b
4
- data.tar.gz: b7736f3f80410ca456a45ac4e1f441eff5d3fa55
3
+ metadata.gz: d83e153918c260f5bc09db239c77f492324e1f40
4
+ data.tar.gz: 7fcca13a86384ec0fb65ebcb7688179df29f55af
5
5
  SHA512:
6
- metadata.gz: 428a91440d21381152277c91e97c9ab06f2b2c2e8f968b1852c48e788a294727e9807588d20cce6d852714e042ef9b09ffdf87985efa16096a35d356228b9aa2
7
- data.tar.gz: 7c4aeb87e22274c51171d4708306933d9d99e4ab34704888d2ddc4c100c7686f40f6fcc008a1237d35ba7b5df1ad871ca47faee95a3f40089f1e6339461356b9
6
+ metadata.gz: 5fa4092f03463ac4db38f8b395321bd2a41d662c3497c76487eb063511663dd091690e15e7e056addfaffe33bc9602293177ed4b74eaade5d00b485cd12a7c73
7
+ data.tar.gz: 365a24105b7d6e1a934cc1f1f5b23f5902a55aec06fbad0606affba56950c4216c66aa511672297e7db86d610b18d84d5aa7af2e08cf28562aad2c4cbfe61466
@@ -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
@@ -75,6 +76,13 @@ CommandParser::CmdParser.new(ARGV) do
75
76
  :description => 'lock all actions'
76
77
  }
77
78
 
79
+ TAG = {
80
+ :name => 'tag',
81
+ :large => '--tag tag',
82
+ :format => String,
83
+ :description => 'DockerHub image tag (default latest)'
84
+ }
85
+
78
86
  ########################################################################
79
87
  # Global Options
80
88
  ########################################################################
@@ -87,7 +95,8 @@ CommandParser::CmdParser.new(ARGV) do
87
95
 
88
96
  CREATE_OPTIONS = [OneMarketPlaceHelper::MARKETPLACE]
89
97
  EXPORT_OPTIONS = [OneDatastoreHelper::DATASTORE,
90
- OneMarketPlaceAppHelper::VMNAME]
98
+ OneMarketPlaceAppHelper::VMNAME,
99
+ TAG]
91
100
 
92
101
  ########################################################################
93
102
  # Formatters for arguments
@@ -172,10 +181,13 @@ CommandParser::CmdParser.new(ARGV) do
172
181
 
173
182
  command :export, export_desc, :appid, :name, :options => EXPORT_OPTIONS do
174
183
  helper.perform_action(args[0], options, 'exported') do |obj|
184
+ tag ="tag=#{options[:tag]}" if options[:tag]
185
+
175
186
  rc = obj.export(
176
187
  :dsid => options[:datastore],
177
188
  :name => args[1],
178
- :vmtemplate_name => options[:vmname]
189
+ :vmtemplate_name => options[:vmname],
190
+ :url_args => tag
179
191
  )
180
192
 
181
193
  next rc if OpenNebula.is_error?(rc)
@@ -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')