opennebula-cli 6.10.2 → 6.99.85.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 +4 -4
- data/bin/oneacct +5 -18
- data/bin/oneacl +2 -18
- data/bin/onebackupjob +2 -18
- data/bin/onecluster +36 -18
- data/bin/onedatastore +2 -18
- data/bin/oneflow +2 -18
- data/bin/oneflow-template +8 -24
- data/bin/onegroup +2 -18
- data/bin/onehook +2 -18
- data/bin/onehost +4 -48
- data/bin/oneimage +2 -18
- data/bin/oneirb +2 -61
- data/bin/onelog +3 -22
- data/bin/onemarket +2 -18
- data/bin/onemarketapp +2 -30
- data/bin/onesecgroup +2 -18
- data/bin/oneshowback +2 -18
- data/bin/onetemplate +2 -19
- data/bin/oneuser +2 -18
- data/bin/onevdc +2 -18
- data/bin/onevm +21 -19
- data/bin/onevmgroup +2 -18
- data/bin/onevnet +2 -18
- data/bin/onevntemplate +2 -18
- data/bin/onevrouter +13 -20
- data/bin/onezone +2 -18
- data/lib/cli_helper.rb +1 -1
- data/lib/command_parser.rb +1 -1
- data/lib/one_helper/oneacct_helper.rb +10 -2
- data/lib/one_helper/oneacl_helper.rb +1 -1
- data/lib/one_helper/onebackupjob_helper.rb +1 -1
- data/lib/one_helper/onecluster_helper.rb +49 -1
- data/lib/one_helper/onedatastore_helper.rb +1 -1
- data/lib/one_helper/oneflow_helper.rb +1 -1
- data/lib/one_helper/oneflowtemplate_helper.rb +17 -17
- data/lib/one_helper/onegroup_helper.rb +4 -55
- data/lib/one_helper/onehook_helper.rb +1 -1
- data/lib/one_helper/onehost_helper.rb +29 -87
- data/lib/one_helper/oneimage_helper.rb +2 -19
- data/lib/one_helper/onemarket_helper.rb +1 -1
- data/lib/one_helper/onemarketapp_helper.rb +13 -3
- data/lib/one_helper/onequota_helper.rb +35 -8
- data/lib/one_helper/onesecgroup_helper.rb +1 -1
- data/lib/one_helper/onetemplate_helper.rb +1 -8
- data/lib/one_helper/oneuser_helper.rb +41 -75
- data/lib/one_helper/onevdc_helper.rb +1 -1
- data/lib/one_helper/onevm_helper.rb +119 -102
- data/lib/one_helper/onevmgroup_helper.rb +1 -1
- data/lib/one_helper/onevnet_helper.rb +1 -1
- data/lib/one_helper/onevntemplate_helper.rb +1 -1
- data/lib/one_helper/onevrouter_helper.rb +1 -1
- data/lib/one_helper/onezone_helper.rb +10 -23
- data/lib/one_helper.rb +34 -156
- data/share/schemas/xsd/acct.xsd +2 -0
- data/share/schemas/xsd/cluster.xsd +21 -0
- data/share/schemas/xsd/datastore.xsd +1 -13
- data/share/schemas/xsd/group.xsd +11 -122
- data/share/schemas/xsd/group_pool.xsd +8 -120
- data/share/schemas/xsd/host.xsd +19 -21
- data/share/schemas/xsd/image.xsd +0 -1
- data/share/schemas/xsd/monitoring_data.xsd +0 -8
- data/share/schemas/xsd/opennebula_configuration.xsd +23 -1
- data/share/schemas/xsd/plan.xsd +29 -0
- data/share/schemas/xsd/requirements.xsd +45 -0
- data/share/schemas/xsd/scheduler_driver_action.xsd +24 -0
- data/share/schemas/xsd/shared.xsd +67 -0
- data/share/schemas/xsd/user.xsd +10 -122
- data/share/schemas/xsd/user_pool.xsd +8 -120
- data/share/schemas/xsd/vm.xsd +37 -28
- data/share/schemas/xsd/vm_pool.xsd +0 -12
- data/share/schemas/xsd/vm_pool_extended.xsd +12 -0
- data/share/schemas/xsd/vmtemplate.xsd +0 -3
- data/share/schemas/xsd/vnet.xsd +0 -5
- data/share/schemas/xsd/vnet_pool_extended.xsd +12 -0
- metadata +11 -9
- data/bin/onevcenter +0 -471
- data/lib/one_helper/onevcenter_helper.rb +0 -523
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15100d70757d563fc5580642315ad5d19f154cfe258f20f7a9ee0075f8d74049
|
4
|
+
data.tar.gz: 83fe3200d450d46880b9a09ba3a84ac7fbf0b0d9a4bfdc0894955764e8bac4d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce5be5cb943bc6ce8281c3bafe741a23c134450d1d585b0ca7ee2c8208f4fd22f7e6ed79172368dbe4eba4497fc9ef14803735ee647cc71c827921bade7e39ee
|
7
|
+
data.tar.gz: 49d4c3dfcd96ae52d93f0c26ce5b68ca8228ad335797a609d20dab76d3397de8c394a2af4053182e10a2fd0a59c6433d8b8f9fd032d7fd9db250cd9aebaf4e97
|
data/bin/oneacct
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -97,6 +81,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
97
81
|
end_time = t.to_i
|
98
82
|
end
|
99
83
|
|
84
|
+
# User defined timezone
|
85
|
+
ENV['TZ'] = options[:timezone] if options[:timezone]
|
86
|
+
|
100
87
|
common_opts = {
|
101
88
|
:start_time => start_time,
|
102
89
|
:end_time => end_time,
|
data/bin/oneacl
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/onebackupjob
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/onecluster
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -233,4 +217,38 @@ CommandParser::CmdParser.new(ARGV) do
|
|
233
217
|
o.rename(args[1])
|
234
218
|
end
|
235
219
|
end
|
220
|
+
|
221
|
+
optimize_desc = <<-EOT.unindent
|
222
|
+
Create optimization plan for Cluster
|
223
|
+
EOT
|
224
|
+
|
225
|
+
# TODO: Consider optional parameters
|
226
|
+
# - autostart: Automatically start applying the new optimization plan
|
227
|
+
# - force: Delete old plan if exists
|
228
|
+
command :optimize, optimize_desc, :clusterid do
|
229
|
+
helper.perform_action(args[0], options, 'creating optimization plan') do |o|
|
230
|
+
o.optimize
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
planexecute_desc = <<-EOT.unindent
|
235
|
+
Start applying the optimization plan
|
236
|
+
EOT
|
237
|
+
|
238
|
+
command :planexecute, planexecute_desc, :clusterid do
|
239
|
+
helper.perform_action(args[0], options, 'cluster optimization started') do |o|
|
240
|
+
o.plan_execute
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
plandelete_desc = <<-EOT.unindent
|
245
|
+
Delete the optimization plan
|
246
|
+
EOT
|
247
|
+
|
248
|
+
# TODO: We should allow to delete a placement plan with id -1
|
249
|
+
command :plandelete, plandelete_desc, :clusterid do
|
250
|
+
helper.perform_action(args[0], options, 'plan deleted') do |o|
|
251
|
+
o.plan_delete
|
252
|
+
end
|
253
|
+
end
|
236
254
|
end
|
data/bin/onedatastore
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/oneflow
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/oneflow-template
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -29,23 +29,7 @@ else
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
32
|
-
|
33
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
34
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
35
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
36
|
-
|
37
|
-
# Suppress warnings from Rubygems
|
38
|
-
# https://github.com/OpenNebula/one/issues/5379
|
39
|
-
begin
|
40
|
-
verb = $VERBOSE
|
41
|
-
$VERBOSE = nil
|
42
|
-
require 'rubygems'
|
43
|
-
Gem.use_paths(real_gems_path)
|
44
|
-
ensure
|
45
|
-
$VERBOSE = verb
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
32
|
+
require 'load_opennebula_paths'
|
49
33
|
# %%RUBYGEMS_SETUP_END%%
|
50
34
|
|
51
35
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -296,13 +280,13 @@ CommandParser::CmdParser.new(ARGV) do
|
|
296
280
|
params['merge_template'] = {}
|
297
281
|
body = JSON.parse(response.body)['DOCUMENT']['TEMPLATE']['BODY']
|
298
282
|
|
299
|
-
# Check global
|
300
|
-
|
301
|
-
params['merge_template'].merge!(
|
283
|
+
# Check global user inputs
|
284
|
+
user_inputs = helper.user_inputs(body['user_inputs'])
|
285
|
+
params['merge_template'].merge!(user_inputs) unless user_inputs.nil?
|
302
286
|
|
303
|
-
# Check role level
|
304
|
-
|
305
|
-
params['merge_template'].merge!(
|
287
|
+
# Check role level user inputs
|
288
|
+
user_inputs_attrs = helper.role_user_inputs(body['roles'])
|
289
|
+
params['merge_template'].merge!(user_inputs_attrs) unless user_inputs_attrs.nil?
|
306
290
|
|
307
291
|
# Check vnets attributes
|
308
292
|
vnets = helper.networks(body['networks'])
|
data/bin/onegroup
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/onehook
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/onehost
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -29,23 +29,7 @@ else
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
32
|
-
|
33
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
34
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
35
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
36
|
-
|
37
|
-
# Suppress warnings from Rubygems
|
38
|
-
# https://github.com/OpenNebula/one/issues/5379
|
39
|
-
begin
|
40
|
-
verb = $VERBOSE
|
41
|
-
$VERBOSE = nil
|
42
|
-
require 'rubygems'
|
43
|
-
Gem.use_paths(real_gems_path)
|
44
|
-
ensure
|
45
|
-
$VERBOSE = verb
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
32
|
+
require 'load_opennebula_paths'
|
49
33
|
# %%RUBYGEMS_SETUP_END%%
|
50
34
|
|
51
35
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -101,14 +85,6 @@ CommandParser::CmdParser.new(ARGV) do
|
|
101
85
|
'deleted in the hosts.'
|
102
86
|
}
|
103
87
|
|
104
|
-
TYPE = {
|
105
|
-
:name => 'type',
|
106
|
-
:short => '-t remote_provider',
|
107
|
-
:large => '--type remote_provider',
|
108
|
-
:description => 'Use type to create a host using Cloud Bursting',
|
109
|
-
:format => String
|
110
|
-
}
|
111
|
-
|
112
88
|
IPV4 = {
|
113
89
|
:name => 'ipv4',
|
114
90
|
:large => '--ipv4 ip1,ip2',
|
@@ -123,7 +99,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
123
99
|
:format => Array
|
124
100
|
}
|
125
101
|
|
126
|
-
CREAT_OPTIONS = [IM, VMM, OneClusterHelper::CLUSTER
|
102
|
+
CREAT_OPTIONS = [IM, VMM, OneClusterHelper::CLUSTER]
|
127
103
|
SYNC_OPTIONS = [OneClusterHelper::CLUSTER, FORCE, SSH]
|
128
104
|
|
129
105
|
########################################################################
|
@@ -203,10 +179,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
203
179
|
|
204
180
|
cid = options[:cluster] || ClusterPool::NONE_CLUSTER_ID
|
205
181
|
helper.create_resource(options) do |host|
|
206
|
-
if !options[:type].nil?
|
207
|
-
str = helper.set_hybrid(options[:type], args[1])
|
208
|
-
end
|
209
182
|
rc = host.allocate(args[0], options[:im], options[:vm], cid)
|
183
|
+
|
210
184
|
if !OpenNebula.is_error?(rc) && !options[:type].nil?
|
211
185
|
host.update(str, true)
|
212
186
|
end
|
@@ -354,24 +328,6 @@ CommandParser::CmdParser.new(ARGV) do
|
|
354
328
|
end
|
355
329
|
end
|
356
330
|
|
357
|
-
importvm_desc = <<-EOT.unindent
|
358
|
-
Import wild VM to OpenNebula. This method is deprecated and will be \
|
359
|
-
removed in a future release.
|
360
|
-
EOT
|
361
|
-
|
362
|
-
command :importvm,
|
363
|
-
importvm_desc,
|
364
|
-
:hostid,
|
365
|
-
:name,
|
366
|
-
:options => [IPV4, IPV6] do
|
367
|
-
helper.perform_action(args[0], options, 'imported') do |o|
|
368
|
-
rc = o.info
|
369
|
-
next rc if OpenNebula.is_error?(rc)
|
370
|
-
|
371
|
-
o.import_wild(args[1], options[:ipv4], options[:ipv6])
|
372
|
-
end
|
373
|
-
end
|
374
|
-
|
375
331
|
forceupdate_desc = <<-EOT.unindent
|
376
332
|
Forces host monitoring update
|
377
333
|
Examples:
|
data/bin/oneimage
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
data/bin/oneirb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -27,23 +27,7 @@ else
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
|
-
|
31
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
# Suppress warnings from Rubygems
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
30
|
+
require 'load_opennebula_paths'
|
47
31
|
# %%RUBYGEMS_SETUP_END%%
|
48
32
|
|
49
33
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -72,57 +56,14 @@ require 'uri'
|
|
72
56
|
require 'yaml'
|
73
57
|
|
74
58
|
require 'opennebula'
|
75
|
-
require 'vcenter_driver'
|
76
59
|
|
77
60
|
# Include OpenNebula to avoid having to use OpenNebula:: namespace
|
78
61
|
include OpenNebula
|
79
62
|
|
80
|
-
################################################################################
|
81
|
-
# vCenter helper functions
|
82
|
-
################################################################################
|
83
|
-
|
84
|
-
# Get VIClient object from host
|
85
|
-
#
|
86
|
-
# @param id [Integer] Host ID
|
87
|
-
def vi_client_host(id)
|
88
|
-
VCenterDriver::VIClient.new_from_host(id)
|
89
|
-
end
|
90
|
-
|
91
|
-
# Get VM vCenter object
|
92
|
-
#
|
93
|
-
# @param id [Integer] VM ID
|
94
|
-
def vm(id)
|
95
|
-
one_vm = VCenterDriver::VIHelper.one_item(OpenNebula::VirtualMachine, id)
|
96
|
-
|
97
|
-
did = one_vm['DEPLOY_ID']
|
98
|
-
hid = one_vm.retrieve_xmlelements(
|
99
|
-
'HISTORY_RECORDS/HISTORY/HID'
|
100
|
-
).last.text.to_i
|
101
|
-
|
102
|
-
VCenterDriver::VirtualMachine.new_one(vi_client_host(hid), did, one_vm)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Get host vCenter object
|
106
|
-
#
|
107
|
-
# @param id [Integer] Host ID
|
108
|
-
def host(id)
|
109
|
-
vi_client = vi_client_host(id)
|
110
|
-
one_h = VCenterDriver::VIHelper.one_item(OpenNebula::Host, hid)
|
111
|
-
|
112
|
-
VCenterDriver::ClusterComputeResource.new_from_ref(
|
113
|
-
one_h['TEMPLATE/VCENTER_CCR_REF'],
|
114
|
-
vi_client
|
115
|
-
)
|
116
|
-
end
|
117
|
-
|
118
63
|
################################################################################
|
119
64
|
# Open irb session
|
120
65
|
################################################################################
|
121
66
|
|
122
|
-
puts '* You can use the function vi_client_host(id) to get vCenter client'
|
123
|
-
puts '* You can use the function vm(id) to get vCenter VM'
|
124
|
-
puts '* You can use the function host(id) to get vCenter host'
|
125
|
-
|
126
67
|
@client = Client.new
|
127
68
|
version = '>= 0'
|
128
69
|
|
data/bin/onelog
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
4
|
-
# Copyright 2002-
|
4
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
5
5
|
# #
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -29,23 +29,7 @@ else
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# %%RUBYGEMS_SETUP_BEGIN%%
|
32
|
-
|
33
|
-
real_gems_path = File.realpath(GEMS_LOCATION)
|
34
|
-
if !defined?(Gem) || Gem.path != [real_gems_path]
|
35
|
-
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
36
|
-
|
37
|
-
# Suppress warnings from Rubygems
|
38
|
-
# https://github.com/OpenNebula/one/issues/5379
|
39
|
-
begin
|
40
|
-
verb = $VERBOSE
|
41
|
-
$VERBOSE = nil
|
42
|
-
require 'rubygems'
|
43
|
-
Gem.use_paths(real_gems_path)
|
44
|
-
ensure
|
45
|
-
$VERBOSE = verb
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
32
|
+
require 'load_opennebula_paths'
|
49
33
|
# %%RUBYGEMS_SETUP_END%%
|
50
34
|
|
51
35
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
@@ -58,12 +42,9 @@ DEFAULT_PAGER = 'less'
|
|
58
42
|
SERVICES = {
|
59
43
|
'fireedge' => { :log => 'fireedge.log', :error => 'fireedge.error' },
|
60
44
|
'monitor' => { :log => 'monitor.log' },
|
61
|
-
'novnc' => { :log => 'novnc.log' },
|
62
45
|
'oned' => { :log => 'oned.log' },
|
63
46
|
'onehem' => { :log => 'onehem.log', :error => 'onehem.error' },
|
64
|
-
'sched' => { :log => 'sched.log' }
|
65
|
-
'sunstone' => { :log => 'sunstone.log', :error => 'sunstone.error' },
|
66
|
-
'vcenter' => { :log => 'vcenter_monitor.log' }
|
47
|
+
'sched' => { :log => 'sched.log' }
|
67
48
|
}
|
68
49
|
|
69
50
|
require 'command_parser'
|