opennebula 5.12.13 → 5.13.80.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 +5 -5
- data/lib/ActionManager.rb +1 -1
- data/lib/CommandManager.rb +1 -1
- data/lib/DriverExecHelper.rb +44 -28
- data/lib/OpenNebulaDriver.rb +8 -4
- data/lib/VirtualMachineDriver.rb +9 -2
- data/lib/cloud/CloudClient.rb +3 -3
- data/lib/datacenter.rb +1258 -0
- data/lib/datastore.rb +1025 -0
- data/lib/distributed_firewall.rb +280 -0
- data/lib/file_helper.rb +370 -0
- data/lib/host.rb +1517 -0
- data/lib/logical_port.rb +50 -0
- data/lib/logical_switch.rb +77 -0
- data/lib/memoize.rb +74 -0
- data/lib/models/role.rb +39 -8
- data/lib/models/service.rb +92 -31
- data/lib/models.rb +5 -5
- data/lib/network.rb +635 -0
- data/lib/nsx_client.rb +144 -0
- data/lib/nsx_component.rb +28 -0
- data/lib/nsx_constants.rb +149 -0
- data/lib/nsx_driver.rb +78 -0
- data/lib/nsx_error.rb +77 -0
- data/lib/nsx_rule.rb +193 -0
- data/lib/nsxt_client.rb +176 -0
- data/lib/nsxt_dfw.rb +196 -0
- data/lib/nsxt_logical_port.rb +94 -0
- data/lib/nsxt_rule.rb +188 -0
- data/lib/nsxt_tz.rb +38 -0
- data/lib/nsxv_client.rb +176 -0
- data/lib/nsxv_dfw.rb +202 -0
- data/lib/nsxv_logical_port.rb +107 -0
- data/lib/nsxv_rule.rb +172 -0
- data/lib/nsxv_tz.rb +41 -0
- data/lib/opaque_network.rb +134 -0
- data/lib/opennebula/acl.rb +1 -1
- data/lib/opennebula/acl_pool.rb +1 -1
- data/lib/opennebula/client.rb +1 -1
- data/lib/opennebula/cluster.rb +1 -1
- data/lib/opennebula/cluster_pool.rb +1 -1
- data/lib/opennebula/datastore.rb +1 -1
- data/lib/opennebula/datastore_pool.rb +1 -1
- data/lib/opennebula/document.rb +8 -29
- data/lib/opennebula/document_json.rb +42 -12
- data/lib/opennebula/document_pool.rb +1 -1
- data/lib/opennebula/document_pool_json.rb +1 -1
- data/lib/opennebula/error.rb +4 -1
- data/lib/opennebula/flow/grammar.rb +1195 -0
- data/lib/{models → opennebula/flow}/service_pool.rb +26 -2
- data/lib/{models → opennebula/flow}/service_template.rb +86 -17
- data/lib/opennebula/flow/service_template_ext.rb +84 -0
- data/lib/{models → opennebula/flow}/service_template_pool.rb +1 -1
- data/lib/opennebula/flow/validator.rb +499 -0
- data/lib/opennebula/flow.rb +23 -0
- data/lib/opennebula/group.rb +1 -1
- data/lib/opennebula/group_pool.rb +1 -1
- data/lib/opennebula/hook.rb +5 -12
- data/lib/opennebula/hook_log.rb +1 -1
- data/lib/opennebula/hook_pool.rb +1 -1
- data/lib/opennebula/host.rb +1 -1
- data/lib/opennebula/host_pool.rb +1 -1
- data/lib/opennebula/image.rb +17 -14
- data/lib/opennebula/image_pool.rb +1 -1
- data/lib/opennebula/ldap_auth.rb +1 -1
- data/lib/opennebula/ldap_auth_spec.rb +1 -1
- data/lib/opennebula/lockable_ext.rb +163 -0
- data/lib/opennebula/marketplace.rb +1 -1
- data/lib/opennebula/marketplace_pool.rb +1 -1
- data/lib/opennebula/marketplaceapp.rb +9 -119
- data/lib/opennebula/marketplaceapp_ext.rb +522 -0
- data/lib/opennebula/marketplaceapp_pool.rb +1 -1
- data/lib/opennebula/oneflow_client.rb +4 -3
- data/lib/opennebula/pool.rb +4 -3
- data/lib/opennebula/pool_element.rb +1 -1
- data/lib/opennebula/security_group.rb +1 -1
- data/lib/opennebula/security_group_pool.rb +1 -1
- data/lib/opennebula/server_cipher_auth.rb +1 -1
- data/lib/opennebula/server_x509_auth.rb +1 -1
- data/lib/opennebula/ssh_auth.rb +1 -1
- data/lib/opennebula/system.rb +1 -1
- data/lib/opennebula/template.rb +4 -13
- data/lib/opennebula/template_ext.rb +325 -0
- data/lib/opennebula/template_pool.rb +1 -1
- data/lib/opennebula/user.rb +26 -2
- data/lib/opennebula/user_pool.rb +1 -1
- data/lib/opennebula/utils.rb +1 -1
- data/lib/opennebula/vdc.rb +1 -1
- data/lib/opennebula/vdc_pool.rb +1 -1
- data/lib/opennebula/virtual_machine.rb +25 -207
- data/lib/opennebula/virtual_machine_ext.rb +469 -0
- data/lib/opennebula/virtual_machine_pool.rb +1 -5
- data/lib/opennebula/virtual_network.rb +4 -10
- data/lib/opennebula/virtual_network_pool.rb +1 -1
- data/lib/opennebula/virtual_router.rb +4 -12
- data/lib/opennebula/virtual_router_pool.rb +1 -1
- data/lib/opennebula/vm_group.rb +4 -11
- data/lib/opennebula/vm_group_pool.rb +1 -1
- data/lib/opennebula/vntemplate.rb +4 -13
- data/lib/opennebula/vntemplate_pool.rb +1 -1
- data/lib/opennebula/wait_ext.rb +222 -0
- data/lib/opennebula/x509_auth.rb +1 -1
- data/lib/opennebula/xml_element.rb +1 -1
- data/lib/opennebula/xml_pool.rb +1 -1
- data/lib/opennebula/xml_utils.rb +1 -1
- data/lib/opennebula/zone.rb +1 -1
- data/lib/opennebula/zone_pool.rb +1 -1
- data/lib/opennebula.rb +5 -2
- data/lib/rest_client.rb +201 -0
- data/lib/scripts_common.rb +180 -0
- data/lib/transport_zone.rb +43 -0
- data/lib/vcenter_driver.rb +9 -22
- data/lib/vcenter_importer.rb +616 -0
- data/lib/vi_client.rb +281 -0
- data/lib/vi_helper.rb +312 -0
- data/lib/virtual_machine.rb +3477 -0
- data/lib/virtual_wire.rb +158 -0
- data/lib/vm_device.rb +80 -0
- data/lib/vm_disk.rb +202 -0
- data/lib/vm_folder.rb +69 -0
- data/lib/vm_helper.rb +30 -0
- data/lib/vm_monitor.rb +303 -0
- data/lib/vm_nic.rb +70 -0
- data/lib/vm_template.rb +1961 -0
- data/lib/vmm_importer.rb +121 -0
- metadata +101 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: cc16996ef3b6218367420d87066688a52ee86042
|
|
4
|
+
data.tar.gz: dae462f84f7ec7bfed459506c56981be1e27974e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6a40c0cbf0a2125a07d18348d0d13471562d81581c06318126a7d671025bdcf34a30c5228af30bd37014af65329714ada099de91fcde70db29198b2731c0fc8
|
|
7
|
+
data.tar.gz: 4a53d311862746b7712066d355120306a5b3d4311315dabf24513f5e20dc509acb4254e5d58556090b768f3aa33e89df2311c10127d87c918f7c0befe2b6c8a1
|
data/lib/ActionManager.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- */
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
|
4
4
|
# not use this file except in compliance with the License. You may obtain */
|
|
5
5
|
# a copy of the License at */
|
data/lib/CommandManager.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# --------------------------------------------------------------------------
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2021, 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/DriverExecHelper.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
# rubocop:disable Naming/FileName
|
|
1
2
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
3
|
+
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
|
|
3
4
|
# #
|
|
4
5
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
5
6
|
# not use this file except in compliance with the License. You may obtain #
|
|
@@ -18,14 +19,15 @@
|
|
|
18
19
|
# OpenNebula Drivers. The module has been designed to be included as part
|
|
19
20
|
# of a driver and not to be used standalone.
|
|
20
21
|
module DriverExecHelper
|
|
22
|
+
|
|
21
23
|
# Action result strings for messages
|
|
22
24
|
RESULT = {
|
|
23
|
-
:success =>
|
|
24
|
-
:failure =>
|
|
25
|
+
:success => 'SUCCESS',
|
|
26
|
+
:failure => 'FAILURE'
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
def self.failed?(rc_str)
|
|
28
|
-
|
|
30
|
+
rc_str == RESULT[:failure]
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
# Initialize module variables
|
|
@@ -34,6 +36,7 @@ module DriverExecHelper
|
|
|
34
36
|
@remote_scripts_base_path = @config['SCRIPTS_REMOTE_DIR']
|
|
35
37
|
|
|
36
38
|
@local_actions = options[:local_actions]
|
|
39
|
+
@per_drvr_local_actions = options[:per_drvr_local_actions] || []
|
|
37
40
|
|
|
38
41
|
if ENV['ONE_LOCATION'].nil?
|
|
39
42
|
@local_scripts_base_path = '/var/lib/one/remotes'
|
|
@@ -57,62 +60,74 @@ module DriverExecHelper
|
|
|
57
60
|
# actions is remote or local. If the local actions has defined an special
|
|
58
61
|
# script name this is used, otherwise the action name in downcase is
|
|
59
62
|
# used as the script name.
|
|
63
|
+
# When action is a String starting with '/' it's considered alreay full
|
|
64
|
+
# path command and no modification is performed apart from adding params.
|
|
60
65
|
#
|
|
61
66
|
# @param [String, Symbol] action name of the action
|
|
62
67
|
# @param [String] parameters arguments for the script
|
|
63
68
|
# @param [String, nil] default_name alternative name for the script
|
|
64
69
|
# @param [String, ''] directory to append to the scripts path for actions
|
|
65
70
|
# @return [String] command line needed to execute the action
|
|
66
|
-
def action_command_line(action, parameters,
|
|
67
|
-
|
|
71
|
+
def action_command_line(action, parameters,
|
|
72
|
+
default_name = nil, directory = '')
|
|
73
|
+
|
|
74
|
+
if action.is_a?(String) && action[0] == '/'
|
|
75
|
+
return action + ' ' + parameters if parameters
|
|
76
|
+
|
|
77
|
+
return action
|
|
78
|
+
elsif action_is_local?(action, directory)
|
|
68
79
|
script_path=File.join(@local_scripts_path, directory)
|
|
69
80
|
else
|
|
70
81
|
script_path=File.join(@remote_scripts_path, directory)
|
|
71
82
|
end
|
|
72
83
|
|
|
73
84
|
File.join(script_path, action_script_name(action, default_name))+
|
|
74
|
-
|
|
85
|
+
' '+parameters
|
|
75
86
|
end
|
|
76
87
|
|
|
77
88
|
# True if the action is meant to be executed locally
|
|
78
89
|
#
|
|
79
90
|
# @param [String, Symbol] action name of the action
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
# @param [String, Symbol] driver name
|
|
92
|
+
def action_is_local?(action, driver = '')
|
|
93
|
+
@local_actions.include? action.to_s.upcase if driver.empty?
|
|
94
|
+
|
|
95
|
+
@local_actions.include? action.to_s.upcase or
|
|
96
|
+
@per_drvr_local_actions.include? "#{driver}-#{action}"
|
|
82
97
|
end
|
|
83
98
|
|
|
84
99
|
# Name of the script file for the given action
|
|
85
100
|
#
|
|
86
101
|
# @param [String, Symbol] action name of the action
|
|
87
102
|
# @param [String, nil] default_name alternative name for the script
|
|
88
|
-
def action_script_name(action, default_name=nil)
|
|
103
|
+
def action_script_name(action, default_name = nil)
|
|
89
104
|
name=@local_actions[action.to_s.upcase]
|
|
90
105
|
|
|
91
|
-
|
|
92
|
-
name
|
|
93
|
-
else
|
|
94
|
-
default_name || action.to_s.downcase
|
|
95
|
-
end
|
|
106
|
+
name || default_name || action.to_s.downcase
|
|
96
107
|
end
|
|
97
108
|
|
|
98
109
|
#
|
|
99
110
|
# METHODS FOR LOGS & COMMAND OUTPUT
|
|
100
111
|
#
|
|
101
112
|
# Sends a message to the OpenNebula core through stdout
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
# rubocop:disable Metrics/ParameterLists
|
|
114
|
+
def send_message(action = '-', result = RESULT[:failure],
|
|
115
|
+
id = '-', info = '-')
|
|
116
|
+
|
|
117
|
+
@send_mutex.synchronize do
|
|
104
118
|
STDOUT.puts "#{action} #{result} #{id} #{info}"
|
|
105
119
|
STDOUT.flush
|
|
106
|
-
|
|
120
|
+
end
|
|
107
121
|
end
|
|
122
|
+
# rubocop:enable Metrics/ParameterLists
|
|
108
123
|
|
|
109
124
|
# Sends a log message to ONE. The +message+ can be multiline, it will
|
|
110
125
|
# be automatically splitted by lines.
|
|
111
|
-
def log(number, message, all=true)
|
|
126
|
+
def log(number, message, all = true)
|
|
112
127
|
in_error_message=false
|
|
113
128
|
msg=message.strip
|
|
114
|
-
msg.each_line
|
|
115
|
-
|
|
129
|
+
msg.each_line do |line|
|
|
130
|
+
all ? severity='I' : severity=nil
|
|
116
131
|
l=line.strip
|
|
117
132
|
|
|
118
133
|
if l=='ERROR MESSAGE --8<------'
|
|
@@ -125,8 +140,8 @@ module DriverExecHelper
|
|
|
125
140
|
if in_error_message
|
|
126
141
|
severity='E'
|
|
127
142
|
elsif line.match(/^(ERROR|DEBUG|INFO):(.*)$/)
|
|
128
|
-
line
|
|
129
|
-
case
|
|
143
|
+
line=Regexp.last_match(2)
|
|
144
|
+
case Regexp.last_match(1)
|
|
130
145
|
when 'ERROR'
|
|
131
146
|
severity='E'
|
|
132
147
|
when 'DEBUG'
|
|
@@ -137,19 +152,19 @@ module DriverExecHelper
|
|
|
137
152
|
end
|
|
138
153
|
end
|
|
139
154
|
|
|
140
|
-
send_message(
|
|
141
|
-
|
|
155
|
+
send_message('LOG', severity, number, line.strip) if severity
|
|
156
|
+
end
|
|
142
157
|
end
|
|
143
158
|
|
|
144
159
|
# Generates a proc with that calls log with a hardcoded number. It will
|
|
145
160
|
# be used to add loging to command actions
|
|
146
161
|
def log_method(num)
|
|
147
|
-
lambda {|message, all=true|
|
|
162
|
+
lambda {|message, all = true|
|
|
148
163
|
log(num, message, all)
|
|
149
164
|
}
|
|
150
165
|
end
|
|
151
166
|
|
|
152
|
-
#This method returns the result in terms
|
|
167
|
+
# This method returns the result in terms
|
|
153
168
|
def get_info_from_execution(command_exe)
|
|
154
169
|
if command_exe.code == 0
|
|
155
170
|
result = RESULT[:success]
|
|
@@ -159,7 +174,7 @@ module DriverExecHelper
|
|
|
159
174
|
info = command_exe.get_error_message
|
|
160
175
|
end
|
|
161
176
|
|
|
162
|
-
info =
|
|
177
|
+
info = '-' if info.nil? || info.empty?
|
|
163
178
|
|
|
164
179
|
[result, info]
|
|
165
180
|
end
|
|
@@ -211,3 +226,4 @@ module DriverExecHelper
|
|
|
211
226
|
end
|
|
212
227
|
|
|
213
228
|
end
|
|
229
|
+
# rubocop:enable Naming/FileName
|
data/lib/OpenNebulaDriver.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2021, 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 #
|
|
@@ -90,13 +90,17 @@ class OpenNebulaDriver < ActionManager
|
|
|
90
90
|
:respond => true,
|
|
91
91
|
:ssh_stream => nil,
|
|
92
92
|
:base64 => false,
|
|
93
|
-
:zip => false
|
|
93
|
+
:zip => false,
|
|
94
|
+
:no_extra_params => false
|
|
94
95
|
}.merge(ops)
|
|
95
96
|
|
|
96
|
-
params
|
|
97
|
+
params = parameters
|
|
98
|
+
params = "#{params} #{id} #{host}" unless options[:no_extra_params]
|
|
97
99
|
command = action_command_line(aname, params, options[:script_name])
|
|
98
100
|
|
|
99
|
-
if
|
|
101
|
+
# if options[:is_local] is not specified (nil)
|
|
102
|
+
# we rely uniquely in actions_is_local?
|
|
103
|
+
if action_is_local?(aname) or options[:is_local]
|
|
100
104
|
stdin = Base64.strict_encode64(options[:stdin].to_s)
|
|
101
105
|
execution = LocalCommand.run(command,
|
|
102
106
|
log_method(id),
|
data/lib/VirtualMachineDriver.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2021, 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 #
|
|
@@ -52,7 +52,8 @@ class VirtualMachineDriver < OpenNebulaDriver
|
|
|
52
52
|
:disk_snapshot_create => "DISKSNAPSHOTCREATE",
|
|
53
53
|
:resize_disk => "RESIZEDISK",
|
|
54
54
|
:update_sg => "UPDATESG",
|
|
55
|
-
:update_conf => "UPDATECONF"
|
|
55
|
+
:update_conf => "UPDATECONF",
|
|
56
|
+
:resize => "RESIZE"
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
POLL_ATTRIBUTE = OpenNebula::VirtualMachine::Driver::POLL_ATTRIBUTE
|
|
@@ -98,6 +99,7 @@ class VirtualMachineDriver < OpenNebulaDriver
|
|
|
98
99
|
register_action(ACTION[:resize_disk].to_sym, method("resize_disk"))
|
|
99
100
|
register_action(ACTION[:update_sg].to_sym, method("update_sg"))
|
|
100
101
|
register_action(ACTION[:update_conf].to_sym, method("update_conf"))
|
|
102
|
+
register_action(ACTION[:resize].to_sym, method("resize"))
|
|
101
103
|
end
|
|
102
104
|
|
|
103
105
|
# Decodes the encoded XML driver message received from the core
|
|
@@ -227,6 +229,11 @@ class VirtualMachineDriver < OpenNebulaDriver
|
|
|
227
229
|
send_message(ACTION[:update_conf],RESULT[:failure],id,error)
|
|
228
230
|
end
|
|
229
231
|
|
|
232
|
+
def resize(id, drv_message)
|
|
233
|
+
error = "Action not implemented by driver #{self.class}"
|
|
234
|
+
send_message(ACTION[:resize],RESULT[:failure],id,error)
|
|
235
|
+
end
|
|
236
|
+
|
|
230
237
|
private
|
|
231
238
|
|
|
232
239
|
# Interface to handle the pending events from the ActionManager Interface
|
data/lib/cloud/CloudClient.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2021, 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 #
|
|
@@ -51,7 +51,7 @@ end
|
|
|
51
51
|
module CloudClient
|
|
52
52
|
|
|
53
53
|
# OpenNebula version
|
|
54
|
-
VERSION = '5.
|
|
54
|
+
VERSION = '5.13.80'
|
|
55
55
|
|
|
56
56
|
# #########################################################################
|
|
57
57
|
# Default location for the authentication file
|
|
@@ -229,7 +229,7 @@ module CloudCLI
|
|
|
229
229
|
def version_text
|
|
230
230
|
version=<<EOT
|
|
231
231
|
OpenNebula #{CloudClient::VERSION}
|
|
232
|
-
Copyright 2002-
|
|
232
|
+
Copyright 2002-2021, OpenNebula Project, OpenNebula Systems
|
|
233
233
|
|
|
234
234
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
235
235
|
not use this file except in compliance with the License. You may obtain
|