opennebula 6.8.2 → 6.9.80.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/DriverExecHelper.rb +0 -2
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/models/role.rb +6 -2
- data/lib/models/service.rb +12 -22
- data/lib/opennebula/flow/service_template.rb +1 -1
- data/lib/opennebula/image.rb +3 -2
- data/lib/opennebula/ldap_auth.rb +13 -4
- data/lib/opennebula/marketplaceapp_ext.rb +0 -5
- data/lib/opennebula/virtual_machine.rb +16 -4
- data/lib/opennebula/x509_auth.rb +1 -1
- data/lib/opennebula.rb +1 -1
- data/lib/scripts_common.rb +0 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf888b9c95db4f557149408182752fb7de455cd59b3f5300b2401dcb9291852
|
4
|
+
data.tar.gz: 02fa72864a8859c132397c2a7d08e5dd831ff5be9743da486f0d782ae8e166b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa192365155396fe0719ef58c97ca01b94f06f0f6bd8d8fb8c87f70b69f85d7cc3b4abe1d2d4c39c63a5419d67351b25d1f0bfa6caf0bce3f09c76e720afa2f1
|
7
|
+
data.tar.gz: cc2141821c1dc205c592f2e7d8f9200ab1b963713b83580350b22f9c551fe3ba7d8cbd670fb174b6211c83529ed064ce6bcf4356a2e1a6c47ef815d8bc17a6ba
|
data/lib/DriverExecHelper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# rubocop:disable Naming/FileName
|
2
1
|
# -------------------------------------------------------------------------- #
|
3
2
|
# Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
|
4
3
|
# #
|
@@ -216,4 +215,3 @@ module DriverExecHelper
|
|
216
215
|
end
|
217
216
|
|
218
217
|
end
|
219
|
-
# rubocop:enable Naming/FileName
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/models/role.rb
CHANGED
@@ -504,7 +504,7 @@ module OpenNebula
|
|
504
504
|
|
505
505
|
break unless OpenNebula.is_error?(rc)
|
506
506
|
|
507
|
-
sleep(tries
|
507
|
+
sleep(tries)
|
508
508
|
end
|
509
509
|
|
510
510
|
if tries == 3
|
@@ -839,7 +839,11 @@ module OpenNebula
|
|
839
839
|
|
840
840
|
rc = deploy
|
841
841
|
|
842
|
-
|
842
|
+
unless rc[0]
|
843
|
+
return [false, "Error deploying nodes for role `#{name}`"]
|
844
|
+
end
|
845
|
+
|
846
|
+
deployed_nodes.concat(rc[0])
|
843
847
|
|
844
848
|
deployed_nodes
|
845
849
|
end
|
data/lib/models/service.rb
CHANGED
@@ -298,7 +298,7 @@ module OpenNebula
|
|
298
298
|
|
299
299
|
@body['networks_values'].each do |vnet|
|
300
300
|
vnet.each do |_, net|
|
301
|
-
next if net.
|
301
|
+
next if net.key?('id') && !deploy
|
302
302
|
|
303
303
|
ret << net['id'].to_i
|
304
304
|
end
|
@@ -635,24 +635,21 @@ module OpenNebula
|
|
635
635
|
end
|
636
636
|
|
637
637
|
def deploy_networks(deploy = true)
|
638
|
-
if deploy
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
638
|
+
body = if deploy
|
639
|
+
JSON.parse(self['TEMPLATE/BODY'])
|
640
|
+
else
|
641
|
+
@body
|
642
|
+
end
|
643
643
|
|
644
644
|
return if body['networks_values'].nil?
|
645
645
|
|
646
646
|
body['networks_values'].each do |vnet|
|
647
647
|
vnet.each do |name, net|
|
648
|
-
|
648
|
+
next if net.key?('id')
|
649
649
|
|
650
|
-
|
651
|
-
when 'id'
|
652
|
-
next
|
653
|
-
when 'template_id'
|
650
|
+
if net.key?('template_id')
|
654
651
|
rc = create_vnet(name, net)
|
655
|
-
|
652
|
+
elsif net.key?('reserve_from')
|
656
653
|
rc = reserve(name, net)
|
657
654
|
end
|
658
655
|
|
@@ -678,18 +675,14 @@ module OpenNebula
|
|
678
675
|
|
679
676
|
vnets.each do |vnet|
|
680
677
|
vnet.each do |_, net|
|
681
|
-
key
|
682
|
-
|
683
|
-
next unless ['template_id', 'reserve_from'].include?(key)
|
678
|
+
next unless net.key?('template_id') || net.key?('reserve_from')
|
684
679
|
|
685
680
|
rc = OpenNebula::VirtualNetwork.new_with_id(
|
686
681
|
net['id'],
|
687
682
|
@client
|
688
683
|
).delete
|
689
684
|
|
690
|
-
|
691
|
-
|
692
|
-
vnets_failed << net['id']
|
685
|
+
vnets_failed << net['id'] if OpenNebula.is_error?(rc)
|
693
686
|
end
|
694
687
|
end
|
695
688
|
|
@@ -798,10 +791,7 @@ module OpenNebula
|
|
798
791
|
|
799
792
|
next if net.nil?
|
800
793
|
|
801
|
-
role['vm_template_contents'].gsub!(
|
802
|
-
'$'+key[0],
|
803
|
-
net[net.keys[0]]['id'].to_s
|
804
|
-
)
|
794
|
+
role['vm_template_contents'].gsub!("$#{key[0]}", net[key[0]]['id'].to_s)
|
805
795
|
end
|
806
796
|
end
|
807
797
|
end
|
data/lib/opennebula/image.rb
CHANGED
@@ -115,11 +115,12 @@ module OpenNebula
|
|
115
115
|
#
|
116
116
|
# @param description [String] A string containing the template of the Image.
|
117
117
|
# @param ds_id [Integer] the target datastore ID
|
118
|
+
# @param no_check_capacity [Boolean] true to skip capacity check. Only for admins.
|
118
119
|
#
|
119
120
|
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
120
121
|
# otherwise
|
121
|
-
def allocate(description, ds_id,
|
122
|
-
super(IMAGE_METHODS[:allocate],description, ds_id,
|
122
|
+
def allocate(description, ds_id, no_check_capacity=false)
|
123
|
+
super(IMAGE_METHODS[:allocate],description, ds_id, no_check_capacity)
|
123
124
|
end
|
124
125
|
|
125
126
|
# Replaces the template contents
|
data/lib/opennebula/ldap_auth.rb
CHANGED
@@ -147,7 +147,9 @@ class OpenNebula::LdapAuth
|
|
147
147
|
|
148
148
|
[@user.dn,
|
149
149
|
@user[@options[:user_field]].first,
|
150
|
-
@user[@options[:user_group_field]]
|
150
|
+
@user[@options[:user_group_field]],
|
151
|
+
@user['memberof']
|
152
|
+
]
|
151
153
|
else
|
152
154
|
result=@ldap.search(:base => name)
|
153
155
|
|
@@ -155,14 +157,21 @@ class OpenNebula::LdapAuth
|
|
155
157
|
@user = result.first
|
156
158
|
[name,
|
157
159
|
@user[@options[:user_field]].first,
|
158
|
-
@user[@options[:user_group_field]]
|
160
|
+
@user[@options[:user_group_field]],
|
161
|
+
@user['memberof']
|
162
|
+
]
|
159
163
|
else
|
160
|
-
[nil, nil, nil]
|
164
|
+
[nil, nil, nil, nil]
|
161
165
|
end
|
162
166
|
end
|
163
167
|
end
|
164
168
|
|
165
|
-
def is_in_group?(user, group)
|
169
|
+
def is_in_group?(user, group, memberof)
|
170
|
+
if @options[:rfc2307bis]
|
171
|
+
# compare case in-sensitive, like LDAP does
|
172
|
+
return memberof.map(&:downcase).include?(group.downcase)
|
173
|
+
end
|
174
|
+
|
166
175
|
username = Net::LDAP::Filter.escape(
|
167
176
|
user.first.force_encoding(Encoding::UTF_8))
|
168
177
|
result=@ldap.search(
|
@@ -93,7 +93,6 @@ module OpenNebula::MarketPlaceAppExt
|
|
93
93
|
# Exports an OpenNebula Image from this marketplace app
|
94
94
|
# @param options to export the image
|
95
95
|
# :vmtemplate_name [String] name of new image and template
|
96
|
-
# :url_args [String] optional URL arguments
|
97
96
|
# :dsid [String] Datastore id to create the image
|
98
97
|
# :f_dsid [String] Files Datastore id
|
99
98
|
# :notemplate [Bool] if true do not create vm_template (if any)
|
@@ -126,10 +125,6 @@ module OpenNebula::MarketPlaceAppExt
|
|
126
125
|
FROM_APP = "#{self['ID']}"
|
127
126
|
EOT
|
128
127
|
|
129
|
-
if options[:url_args]
|
130
|
-
tmpl << "URL_ARGS=\"#{options[:url_args]}\"\n"
|
131
|
-
end
|
132
|
-
|
133
128
|
#---------------------------------------------------------------
|
134
129
|
# Kernel or context images stored in a files datastore
|
135
130
|
#---------------------------------------------------------------
|
@@ -63,7 +63,8 @@ module OpenNebula
|
|
63
63
|
:updatenic => 'vm.updatenic',
|
64
64
|
:backupcancel => 'vm.backupcancel',
|
65
65
|
:attachpci => 'vm.attachpci',
|
66
|
-
:detachpci => 'vm.detachpci'
|
66
|
+
:detachpci => 'vm.detachpci',
|
67
|
+
:restore => 'vm.restore'
|
67
68
|
}
|
68
69
|
|
69
70
|
VM_STATE=['INIT', 'PENDING', 'HOLD', 'ACTIVE', 'STOPPED', 'SUSPENDED', 'DONE', 'FAILED',
|
@@ -140,7 +141,8 @@ module OpenNebula
|
|
140
141
|
'HOTPLUG_SAVEAS_UNDEPLOYED',
|
141
142
|
'HOTPLUG_SAVEAS_STOPPED',
|
142
143
|
'BACKUP',
|
143
|
-
'BACKUP_POWEROFF'
|
144
|
+
'BACKUP_POWEROFF',
|
145
|
+
'RESTORE'
|
144
146
|
]
|
145
147
|
|
146
148
|
SHORT_VM_STATES={
|
@@ -227,7 +229,8 @@ module OpenNebula
|
|
227
229
|
'HOTPLUG_SAVEAS_UNDEPLOYED' => 'hotp',
|
228
230
|
'HOTPLUG_SAVEAS_STOPPED' => 'hotp',
|
229
231
|
'BACKUP' => 'back',
|
230
|
-
'BACKUP_POWEROFF' => 'back'
|
232
|
+
'BACKUP_POWEROFF' => 'back',
|
233
|
+
'RESTORE' => 'rest'
|
231
234
|
}
|
232
235
|
|
233
236
|
HISTORY_ACTION=[
|
@@ -290,7 +293,8 @@ module OpenNebula
|
|
290
293
|
'sg-attach',
|
291
294
|
'sg-detach',
|
292
295
|
'pci-attach',
|
293
|
-
'pci-detach'
|
296
|
+
'pci-detach',
|
297
|
+
'restore'
|
294
298
|
]
|
295
299
|
|
296
300
|
EXTERNAL_IP_ATTRS = [
|
@@ -891,6 +895,14 @@ module OpenNebula
|
|
891
895
|
call(VM_METHODS[:detachpci], @pe_id, pci_id)
|
892
896
|
end
|
893
897
|
|
898
|
+
# Restore the VM from backup Image
|
899
|
+
#
|
900
|
+
# @return [nil, OpenNebula::Error] nil in case of sucess, Error
|
901
|
+
# otherwise.
|
902
|
+
def restore(img_id, inc_id, disk_id)
|
903
|
+
@client.call(VM_METHODS[:restore], @pe_id, img_id, inc_id, disk_id)
|
904
|
+
end
|
905
|
+
|
894
906
|
########################################################################
|
895
907
|
# Helpers to get VirtualMachine information
|
896
908
|
########################################################################
|
data/lib/opennebula/x509_auth.rb
CHANGED
data/lib/opennebula.rb
CHANGED
data/lib/scripts_common.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.9.80.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "<"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.16'
|
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: '
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -258,11 +258,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
258
258
|
version: '0'
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
requirements:
|
261
|
-
- - "
|
261
|
+
- - ">"
|
262
262
|
- !ruby/object:Gem::Version
|
263
|
-
version:
|
263
|
+
version: 1.3.1
|
264
264
|
requirements: []
|
265
|
-
rubygems_version: 3.
|
265
|
+
rubygems_version: 3.3.5
|
266
266
|
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: OpenNebula Client API
|