opennebula 6.10.3 → 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/lib/cloud/CloudClient.rb +3 -3
- data/lib/models/role.rb +349 -823
- data/lib/models/service.rb +156 -80
- data/lib/models/vmrole.rb +703 -0
- data/lib/models/vrrole.rb +284 -0
- data/lib/models.rb +3 -1
- data/lib/opennebula/acl.rb +1 -1
- data/lib/opennebula/acl_pool.rb +1 -1
- data/lib/opennebula/backupjob.rb +1 -1
- data/lib/opennebula/backupjob_pool.rb +1 -1
- data/lib/opennebula/client.rb +1 -1
- data/lib/opennebula/cluster.rb +45 -2
- 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 +1 -1
- data/lib/opennebula/document_json.rb +1 -1
- data/lib/opennebula/document_pool.rb +1 -1
- data/lib/opennebula/document_pool_json.rb +1 -1
- data/lib/opennebula/error.rb +1 -1
- data/lib/opennebula/flow/grammar.rb +1 -1
- data/lib/opennebula/flow/service_pool.rb +1 -1
- data/lib/opennebula/flow/service_template.rb +353 -97
- data/lib/opennebula/flow/service_template_ext.rb +3 -3
- data/lib/opennebula/flow/service_template_pool.rb +1 -1
- data/lib/opennebula/flow/validator.rb +458 -410
- data/lib/opennebula/flow.rb +1 -1
- data/lib/opennebula/group.rb +1 -1
- data/lib/opennebula/group_pool.rb +1 -1
- data/lib/opennebula/hook.rb +1 -1
- data/lib/opennebula/hook_log.rb +1 -1
- data/lib/opennebula/hook_pool.rb +1 -1
- data/lib/opennebula/host.rb +1 -60
- data/lib/opennebula/host_pool.rb +1 -1
- data/lib/opennebula/image.rb +1 -1
- 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 +1 -1
- data/lib/opennebula/marketplace.rb +1 -1
- data/lib/opennebula/marketplace_pool.rb +1 -1
- data/lib/opennebula/marketplaceapp.rb +1 -1
- data/lib/opennebula/marketplaceapp_ext.rb +14 -211
- data/lib/opennebula/marketplaceapp_pool.rb +1 -1
- data/lib/opennebula/oneflow_client.rb +11 -9
- data/lib/opennebula/pool.rb +1 -1
- 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 +1 -1
- data/lib/opennebula/template_ext.rb +1 -1
- data/lib/opennebula/template_pool.rb +1 -1
- data/lib/opennebula/user.rb +1 -1
- data/lib/opennebula/user_pool.rb +1 -1
- data/lib/opennebula/utils.rb +2 -2
- data/lib/opennebula/vdc.rb +1 -1
- data/lib/opennebula/vdc_pool.rb +1 -1
- data/lib/opennebula/virtual_machine.rb +3 -12
- data/lib/opennebula/virtual_machine_ext.rb +2 -31
- data/lib/opennebula/virtual_machine_pool.rb +1 -1
- data/lib/opennebula/virtual_network.rb +1 -1
- data/lib/opennebula/virtual_network_pool.rb +1 -1
- data/lib/opennebula/virtual_router.rb +1 -1
- data/lib/opennebula/virtual_router_pool.rb +1 -1
- data/lib/opennebula/vm_group.rb +1 -1
- data/lib/opennebula/vm_group_pool.rb +1 -1
- data/lib/opennebula/vntemplate.rb +1 -1
- data/lib/opennebula/vntemplate_pool.rb +1 -1
- data/lib/opennebula/wait_ext.rb +1 -1
- data/lib/opennebula/x509_auth.rb +1 -1
- data/lib/opennebula/xml_element.rb +2 -2
- 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 +2 -2
- metadata +6 -67
- data/lib/ActionManager.rb +0 -280
- data/lib/CommandManager.rb +0 -328
- data/lib/DriverExecHelper.rb +0 -213
- data/lib/HostSyncManager.rb +0 -111
- data/lib/OpenNebulaDriver.rb +0 -223
- data/lib/VirtualMachineDriver.rb +0 -404
- data/lib/datacenter.rb +0 -1319
- data/lib/datastore.rb +0 -1049
- data/lib/distributed_firewall.rb +0 -293
- data/lib/file_helper.rb +0 -374
- data/lib/host.rb +0 -1518
- data/lib/logical_port.rb +0 -50
- data/lib/logical_switch.rb +0 -77
- data/lib/memoize.rb +0 -74
- data/lib/network.rb +0 -705
- data/lib/nsx_client.rb +0 -157
- data/lib/nsx_component.rb +0 -28
- data/lib/nsx_constants.rb +0 -162
- data/lib/nsx_driver.rb +0 -91
- data/lib/nsx_error.rb +0 -77
- data/lib/nsx_rule.rb +0 -206
- data/lib/nsxt_client.rb +0 -189
- data/lib/nsxt_dfw.rb +0 -196
- data/lib/nsxt_logical_port.rb +0 -94
- data/lib/nsxt_rule.rb +0 -188
- data/lib/nsxt_tz.rb +0 -38
- data/lib/nsxv_client.rb +0 -189
- data/lib/nsxv_dfw.rb +0 -202
- data/lib/nsxv_logical_port.rb +0 -107
- data/lib/nsxv_rule.rb +0 -172
- data/lib/nsxv_tz.rb +0 -41
- data/lib/opaque_network.rb +0 -134
- data/lib/rest_client.rb +0 -191
- data/lib/scripts_common.rb +0 -176
- data/lib/transport_zone.rb +0 -43
- data/lib/vcenter_driver.rb +0 -152
- data/lib/vcenter_importer.rb +0 -626
- data/lib/vi_client.rb +0 -273
- data/lib/vi_helper.rb +0 -328
- data/lib/virtual_machine.rb +0 -3574
- data/lib/virtual_wire.rb +0 -158
- data/lib/vm_device.rb +0 -80
- data/lib/vm_disk.rb +0 -202
- data/lib/vm_folder.rb +0 -69
- data/lib/vm_helper.rb +0 -30
- data/lib/vm_monitor.rb +0 -305
- data/lib/vm_nic.rb +0 -70
- data/lib/vm_template.rb +0 -2112
- data/lib/vmm_importer.rb +0 -165
@@ -0,0 +1,284 @@
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
2
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
3
|
+
# #
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
|
+
# not use this file except in compliance with the License. You may obtain #
|
6
|
+
# a copy of the License at #
|
7
|
+
# #
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
9
|
+
# #
|
10
|
+
# Unless required by applicable law or agreed to in writing, software #
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
13
|
+
# See the License for the specific language governing permissions and #
|
14
|
+
# limitations under the License. #
|
15
|
+
#--------------------------------------------------------------------------- #
|
16
|
+
|
17
|
+
module OpenNebula
|
18
|
+
|
19
|
+
# Virtual Route Role class
|
20
|
+
class VRRole < Role
|
21
|
+
|
22
|
+
attr_reader :service
|
23
|
+
|
24
|
+
########################################################################
|
25
|
+
# Operations
|
26
|
+
########################################################################
|
27
|
+
|
28
|
+
def chown(uid, gid)
|
29
|
+
vrouter_id = @body['vrouter_id']
|
30
|
+
|
31
|
+
vrouter = OpenNebula::VirtualRouter.new_with_id(
|
32
|
+
vrouter_id, @service.client
|
33
|
+
)
|
34
|
+
|
35
|
+
rc = vrouter.chown(uid, gid)
|
36
|
+
|
37
|
+
if OpenNebula.is_error?(rc)
|
38
|
+
msg = "Role #{name} : Chown failed for VR #{vrouter_id}; " \
|
39
|
+
"#{rc.message}"
|
40
|
+
|
41
|
+
Log.error(LOG_COMP, msg, @service.id)
|
42
|
+
@service.log_error(msg)
|
43
|
+
|
44
|
+
return [false, rc.message]
|
45
|
+
else
|
46
|
+
msg = "Role #{name} : Chown success for VR #{vrouter_id}"
|
47
|
+
Log.debug(LOG_COMP, msg, @service.id)
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
[true, nil]
|
52
|
+
end
|
53
|
+
|
54
|
+
def update(_)
|
55
|
+
return OpenNebula::Error.new(
|
56
|
+
"Virtual Router role #{name} does not support cardinality update"
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
########################################################################
|
61
|
+
# Scheduler
|
62
|
+
########################################################################
|
63
|
+
|
64
|
+
def batch_action(_, _, _, _)
|
65
|
+
return OpenNebula::Error.new(
|
66
|
+
"Virtual Router role #{name} does not support schedule actions"
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
########################################################################
|
71
|
+
# Scalability
|
72
|
+
########################################################################
|
73
|
+
|
74
|
+
# Returns the role max cardinality
|
75
|
+
# @return [Integer,nil] the role cardinality
|
76
|
+
def max_cardinality
|
77
|
+
return cardinality
|
78
|
+
end
|
79
|
+
|
80
|
+
# Returns the role min cardinality
|
81
|
+
# @return [Integer,nil] the role cardinality
|
82
|
+
def min_cardinality
|
83
|
+
return cardinality
|
84
|
+
end
|
85
|
+
|
86
|
+
def scale?(_)
|
87
|
+
return [0, 0]
|
88
|
+
end
|
89
|
+
|
90
|
+
def elasticity_policies
|
91
|
+
[]
|
92
|
+
end
|
93
|
+
|
94
|
+
def update_elasticity_policies(_)
|
95
|
+
[]
|
96
|
+
end
|
97
|
+
|
98
|
+
def cooldown
|
99
|
+
[]
|
100
|
+
end
|
101
|
+
|
102
|
+
def update_cooldown(_)
|
103
|
+
[]
|
104
|
+
end
|
105
|
+
|
106
|
+
def scale_way(_)
|
107
|
+
[]
|
108
|
+
end
|
109
|
+
|
110
|
+
def clean_scale_way
|
111
|
+
[]
|
112
|
+
end
|
113
|
+
|
114
|
+
########################################################################
|
115
|
+
# Deployment
|
116
|
+
########################################################################
|
117
|
+
|
118
|
+
# Deploys all the nodes in this role
|
119
|
+
#
|
120
|
+
# @return [Array<true, nil>, Array<false, String>] true if all the VMs
|
121
|
+
# were created, false and the error reason if there was a problem
|
122
|
+
# creating the VMs
|
123
|
+
def deploy
|
124
|
+
deployed_nodes = []
|
125
|
+
n_nodes = cardinality - nodes.size
|
126
|
+
|
127
|
+
return [deployed_nodes, nil] if n_nodes == 0
|
128
|
+
|
129
|
+
vr_name = @@vr_name_template
|
130
|
+
.gsub('$SERVICE_ID', @service.id.to_s)
|
131
|
+
.gsub('$SERVICE_NAME', @service.name.to_s)
|
132
|
+
.gsub('$ROLE_NAME', name.to_s)
|
133
|
+
|
134
|
+
@body['template_contents']['NAME'] = vr_name
|
135
|
+
template_id, _, extra_template = init_template_attributes
|
136
|
+
|
137
|
+
# Create vrouter Object and description
|
138
|
+
vrouter = VirtualRouter.new(
|
139
|
+
VirtualRouter.build_xml(@service.uid),
|
140
|
+
@service.client
|
141
|
+
)
|
142
|
+
|
143
|
+
Log.debug(
|
144
|
+
LOG_COMP,
|
145
|
+
"Role #{name} : Creating service VRouter",
|
146
|
+
@service.id
|
147
|
+
)
|
148
|
+
|
149
|
+
# Allocating VR with role description provided
|
150
|
+
rc = vrouter.allocate(extra_template)
|
151
|
+
|
152
|
+
if OpenNebula.is_error?(rc)
|
153
|
+
msg = "Role #{name} : Allocate failed for Vrouter " \
|
154
|
+
"#{template_id}; #{rc.message}"
|
155
|
+
|
156
|
+
Log.error(LOG_COMP, msg, @service.id)
|
157
|
+
@service.log_error(msg)
|
158
|
+
|
159
|
+
return [false, "Error allocating Vrouter #{template_id} in Role " \
|
160
|
+
"#{name}: #{rc.message}"]
|
161
|
+
end
|
162
|
+
|
163
|
+
Log.debug(
|
164
|
+
LOG_COMP,
|
165
|
+
"Role #{name} : Instantiating VRouter #{vrouter.id}",
|
166
|
+
@service.id
|
167
|
+
)
|
168
|
+
|
169
|
+
# Instantiating Vrouters
|
170
|
+
vm_name = @@vm_name_template
|
171
|
+
.gsub('$SERVICE_ID', @service.id.to_s)
|
172
|
+
.gsub('$SERVICE_NAME', @service.name.to_s)
|
173
|
+
.gsub('$ROLE_NAME', name.to_s)
|
174
|
+
.gsub('$VM_NUMBER', '%i')
|
175
|
+
|
176
|
+
rc = vrouter.instantiate(
|
177
|
+
n_nodes,
|
178
|
+
template_id,
|
179
|
+
vm_name,
|
180
|
+
on_hold?,
|
181
|
+
extra_template
|
182
|
+
)
|
183
|
+
|
184
|
+
if OpenNebula.is_error?(rc)
|
185
|
+
msg = "Role #{name} : Instantiate failed for Vrouter " \
|
186
|
+
"#{vrouter.id}; #{rc.message}"
|
187
|
+
|
188
|
+
Log.error(LOG_COMP, msg, @service.id)
|
189
|
+
@service.log_error(msg)
|
190
|
+
|
191
|
+
return [false, "Error instantiating Vrouter #{vrouter.id} in Role " \
|
192
|
+
"#{name}: #{rc.message}"]
|
193
|
+
end
|
194
|
+
|
195
|
+
vrouter.info
|
196
|
+
|
197
|
+
# Once deployed, save VM info in role node body
|
198
|
+
deployed_nodes.concat(vrouter.vm_ids)
|
199
|
+
|
200
|
+
deployed_nodes.each do |vm_id|
|
201
|
+
fill_node_info(vm_id)
|
202
|
+
end
|
203
|
+
|
204
|
+
@body['vrouter_id'] = vrouter.id
|
205
|
+
|
206
|
+
# Fill vrouter IP in vrouter role body
|
207
|
+
vrouter_nics = vrouter.to_hash['VROUTER']['TEMPLATE']['NIC'] || []
|
208
|
+
vrouter_nics = [vrouter_nics] if vrouter_nics.is_a?(Hash)
|
209
|
+
|
210
|
+
@body['vrouter_ips'] = vrouter_nics.map do |nic|
|
211
|
+
next unless nic.is_a?(Hash) && nic.key?('VROUTER_IP')
|
212
|
+
|
213
|
+
{
|
214
|
+
'NETWORK_ID' => nic['NETWORK_ID'].to_i,
|
215
|
+
'VROUTER_IP' => nic['VROUTER_IP']
|
216
|
+
}
|
217
|
+
end.compact
|
218
|
+
|
219
|
+
[deployed_nodes, nil]
|
220
|
+
end
|
221
|
+
|
222
|
+
########################################################################
|
223
|
+
# Recover
|
224
|
+
########################################################################
|
225
|
+
|
226
|
+
# VRs do not support scale operations, returing empty array with
|
227
|
+
# zero nodes deployed / shutdown
|
228
|
+
def recover_scale(_)
|
229
|
+
[]
|
230
|
+
end
|
231
|
+
|
232
|
+
########################################################################
|
233
|
+
# Helpers
|
234
|
+
########################################################################
|
235
|
+
|
236
|
+
# Shutdown all nodes associated with a Virtual Router.
|
237
|
+
#
|
238
|
+
# @param nodes [Array<Hash>] list of node definitions for the role
|
239
|
+
# @param n_nodes [Integer] number of nodes to shutdown
|
240
|
+
# @param _ [Object] unused parameter (placeholder for recover att)
|
241
|
+
#
|
242
|
+
# @return [Array<(Boolean, Array<Integer>)>] a tuple:
|
243
|
+
# - Boolean indicating overall success (`true` if VR was deleted successfully)
|
244
|
+
# - Array of VM IDs that were associated with the Virtual Router
|
245
|
+
#
|
246
|
+
# If the router could not be deleted, returns `false` and an empty list.
|
247
|
+
def shutdown_nodes(_nodes, n_nodes, _)
|
248
|
+
vrouter_id = @body['vrouter_id']
|
249
|
+
return [true, []] if vrouter_id.nil?
|
250
|
+
|
251
|
+
msg = "Role #{name} : Terminating VR #{vrouter_id} (#{n_nodes} VMs associated)"
|
252
|
+
Log.debug(LOG_COMP, msg, @service.id)
|
253
|
+
|
254
|
+
vrouter = OpenNebula::VirtualRouter.new_with_id(vrouter_id, @service.client)
|
255
|
+
rc = vrouter.info
|
256
|
+
|
257
|
+
if OpenNebula.is_error?(rc)
|
258
|
+
msg = "Role #{name} : Error getting VR #{vrouter_id}: #{rc.message}"
|
259
|
+
Log.error(LOG_COMP, msg, @service.id)
|
260
|
+
@service.log_error(msg)
|
261
|
+
|
262
|
+
return [false, []]
|
263
|
+
end
|
264
|
+
|
265
|
+
vm_ids = vrouter.vm_ids
|
266
|
+
rc = vrouter.delete
|
267
|
+
|
268
|
+
if OpenNebula.is_error?(rc) && rc.errno != OpenNebula::Error::ENO_EXISTS
|
269
|
+
msg = "Role #{name} : Delete failed for VR #{vrouter_id}: #{rc.message}"
|
270
|
+
Log.error(LOG_COMP, msg, @service.id)
|
271
|
+
@service.log_error(msg)
|
272
|
+
|
273
|
+
return [false, []]
|
274
|
+
end
|
275
|
+
|
276
|
+
msg = "Role #{name} : Delete success for VR #{vrouter_id}"
|
277
|
+
Log.debug(LOG_COMP, msg, @service.id)
|
278
|
+
|
279
|
+
[true, vm_ids]
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
|
284
|
+
end
|
data/lib/models.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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 #
|
@@ -29,4 +29,6 @@ require 'opennebula/flow/service_template'
|
|
29
29
|
require 'opennebula/flow/validator'
|
30
30
|
|
31
31
|
require 'models/role'
|
32
|
+
require 'models/vmrole'
|
33
|
+
require 'models/vrrole'
|
32
34
|
require 'models/service'
|
data/lib/opennebula/acl.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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/opennebula/acl_pool.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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/opennebula/backupjob.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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-2025, 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/opennebula/client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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/opennebula/cluster.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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 #
|
@@ -34,9 +34,14 @@ module OpenNebula
|
|
34
34
|
:addvnet => "cluster.addvnet",
|
35
35
|
:delvnet => "cluster.delvnet",
|
36
36
|
:update => "cluster.update",
|
37
|
-
:rename => "cluster.rename"
|
37
|
+
:rename => "cluster.rename",
|
38
|
+
:optimize => "cluster.optimize",
|
39
|
+
:planexecute => "cluster.planexecute",
|
40
|
+
:plandelete => "cluster.plandelete"
|
38
41
|
}
|
39
42
|
|
43
|
+
PLAN_STATE = ['READY', 'APPLYING', 'DONE', 'ERROR', 'TIMEOUT']
|
44
|
+
|
40
45
|
# Creates a Cluster description with just its identifier
|
41
46
|
# this method should be used to create plain Cluster objects.
|
42
47
|
# +id+ the id of the host
|
@@ -182,6 +187,30 @@ module OpenNebula
|
|
182
187
|
return call(CLUSTER_METHODS[:rename], @pe_id, name)
|
183
188
|
end
|
184
189
|
|
190
|
+
# Create optimization plan for the Cluster
|
191
|
+
#
|
192
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
193
|
+
# otherwise
|
194
|
+
def optimize()
|
195
|
+
return call(CLUSTER_METHODS[:optimize], @pe_id)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Start applying the optimization plan for the Cluster
|
199
|
+
#
|
200
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
201
|
+
# otherwise
|
202
|
+
def plan_execute()
|
203
|
+
return call(CLUSTER_METHODS[:planexecute], @pe_id)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Delete optimization plan for the Cluster
|
207
|
+
#
|
208
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
209
|
+
# otherwise
|
210
|
+
def plan_delete()
|
211
|
+
return call(CLUSTER_METHODS[:plandelete], @pe_id)
|
212
|
+
end
|
213
|
+
|
185
214
|
# ---------------------------------------------------------------------
|
186
215
|
# Helpers to get information
|
187
216
|
# ---------------------------------------------------------------------
|
@@ -243,6 +272,20 @@ module OpenNebula
|
|
243
272
|
return array
|
244
273
|
end
|
245
274
|
|
275
|
+
# Returns state of optimization plan
|
276
|
+
# @return [Integer] -1 if no plan
|
277
|
+
def plan_state
|
278
|
+
state = self['PLAN/STATE'] || -1
|
279
|
+
|
280
|
+
state.to_i
|
281
|
+
end
|
282
|
+
|
283
|
+
# Returns an array plan actions
|
284
|
+
# @return [Array<PlanAction>]
|
285
|
+
def plan_actions
|
286
|
+
[self.to_hash['CLUSTER']['PLAN']['ACTION']].flatten
|
287
|
+
end
|
288
|
+
|
246
289
|
private
|
247
290
|
|
248
291
|
def contains_resource?(xpath, id)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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/opennebula/datastore.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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-2025, 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/opennebula/document.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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-2025, 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-2025, 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-2025, 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/opennebula/error.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2025, 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 #
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Autogenerated from a Treetop grammar. Edits may be lost.
|
3
3
|
|
4
4
|
|
5
|
-
# Copyright 2002-
|
5
|
+
# Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
|
6
6
|
# #
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
8
8
|
# 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-2025, 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 #
|