opennebula-cli 6.2.2 → 6.3.90.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 +1 -1
- data/bin/oneacl +1 -1
- data/bin/onecluster +1 -1
- data/bin/onedatastore +1 -1
- data/bin/oneflow +24 -1
- data/bin/oneflow-template +1 -1
- data/bin/onegroup +1 -1
- data/bin/onehook +1 -1
- data/bin/onehost +1 -1
- data/bin/oneimage +1 -1
- data/bin/oneirb +131 -0
- data/bin/onelog +101 -0
- data/bin/onemarket +1 -1
- data/bin/onemarketapp +1 -1
- data/bin/onesecgroup +1 -1
- data/bin/oneshowback +1 -1
- data/bin/onetemplate +1 -1
- data/bin/oneuser +1 -1
- data/bin/onevcenter +1 -1
- data/bin/onevdc +1 -1
- data/bin/onevm +65 -1
- data/bin/onevmgroup +1 -1
- data/bin/onevnet +58 -1
- data/bin/onevntemplate +1 -1
- data/bin/onevrouter +1 -1
- data/bin/onezone +1 -1
- data/lib/cli_helper.rb +10 -2
- data/lib/command_parser.rb +1 -1
- data/lib/one_helper/oneacct_helper.rb +1 -1
- data/lib/one_helper/oneacl_helper.rb +1 -1
- data/lib/one_helper/onecluster_helper.rb +1 -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 +1 -1
- data/lib/one_helper/onegroup_helper.rb +1 -1
- data/lib/one_helper/onehook_helper.rb +1 -1
- data/lib/one_helper/onehost_helper.rb +1 -1
- data/lib/one_helper/oneimage_helper.rb +1 -1
- data/lib/one_helper/onemarket_helper.rb +1 -1
- data/lib/one_helper/onemarketapp_helper.rb +1 -1
- data/lib/one_helper/onequota_helper.rb +1 -1
- data/lib/one_helper/onesecgroup_helper.rb +1 -1
- data/lib/one_helper/onetemplate_helper.rb +1 -1
- data/lib/one_helper/oneuser_helper.rb +1 -1
- data/lib/one_helper/onevcenter_helper.rb +1 -1
- data/lib/one_helper/onevdc_helper.rb +1 -1
- data/lib/one_helper/onevm_helper.rb +1 -1
- data/lib/one_helper/onevmgroup_helper.rb +1 -1
- data/lib/one_helper/onevnet_helper.rb +15 -2
- 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 +1 -1
- data/lib/one_helper.rb +2 -2
- data/share/schemas/xsd/opennebula_configuration.xsd +2 -0
- data/share/schemas/xsd/vm.xsd +13 -0
- data/share/schemas/xsd/vnet.xsd +2 -0
- data/share/schemas/xsd/vnet_pool.xsd +2 -0
- metadata +10 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f3fc9a8c3825e9063b10901a749e086a10d4025c1f1742f4954db927832ee2e
|
|
4
|
+
data.tar.gz: 2f77621f9e521f6f02f63b5d39486157004cba81c9d6ab76923720b0b4d2c9f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9dfbab37a9aa42558431c6c03386944b2bfd904256b636dbf2d5746142b5b7ecd0a4f6c7895bde791969286f5e8ba9d24caeb8d82003fd484dc3df056f0ceec
|
|
7
|
+
data.tar.gz: bb2fa551de041f71aac6b6acd38f755c65dc92ed514eb4eab54ff00df03adf905031ab487b10e03058b10fa219a47e168a028fa673025b1f5e6930ae1a53a570
|
data/bin/oneacct
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneacl
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onecluster
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onedatastore
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneflow
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -521,4 +521,27 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
521
521
|
0
|
|
522
522
|
end
|
|
523
523
|
end
|
|
524
|
+
|
|
525
|
+
###
|
|
526
|
+
|
|
527
|
+
release_desc = <<-EOT.unindent
|
|
528
|
+
Release roles of a service on hold
|
|
529
|
+
EOT
|
|
530
|
+
|
|
531
|
+
command :release, release_desc, :service_id do
|
|
532
|
+
service_id = args[0]
|
|
533
|
+
client = helper.client(options)
|
|
534
|
+
|
|
535
|
+
params = {}
|
|
536
|
+
json = Service.build_json_action('release', params)
|
|
537
|
+
|
|
538
|
+
response = client.post("#{RESOURCE_PATH}/#{service_id}/action",
|
|
539
|
+
json)
|
|
540
|
+
|
|
541
|
+
if CloudClient.is_error?(response)
|
|
542
|
+
[response.code.to_i, response.to_s]
|
|
543
|
+
else
|
|
544
|
+
0
|
|
545
|
+
end
|
|
546
|
+
end
|
|
524
547
|
end
|
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-2022, 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 #
|
data/bin/onegroup
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onehook
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onehost
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneimage
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneirb
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# -------------------------------------------------------------------------- #
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
|
+
# #
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
|
+
# not use this file except in compliance with the License. You may obtain #
|
|
8
|
+
# a copy of the License at #
|
|
9
|
+
# #
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
11
|
+
# #
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
15
|
+
# See the License for the specific language governing permissions and #
|
|
16
|
+
# limitations under the License. #
|
|
17
|
+
#--------------------------------------------------------------------------- #
|
|
18
|
+
|
|
19
|
+
ONE_LOCATION = ENV['ONE_LOCATION']
|
|
20
|
+
|
|
21
|
+
if !ONE_LOCATION
|
|
22
|
+
RUBY_LIB_LOCATION = '/usr/lib/one/ruby'
|
|
23
|
+
GEMS_LOCATION = '/usr/share/one/gems'
|
|
24
|
+
else
|
|
25
|
+
RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby'
|
|
26
|
+
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# %%RUBYGEMS_SETUP_BEGIN%%
|
|
30
|
+
if File.directory?(GEMS_LOCATION)
|
|
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
|
|
47
|
+
# %%RUBYGEMS_SETUP_END%%
|
|
48
|
+
|
|
49
|
+
$LOAD_PATH << RUBY_LIB_LOCATION
|
|
50
|
+
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
|
51
|
+
$LOAD_PATH << RUBY_LIB_LOCATION + '/oneflow/lib'
|
|
52
|
+
|
|
53
|
+
################################################################################
|
|
54
|
+
# Required libraries
|
|
55
|
+
################################################################################
|
|
56
|
+
|
|
57
|
+
require 'base64'
|
|
58
|
+
require 'csv'
|
|
59
|
+
require 'date'
|
|
60
|
+
require 'digest/md5'
|
|
61
|
+
require 'erb'
|
|
62
|
+
require 'json'
|
|
63
|
+
require 'nokogiri'
|
|
64
|
+
require 'openssl'
|
|
65
|
+
require 'ox'
|
|
66
|
+
require 'pp'
|
|
67
|
+
require 'set'
|
|
68
|
+
require 'socket'
|
|
69
|
+
require 'sqlite3'
|
|
70
|
+
require 'tempfile'
|
|
71
|
+
require 'time'
|
|
72
|
+
require 'uri'
|
|
73
|
+
require 'yaml'
|
|
74
|
+
|
|
75
|
+
require 'opennebula'
|
|
76
|
+
require 'vcenter_driver'
|
|
77
|
+
|
|
78
|
+
# Include OpenNebula to avoid having to use OpenNebula:: namespace
|
|
79
|
+
include OpenNebula
|
|
80
|
+
|
|
81
|
+
################################################################################
|
|
82
|
+
# vCenter helper functions
|
|
83
|
+
################################################################################
|
|
84
|
+
|
|
85
|
+
# Get VIClient object from host
|
|
86
|
+
#
|
|
87
|
+
# @param id [Integer] Host ID
|
|
88
|
+
def vi_client_host(id)
|
|
89
|
+
VCenterDriver::VIClient.new_from_host(id)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Get VM vCenter object
|
|
93
|
+
#
|
|
94
|
+
# @param id [Integer] VM ID
|
|
95
|
+
def vm(id)
|
|
96
|
+
one_vm = VCenterDriver::VIHelper.one_item(OpenNebula::VirtualMachine, id)
|
|
97
|
+
|
|
98
|
+
did = one_vm['DEPLOY_ID']
|
|
99
|
+
hid = one_vm.retrieve_xmlelements(
|
|
100
|
+
'HISTORY_RECORDS/HISTORY/HID'
|
|
101
|
+
).last.text.to_i
|
|
102
|
+
|
|
103
|
+
VCenterDriver::VirtualMachine.new_one(vi_client_host(hid), did, one_vm)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Get host vCenter object
|
|
107
|
+
#
|
|
108
|
+
# @param id [Integer] Host ID
|
|
109
|
+
def host(id)
|
|
110
|
+
vi_client = vi_client_host(id)
|
|
111
|
+
one_h = VCenterDriver::VIHelper.one_item(OpenNebula::Host, hid)
|
|
112
|
+
|
|
113
|
+
VCenterDriver::ClusterComputeResource.new_from_ref(
|
|
114
|
+
one_h['TEMPLATE/VCENTER_CCR_REF'],
|
|
115
|
+
vi_client
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
################################################################################
|
|
120
|
+
# Open irb session
|
|
121
|
+
################################################################################
|
|
122
|
+
|
|
123
|
+
puts '* You can use the function vi_client_host(id) to get vCenter client'
|
|
124
|
+
puts '* You can use the function vm(id) to get vCenter VM'
|
|
125
|
+
puts '* You can use the function host(id) to get vCenter host'
|
|
126
|
+
|
|
127
|
+
@client = Client.new
|
|
128
|
+
version = '>= 0'
|
|
129
|
+
|
|
130
|
+
gem 'pry', version
|
|
131
|
+
load Gem.bin_path('pry', 'pry', version)
|
data/bin/onelog
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# -------------------------------------------------------------------------- #
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
|
+
# #
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
|
+
# not use this file except in compliance with the License. You may obtain #
|
|
8
|
+
# a copy of the License at #
|
|
9
|
+
# #
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
11
|
+
# #
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
15
|
+
# See the License for the specific language governing permissions and #
|
|
16
|
+
# limitations under the License. #
|
|
17
|
+
#--------------------------------------------------------------------------- #
|
|
18
|
+
|
|
19
|
+
ONE_LOCATION = ENV['ONE_LOCATION']
|
|
20
|
+
|
|
21
|
+
if !ONE_LOCATION
|
|
22
|
+
RUBY_LIB_LOCATION = '/usr/lib/one/ruby'
|
|
23
|
+
else
|
|
24
|
+
RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby'
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
$LOAD_PATH << RUBY_LIB_LOCATION
|
|
28
|
+
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
|
29
|
+
|
|
30
|
+
# Default pager to check logs
|
|
31
|
+
DEFAULT_PAGER = 'less'
|
|
32
|
+
|
|
33
|
+
# List of OpenNebula services and the logs files
|
|
34
|
+
SERVICES = {
|
|
35
|
+
'fireedge' => { :log => 'fireedge.log', :error => 'fireedge.error' },
|
|
36
|
+
'monitor' => 'monitor.log',
|
|
37
|
+
'novnc' => 'novnc.log',
|
|
38
|
+
'oned' => 'oned.log',
|
|
39
|
+
'onehem' => { :log => 'onehem.log', :error => 'onehem.error' },
|
|
40
|
+
'sched' => 'sched.log',
|
|
41
|
+
'sunstone' => { :log => 'sunstone.log', :error => 'sunstone.error' },
|
|
42
|
+
'vcenter' => 'vcenter_monitor.log'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
require 'command_parser'
|
|
46
|
+
require 'one_helper'
|
|
47
|
+
|
|
48
|
+
CommandParser::CmdParser.new(ARGV) do
|
|
49
|
+
usage '`onelog` <command> [<args>] [<options>]'
|
|
50
|
+
version OpenNebulaHelper::ONE_VERSION
|
|
51
|
+
|
|
52
|
+
TYPE = {
|
|
53
|
+
:name => 'type',
|
|
54
|
+
:short => '-t type',
|
|
55
|
+
:large => '--type type',
|
|
56
|
+
:format => String,
|
|
57
|
+
:description => 'Log type (log/error) [default: log]'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
PAGER = {
|
|
61
|
+
:name => 'pager',
|
|
62
|
+
:short => '-p pager',
|
|
63
|
+
:large => '--pager pager',
|
|
64
|
+
:format => String,
|
|
65
|
+
:description => 'Pager to use to read logs [defaul: less]'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
PAGER_OPTS = {
|
|
69
|
+
:name => 'pager_opts',
|
|
70
|
+
:large => '--pager-opts pager_opts',
|
|
71
|
+
:format => String,
|
|
72
|
+
:description => 'Pager options'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get_desc = <<-EOT.unindent
|
|
76
|
+
Gets log from an specific OpenNebula service
|
|
77
|
+
EOT
|
|
78
|
+
|
|
79
|
+
command :get, get_desc, :service, :options => [TYPE, PAGER, PAGER_OPTS] do
|
|
80
|
+
unless SERVICES[args[0]]
|
|
81
|
+
STDERR.puts "Service '#{args[0]}' not found"
|
|
82
|
+
exit 1
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if options[:type] && !SERVICES[args[0]][options[:type].to_sym]
|
|
86
|
+
STDERR.puts "Log file type '#{options[:type]}' not found"
|
|
87
|
+
exit 1
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if (SERVICES[args[0]].is_a? Hash) && !options[:type]
|
|
91
|
+
options[:type] = :log
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
type = options[:type].to_sym
|
|
95
|
+
pager = options[:pager] || DEFAULT_PAGER
|
|
96
|
+
|
|
97
|
+
type.nil? ? file = SERVICES[args[0]] : file = SERVICES[args[0]][type]
|
|
98
|
+
|
|
99
|
+
system("#{pager} #{options[:pager_opts]} /var/log/one/#{file}")
|
|
100
|
+
end
|
|
101
|
+
end
|
data/bin/onemarket
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onemarketapp
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onesecgroup
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneshowback
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onetemplate
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/oneuser
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onevcenter
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onevdc
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onevm
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -49,6 +49,9 @@ end
|
|
|
49
49
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
|
50
50
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
|
51
51
|
|
|
52
|
+
# Default VNC viewer
|
|
53
|
+
DEFAULT_VNC = 'vinagre'
|
|
54
|
+
|
|
52
55
|
require 'command_parser'
|
|
53
56
|
require 'one_helper/onevm_helper'
|
|
54
57
|
require 'one_helper/onedatastore_helper'
|
|
@@ -239,6 +242,13 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
239
242
|
:description => 'SSH options to use'
|
|
240
243
|
}
|
|
241
244
|
|
|
245
|
+
VNC = {
|
|
246
|
+
:name => 'vnc',
|
|
247
|
+
:large => '--vnc vnc',
|
|
248
|
+
:format => String,
|
|
249
|
+
:description => 'VNC client to use'
|
|
250
|
+
}
|
|
251
|
+
|
|
242
252
|
OpenNebulaHelper::TEMPLATE_OPTIONS_VM.delete_if do |v|
|
|
243
253
|
%w[as_gid as_uid].include?(v[:name])
|
|
244
254
|
end
|
|
@@ -913,6 +923,36 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
913
923
|
end
|
|
914
924
|
end
|
|
915
925
|
|
|
926
|
+
sg_attach_desc = <<-EOT.unindent
|
|
927
|
+
Attaches a Security Group to a VM.
|
|
928
|
+
|
|
929
|
+
States: All, except BOOT, MIGRATE and HOTPLUG_NIC
|
|
930
|
+
EOT
|
|
931
|
+
|
|
932
|
+
command :"sg-attach", sg_attach_desc, :vmid, :nicid, :sgid do
|
|
933
|
+
nic_id = args[1].to_i
|
|
934
|
+
sg_id = args[2].to_i
|
|
935
|
+
|
|
936
|
+
helper.perform_action(args[0], options, 'Attach SG') do |vm|
|
|
937
|
+
vm.sg_attach(nic_id, sg_id)
|
|
938
|
+
end
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
sg_detach_desc = <<-EOT.unindent
|
|
942
|
+
Detaches a Security Group from a VM.
|
|
943
|
+
|
|
944
|
+
States: All, except BOOT, MIGRATE and HOTPLUG_NIC
|
|
945
|
+
EOT
|
|
946
|
+
|
|
947
|
+
command :"sg-detach", sg_detach_desc, :vmid, :nicid, :sgid do
|
|
948
|
+
nic_id = args[1].to_i
|
|
949
|
+
sg_id = args[2].to_i
|
|
950
|
+
|
|
951
|
+
helper.perform_action(args[0], options, 'Detach SG') do |vm|
|
|
952
|
+
vm.sg_detach(nic_id, sg_id)
|
|
953
|
+
end
|
|
954
|
+
end
|
|
955
|
+
|
|
916
956
|
chgrp_desc = <<-EOT.unindent
|
|
917
957
|
Changes the VM group
|
|
918
958
|
EOT
|
|
@@ -1636,6 +1676,30 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
1636
1676
|
end
|
|
1637
1677
|
end
|
|
1638
1678
|
|
|
1679
|
+
connect_desc = <<-EOT.unindent
|
|
1680
|
+
Opens a VNC session to the VM
|
|
1681
|
+
EOT
|
|
1682
|
+
|
|
1683
|
+
command :vnc, connect_desc, :vmid, :options => [VNC] do
|
|
1684
|
+
helper.perform_action(args[0], options, 'VNC') do |vm|
|
|
1685
|
+
rc = vm.info
|
|
1686
|
+
|
|
1687
|
+
if OpenNebula.is_error?(rc)
|
|
1688
|
+
STDERR.puts rc.message
|
|
1689
|
+
exit(1)
|
|
1690
|
+
end
|
|
1691
|
+
|
|
1692
|
+
host = vm['HISTORY_RECORDS/HISTORY[last()]/HOSTNAME']
|
|
1693
|
+
port = vm['TEMPLATE/GRAPHICS/PORT']
|
|
1694
|
+
|
|
1695
|
+
vncviewer = options['vnc'] || DEFAULT_VNC
|
|
1696
|
+
|
|
1697
|
+
cmd = [vncviewer, "#{host}::#{port}"]
|
|
1698
|
+
|
|
1699
|
+
exec(*cmd)
|
|
1700
|
+
end
|
|
1701
|
+
end
|
|
1702
|
+
|
|
1639
1703
|
# Deprecated commands
|
|
1640
1704
|
|
|
1641
1705
|
deprecated_command(:shutdown, 'terminate')
|
data/bin/onevmgroup
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onevnet
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -94,6 +94,26 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
94
94
|
'bypass the consistency checks'
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
SUCCESS = {
|
|
98
|
+
:name => 'success',
|
|
99
|
+
:large => '--success',
|
|
100
|
+
:description => 'Recover a Virtual Network by succeeding ' \
|
|
101
|
+
'the pending action'
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
FAILURE = {
|
|
105
|
+
:name => 'failure',
|
|
106
|
+
:large => '--failure',
|
|
107
|
+
:description => 'Recover a Virtual Network by failing ' \
|
|
108
|
+
'the pending action'
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
DELETE = {
|
|
112
|
+
:name => 'delete',
|
|
113
|
+
:large => '--delete',
|
|
114
|
+
:description => 'No recover action possible, delete the Virtual Network'
|
|
115
|
+
}
|
|
116
|
+
|
|
97
117
|
########################################################################
|
|
98
118
|
# Global Options
|
|
99
119
|
########################################################################
|
|
@@ -428,4 +448,41 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
428
448
|
|
|
429
449
|
return 0
|
|
430
450
|
end
|
|
451
|
+
|
|
452
|
+
recover_desc = <<-EOT.unindent
|
|
453
|
+
Recovers a Virtual Network in ERROR state or waiting for a driver operation
|
|
454
|
+
to complete.
|
|
455
|
+
The recovery may be done by failing, succeeding or retrying the current operation.
|
|
456
|
+
YOU NEED TO MANUALLY CHECK THE VN STATUS, to decide if the
|
|
457
|
+
operation was successful or not, or if it can be retried.
|
|
458
|
+
|
|
459
|
+
States for success/failure recovers: LOCK_CREATE, LOCK_DELETE state.
|
|
460
|
+
States for a retry recover: LOCK_CREATE, LOCK_DELETE state
|
|
461
|
+
States for delete: Any but READY
|
|
462
|
+
EOT
|
|
463
|
+
|
|
464
|
+
command :recover, recover_desc, [:range, :vmid_list],
|
|
465
|
+
:options => [SUCCESS, FAILURE, DELETE] do
|
|
466
|
+
if !options[:success].nil?
|
|
467
|
+
result = 1
|
|
468
|
+
elsif !options[:failure].nil?
|
|
469
|
+
result = 0
|
|
470
|
+
elsif !options[:delete].nil?
|
|
471
|
+
result = 2
|
|
472
|
+
else
|
|
473
|
+
error_message = <<-EOT.unindent
|
|
474
|
+
Need to specify the result of the pending action.
|
|
475
|
+
\t--success recover the VN by succeeding the missing action.
|
|
476
|
+
\t--failure recover the VN by failing the missing action.
|
|
477
|
+
\t--delete no recover possible, delete the VN.
|
|
478
|
+
EOT
|
|
479
|
+
|
|
480
|
+
STDERR.puts error_message
|
|
481
|
+
exit(-1)
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
helper.perform_actions(args[0], options, 'recovering') do |vn|
|
|
485
|
+
vn.recover(result)
|
|
486
|
+
end
|
|
487
|
+
end
|
|
431
488
|
end
|
data/bin/onevntemplate
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onevrouter
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/bin/onezone
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, 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 #
|
data/lib/cli_helper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -188,9 +188,17 @@ module CLIHelper
|
|
|
188
188
|
error
|
|
189
189
|
ERROR
|
|
190
190
|
FAILED_DEPLOYING
|
|
191
|
+
FAILED_DEPLOYING_NETS
|
|
191
192
|
FAILED_UNDEPLOYING
|
|
193
|
+
FAILED_UNDEPLOYING_NETS
|
|
192
194
|
FAILED_SCALING]
|
|
193
|
-
REGULAR_STATES = %w[PENDING
|
|
195
|
+
REGULAR_STATES = %w[PENDING
|
|
196
|
+
DEPLOYING
|
|
197
|
+
DEPLOYING_NETS
|
|
198
|
+
UNDEPLOYING
|
|
199
|
+
UNDEPLOYING_NETS
|
|
200
|
+
CONFIGURING
|
|
201
|
+
WARNING]
|
|
194
202
|
|
|
195
203
|
# Set state color
|
|
196
204
|
#
|
data/lib/command_parser.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -138,6 +138,12 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
|
|
|
138
138
|
'onevnet.yaml'
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
+
def self.state_to_str(id)
|
|
142
|
+
id = id.to_i
|
|
143
|
+
state_str = VirtualNetwork::VN_STATES[id]
|
|
144
|
+
VirtualNetwork::SHORT_VN_STATES[state_str]
|
|
145
|
+
end
|
|
146
|
+
|
|
141
147
|
def format_pool(options)
|
|
142
148
|
config_file = self.class.table_conf
|
|
143
149
|
|
|
@@ -170,12 +176,18 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
|
|
|
170
176
|
d['BRIDGE']
|
|
171
177
|
end
|
|
172
178
|
|
|
179
|
+
column :STATE, 'State of the Virtual Network', :left,
|
|
180
|
+
:size=>6 do |d|
|
|
181
|
+
OneVNetHelper.state_to_str(d['STATE'])
|
|
182
|
+
end
|
|
183
|
+
|
|
173
184
|
column :LEASES, "Number of this Virtual Network's given leases",
|
|
174
185
|
:size=>6 do |d|
|
|
175
186
|
d['USED_LEASES']
|
|
176
187
|
end
|
|
177
188
|
|
|
178
|
-
default :ID, :USER, :GROUP, :NAME, :CLUSTERS, :BRIDGE, :
|
|
189
|
+
default :ID, :USER, :GROUP, :NAME, :CLUSTERS, :BRIDGE, :STATE,
|
|
190
|
+
:LEASES
|
|
179
191
|
end
|
|
180
192
|
end
|
|
181
193
|
|
|
@@ -315,6 +327,7 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
|
|
|
315
327
|
vn.retrieve_elements('CLUSTERS/ID')
|
|
316
328
|
))
|
|
317
329
|
puts format(str, 'BRIDGE', vn['BRIDGE'])
|
|
330
|
+
puts format(str, 'STATE', vn.state_str)
|
|
318
331
|
puts format(str, 'VN_MAD', vn['VN_MAD']) unless vn['VN_MAD'].empty?
|
|
319
332
|
puts format(str, 'PHYSICAL DEVICE',
|
|
320
333
|
vn['PHYDEV']) unless vn['PHYDEV'].empty?
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
data/lib/one_helper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
|
@@ -30,7 +30,7 @@ include OpenNebula
|
|
|
30
30
|
module OpenNebulaHelper
|
|
31
31
|
ONE_VERSION=<<-EOT
|
|
32
32
|
OpenNebula #{OpenNebula::VERSION}
|
|
33
|
-
Copyright 2002-
|
|
33
|
+
Copyright 2002-2022, OpenNebula Project, OpenNebula Systems
|
|
34
34
|
EOT
|
|
35
35
|
|
|
36
36
|
if ONE_LOCATION
|
|
@@ -204,6 +204,7 @@
|
|
|
204
204
|
<xs:all>
|
|
205
205
|
<xs:element name="DEBUG_LEVEL" type="xs:integer"/>
|
|
206
206
|
<xs:element name="SYSTEM" type="xs:string"/>
|
|
207
|
+
<xs:element name="USE_VMS_LOCATION" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
207
208
|
</xs:all>
|
|
208
209
|
</xs:complexType>
|
|
209
210
|
</xs:element>
|
|
@@ -367,6 +368,7 @@
|
|
|
367
368
|
<xs:element name="VM_MANAGE_OPERATIONS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
368
369
|
<xs:element name="VM_MONITORING_EXPIRATION_TIME" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
|
369
370
|
<xs:element name="VM_RESTRICTED_ATTR" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
|
371
|
+
<xs:element name="VM_SNAPSHOT_FACTOR" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
370
372
|
|
|
371
373
|
<xs:element name="VM_SUBMIT_ON_HOLD" minOccurs="0" maxOccurs="1">
|
|
372
374
|
<xs:simpleType>
|
data/share/schemas/xsd/vm.xsd
CHANGED
|
@@ -166,6 +166,19 @@
|
|
|
166
166
|
</xs:complexType>
|
|
167
167
|
</xs:element>
|
|
168
168
|
<xs:element name="SECURITY_GROUP_RULE" minOccurs="0" maxOccurs="unbounded"/>
|
|
169
|
+
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
|
|
170
|
+
<xs:complexType>
|
|
171
|
+
<xs:sequence>
|
|
172
|
+
<xs:element name="ACTION" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
173
|
+
<xs:element name="ACTIVE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
174
|
+
<xs:element name="HYPERVISOR_ID" type="xs:string"/>
|
|
175
|
+
<xs:element name="NAME" type="xs:string"/>
|
|
176
|
+
<xs:element name="SNAPSHOT_ID" type="xs:string"/>
|
|
177
|
+
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
|
|
178
|
+
<xs:element name="TIME" type="xs:string"/>
|
|
179
|
+
</xs:sequence>
|
|
180
|
+
</xs:complexType>
|
|
181
|
+
</xs:element>
|
|
169
182
|
<xs:element name="SPICE_OPTIONS" minOccurs="0" maxOccurs="1"/>
|
|
170
183
|
<xs:element name="SUBMIT_ON_HOLD" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
|
171
184
|
<xs:element name="TEMPLATE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
data/share/schemas/xsd/vnet.xsd
CHANGED
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
</xs:element>
|
|
45
45
|
<xs:element name="BRIDGE" type="xs:string"/>
|
|
46
46
|
<xs:element name="BRIDGE_TYPE" type="xs:string" minOccurs="0"/>
|
|
47
|
+
<xs:element name="STATE" type="xs:integer"/>
|
|
48
|
+
<xs:element name="PREV_STATE" type="xs:integer"/>
|
|
47
49
|
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
|
|
48
50
|
<xs:element name="VN_MAD" type="xs:string"/>
|
|
49
51
|
<xs:element name="PHYDEV" type="xs:string"/>
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
</xs:element>
|
|
39
39
|
<xs:element name="BRIDGE" type="xs:string"/>
|
|
40
40
|
<xs:element name="BRIDGE_TYPE" type="xs:string" minOccurs="0"/>
|
|
41
|
+
<xs:element name="STATE" type="xs:integer"/>
|
|
42
|
+
<xs:element name="PREV_STATE" type="xs:integer"/>
|
|
41
43
|
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
|
|
42
44
|
<xs:element name="VN_MAD" type="xs:string"/>
|
|
43
45
|
<xs:element name="PHYDEV" type="xs:string"/>
|
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: 6.
|
|
4
|
+
version: 6.3.90.pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenNebula
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-04-28 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: 6.
|
|
19
|
+
version: 6.3.90.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: 6.
|
|
26
|
+
version: 6.3.90.pre
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -50,6 +50,7 @@ executables:
|
|
|
50
50
|
- onehook
|
|
51
51
|
- onevdc
|
|
52
52
|
- oneacl
|
|
53
|
+
- oneirb
|
|
53
54
|
- oneflow-template
|
|
54
55
|
- onevrouter
|
|
55
56
|
- oneshowback
|
|
@@ -57,6 +58,7 @@ executables:
|
|
|
57
58
|
- oneacct
|
|
58
59
|
- onesecgroup
|
|
59
60
|
- onecluster
|
|
61
|
+
- onelog
|
|
60
62
|
- onemarketapp
|
|
61
63
|
- onetemplate
|
|
62
64
|
- onemarket
|
|
@@ -80,6 +82,8 @@ files:
|
|
|
80
82
|
- bin/onehook
|
|
81
83
|
- bin/onehost
|
|
82
84
|
- bin/oneimage
|
|
85
|
+
- bin/oneirb
|
|
86
|
+
- bin/onelog
|
|
83
87
|
- bin/onemarket
|
|
84
88
|
- bin/onemarketapp
|
|
85
89
|
- bin/onesecgroup
|
|
@@ -185,9 +189,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
185
189
|
version: '0'
|
|
186
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
191
|
requirements:
|
|
188
|
-
- - "
|
|
192
|
+
- - ">"
|
|
189
193
|
- !ruby/object:Gem::Version
|
|
190
|
-
version:
|
|
194
|
+
version: 1.3.1
|
|
191
195
|
requirements: []
|
|
192
196
|
rubygems_version: 3.1.2
|
|
193
197
|
signing_key:
|