opennebula 6.7.80.pre → 6.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c791a9b245b95bd0627930d9f17845003130bec8aba4e363997e583725399b0
4
- data.tar.gz: bef534bfd10f3b9453101a4d639d6ad2a79a2c70b2b34e44c8502d51b83b25c4
3
+ metadata.gz: bd7a4911d467d52eb65d694f92c2312c9a04571a2b846054a5807a2faca70613
4
+ data.tar.gz: 71626222b92776cc9f11bdb8ed73f374c034d761161d46e2bd498aacf29e2342
5
5
  SHA512:
6
- metadata.gz: 7c5b274de24813610fe09de2db614024f719d67b4987e6020b6cf403998f0386c866534f4db702287bb5f9e6ae8943e4ad489f3efad2334b57a4cf73362638ef
7
- data.tar.gz: 0420c6b94f5ad7df4270cd76ff3525d529fa69f82dbaf6aa408bd8bf2d06002832acf5e9e9ed06ee07e7bd4d2b8ca4cd37c5bb557c9898252588c9434c923b4e
6
+ metadata.gz: 7d6cf2da013b4f85775d31894d1a1400f257e45d631fe55bb35c4a487644cd94589d5ce0446f9fc3b0350167cc082a3378147657ce0944656f2fd658357b1323
7
+ data.tar.gz: 84d04dfa148dd4a443050b5ac68fb0b80d8a54979816d753951ebfcbe99f8bb2716ba5c09b029f01431666b042f4bb200d5efcd4abbf1173bdd7ae92318c5975
@@ -207,7 +207,7 @@ module DriverExecHelper
207
207
  config[name]=value
208
208
  end
209
209
  end
210
- rescue StandardException => e
210
+ rescue StandardError => e
211
211
  STDERR.puts "Error reading config: #{e.inspect}"
212
212
  STDERR.flush
213
213
  end
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '6.7.80'
54
+ VERSION = '6.8.1'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
data/lib/models/role.rb CHANGED
@@ -468,8 +468,7 @@ module OpenNebula
468
468
  @body['last_vmname'] += 1
469
469
 
470
470
  Log.debug LOG_COMP,
471
- "Role #{name} : Trying to instantiate " \
472
- "template #{template_id}, with name #{vm_name}",
471
+ "Role #{name} : Instantiate template #{template_id}, name #{vm_name}",
473
472
  @service.id
474
473
 
475
474
  vm_id = template.instantiate(vm_name, on_hold?, extra_template)
@@ -481,33 +480,52 @@ module OpenNebula
481
480
  "#{template_id}; #{vm_id.message}"
482
481
 
483
482
  Log.error LOG_COMP, msg, @service.id
483
+
484
484
  @service.log_error(msg)
485
485
 
486
- return [false, 'Error trying to instantiate the VM ' \
487
- "Template #{template_id} in Role " \
486
+ return [false, "Error instantiating VM Template #{template_id} in Role " \
488
487
  "#{name}: #{vm_id.message}"]
489
488
  end
490
489
 
491
- Log.debug LOG_COMP, "Role #{name} : Instantiate success," \
492
- " VM ID #{vm_id}", @service.id
493
- node = {
494
- 'deploy_id' => vm_id
495
- }
490
+ Log.debug LOG_COMP,
491
+ "Role #{name} : Instantiate success, VM ID #{vm_id}",
492
+ @service.id
496
493
 
497
- vm = OpenNebula::VirtualMachine.new_with_id(vm_id,
498
- @service.client)
499
- rc = vm.info
494
+ node = { 'deploy_id' => vm_id }
495
+ vm = OpenNebula::VirtualMachine.new_with_id(vm_id, @service.client)
500
496
 
501
- if OpenNebula.is_error?(rc)
497
+ tries = 0
498
+ loop do
499
+ break if tries == 3
500
+
501
+ tries += 1
502
+
503
+ rc = vm.info
504
+
505
+ break unless OpenNebula.is_error?(rc)
506
+
507
+ sleep(tries * 0.5)
508
+ end
509
+
510
+ if tries == 3
502
511
  node['vm_info'] = nil
503
- else
504
- hash_vm = vm.to_hash['VM']
505
- vm_info = {}
506
- vm_info['VM'] = hash_vm.select {|v| VM_INFO.include?(v) }
507
512
 
508
- node['vm_info'] = vm_info
513
+ msg = "Role #{name} : Cannot get info for VM #{vm_id}"
514
+
515
+ Log.error LOG_COMP, msg, @service.id
516
+
517
+ @service.log_error(msg)
518
+
519
+ return [false,
520
+ "Error getting VM #{vm_id} info in Role #{name}: #{vm_id.message}"]
509
521
  end
510
522
 
523
+ hash_vm = vm.to_hash['VM']
524
+ vm_info = {}
525
+ vm_info['VM'] = hash_vm.select {|v| VM_INFO.include?(v) }
526
+
527
+ node['vm_info'] = vm_info
528
+
511
529
  @body['nodes'] << node
512
530
  end
513
531
 
@@ -637,8 +655,8 @@ module OpenNebula
637
655
  return OpenNebula::Error.new("Role #{name} is in DONE state")
638
656
  end
639
657
 
640
- do_offset = (!period.nil? && period.to_i > 0 &&
641
- !vms_per_period.nil? && vms_per_period.to_i > 0)
658
+ do_offset = !period.nil? && period.to_i > 0 &&
659
+ !vms_per_period.nil? && vms_per_period.to_i > 0
642
660
 
643
661
  nodes.each_with_index do |node, index|
644
662
  vm_id = node['deploy_id']
@@ -38,16 +38,16 @@ module OpenNebula
38
38
  #######################################################################
39
39
 
40
40
  DOCUMENT_METHODS = {
41
- :allocate => "document.allocate",
42
- :delete => "document.delete",
43
- :info => "document.info",
44
- :update => "document.update",
45
- :chown => "document.chown",
46
- :chmod => "document.chmod",
47
- :clone => "document.clone",
48
- :rename => "document.rename",
49
- :lock => "document.lock",
50
- :unlock => "document.unlock"
41
+ :allocate => 'document.allocate',
42
+ :delete => 'document.delete',
43
+ :info => 'document.info',
44
+ :update => 'document.update',
45
+ :chown => 'document.chown',
46
+ :chmod => 'document.chmod',
47
+ :clone => 'document.clone',
48
+ :rename => 'document.rename',
49
+ :lock => 'document.lock',
50
+ :unlock => 'document.unlock'
51
51
  }
52
52
 
53
53
  # Creates a Document Object description with just its identifier
@@ -55,14 +55,14 @@ module OpenNebula
55
55
  # @param [Integer] pe_id the id of the object
56
56
  #
57
57
  # @return [Nokogiri::XML::Node, REXML::Element] the empty xml
58
- def Document.build_xml(pe_id=nil)
58
+ def self.build_xml(pe_id = nil)
59
59
  if pe_id
60
60
  obj_xml = "<DOCUMENT><ID>#{pe_id}</ID></DOCUMENT>"
61
61
  else
62
- obj_xml = "<DOCUMENT></DOCUMENT>"
62
+ obj_xml = '<DOCUMENT></DOCUMENT>'
63
63
  end
64
64
 
65
- XMLElement.build_xml(obj_xml,'DOCUMENT')
65
+ XMLElement.build_xml(obj_xml, 'DOCUMENT')
66
66
  end
67
67
 
68
68
  # Class constructor
@@ -78,7 +78,7 @@ module OpenNebula
78
78
  def initialize(xml, client)
79
79
  LockableExt.make_lockable(self, DOCUMENT_METHODS)
80
80
 
81
- super(xml,client)
81
+ super(xml, client)
82
82
  end
83
83
 
84
84
  #######################################################################
@@ -99,7 +99,7 @@ module OpenNebula
99
99
  return rc
100
100
  end
101
101
 
102
- alias_method :info!, :info
102
+ alias info! info
103
103
 
104
104
  # Allocates a new Document in OpenNebula
105
105
  #
@@ -111,14 +111,14 @@ module OpenNebula
111
111
  super(DOCUMENT_METHODS[:allocate], description, document_type)
112
112
  end
113
113
 
114
- alias_method :allocate_xml, :allocate
114
+ alias allocate_xml allocate
115
115
 
116
116
  # Deletes the Document
117
117
  #
118
118
  # @return [nil, OpenNebula::Error] nil in case of success, Error
119
119
  # otherwise
120
- def delete()
121
- rc = check_type()
120
+ def delete
121
+ rc = check_type
122
122
  return rc if OpenNebula.is_error?(rc)
123
123
 
124
124
  return call(DOCUMENT_METHODS[:delete], @pe_id)
@@ -132,8 +132,8 @@ module OpenNebula
132
132
  #
133
133
  # @return [nil, OpenNebula::Error] nil in case of success, Error
134
134
  # otherwise
135
- def update(new_template, append=false)
136
- rc = check_type()
135
+ def update(new_template, append = false)
136
+ rc = check_type
137
137
  return rc if OpenNebula.is_error?(rc)
138
138
 
139
139
  super(DOCUMENT_METHODS[:update], new_template, append ? 1 : 0)
@@ -147,8 +147,8 @@ module OpenNebula
147
147
  #
148
148
  # @return [nil, OpenNebula::Error] nil in case of success, Error
149
149
  # otherwise
150
- def update_raw(template_raw, append=false)
151
- rc = check_type()
150
+ def update_raw(template_raw, append = false)
151
+ rc = check_type
152
152
  return rc if OpenNebula.is_error?(rc)
153
153
 
154
154
  return call(DOCUMENT_METHODS[:update], @pe_id, template_raw, append ? 1 : 0)
@@ -162,7 +162,7 @@ module OpenNebula
162
162
  # @return [nil, OpenNebula::Error] nil in case of success, Error
163
163
  # otherwise
164
164
  def chown(uid, gid)
165
- rc = check_type()
165
+ rc = check_type
166
166
  return rc if OpenNebula.is_error?(rc)
167
167
 
168
168
  super(DOCUMENT_METHODS[:chown], uid, gid)
@@ -175,7 +175,7 @@ module OpenNebula
175
175
  # @return [nil, OpenNebula::Error] nil in case of success, Error
176
176
  # otherwise
177
177
  def chmod_octet(octet)
178
- rc = check_type()
178
+ rc = check_type
179
179
  return rc if OpenNebula.is_error?(rc)
180
180
 
181
181
  super(DOCUMENT_METHODS[:chmod], octet)
@@ -187,8 +187,8 @@ module OpenNebula
187
187
  # @return [nil, OpenNebula::Error] nil in case of success, Error
188
188
  # otherwise
189
189
  def chmod(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u,
190
- other_m, other_a)
191
- rc = check_type()
190
+ other_m, other_a)
191
+ rc = check_type
192
192
  return rc if OpenNebula.is_error?(rc)
193
193
 
194
194
  super(DOCUMENT_METHODS[:chmod], owner_u, owner_m, owner_a, group_u,
@@ -202,10 +202,10 @@ module OpenNebula
202
202
  # @return [Integer, OpenNebula::Error] The new Document ID in case
203
203
  # of success, Error otherwise
204
204
  def clone(name)
205
- rc = check_type()
205
+ rc = check_type
206
206
  return rc if OpenNebula.is_error?(rc)
207
207
 
208
- return Error.new('ID not defined') if !@pe_id
208
+ return Error.new('ID not defined') unless @pe_id
209
209
 
210
210
  rc = @client.call(DOCUMENT_METHODS[:clone], @pe_id, name)
211
211
 
@@ -241,7 +241,7 @@ module OpenNebula
241
241
  # Returns true if the GROUP_U permission bit is set
242
242
  # @return [true, false] true if the GROUP_U permission bit is set
243
243
  def public?
244
- if self['PERMISSIONS/GROUP_U'] == "1" || self['PERMISSIONS/OTHER_U'] == "1"
244
+ if self['PERMISSIONS/GROUP_U'] == '1' || self['PERMISSIONS/OTHER_U'] == '1'
245
245
  true
246
246
  else
247
247
  false
@@ -252,7 +252,7 @@ module OpenNebula
252
252
  self.class::DOCUMENT_TYPE
253
253
  end
254
254
 
255
- private
255
+ private
256
256
 
257
257
  def set_publish(published)
258
258
  group_u = published ? 1 : 0
@@ -260,7 +260,7 @@ module OpenNebula
260
260
  chmod(-1, -1, -1, group_u, -1, -1, -1, -1, -1)
261
261
  end
262
262
 
263
- def check_type()
263
+ def check_type
264
264
  type = self['TYPE']
265
265
 
266
266
  if type.nil? && @pe_id
@@ -276,10 +276,13 @@ module OpenNebula
276
276
 
277
277
  if !type.nil? && type.to_i != document_type
278
278
  return OpenNebula::Error.new(
279
- "[DocumentInfo] Error getting document [#{@pe_id}].")
279
+ "[DocumentInfo] Error getting document [#{@pe_id}]."
280
+ )
280
281
  end
281
282
 
282
- return nil
283
+ return
283
284
  end
285
+
284
286
  end
287
+
285
288
  end
@@ -41,7 +41,7 @@ module OpenNebula
41
41
  #######################################################################
42
42
 
43
43
  DOCUMENT_POOL_METHODS = {
44
- :info => "documentpool.info"
44
+ :info => 'documentpool.info'
45
45
  }
46
46
 
47
47
  #######################################################################
@@ -55,10 +55,10 @@ module OpenNebula
55
55
  # http://docs.opennebula.io/stable/integration/system_interfaces/api.html
56
56
  #
57
57
  # @return [DocumentPool] the new object
58
- def initialize(client, user_id=-1)
59
- super('DOCUMENT_POOL','DOCUMENT',client)
58
+ def initialize(client, user_id = -1)
59
+ super('DOCUMENT_POOL', 'DOCUMENT', client)
60
60
 
61
- @user_id = user_id
61
+ @user_id = user_id
62
62
  end
63
63
 
64
64
  #######################################################################
@@ -99,4 +99,5 @@ module OpenNebula
99
99
  self.class::DOCUMENT_TYPE
100
100
  end
101
101
  end
102
+
102
103
  end
@@ -450,9 +450,7 @@ module OpenNebula::MarketPlaceAppExt
450
450
  ds = OpenNebula::Datastore.new_with_id(dsid, @client)
451
451
  rc = ds.info
452
452
 
453
- is_vcenter =
454
- !OpenNebula.is_error?(rc) &&
455
- (ds['TEMPLATE/DRIVER'] == 'vcenter')
453
+ is_vcenter = !OpenNebula.is_error?(rc) && ds['TEMPLATE/DRIVER'] == 'vcenter'
456
454
 
457
455
  if is_vcenter
458
456
  if options[:template].nil?
@@ -592,7 +590,7 @@ module OpenNebula::MarketPlaceAppExt
592
590
  pool = OpenNebula::MarketPlaceAppPool.new(@client)
593
591
  rc = pool.info_all
594
592
 
595
- return rc if OpenNebula.is_error?(rc)
593
+ return [rc, [], []] if OpenNebula.is_error?(rc)
596
594
 
597
595
  # Apps that have been already exported
598
596
  #
@@ -676,9 +674,7 @@ module OpenNebula::MarketPlaceAppExt
676
674
  end
677
675
 
678
676
  if OpenNebula.is_error?(rc)
679
- rc_rbck = rollback_export(exported, xpath != '//DISK')
680
-
681
- return rc_rbck if OpenNebula.is_error?(rc_rbck)
677
+ rollback_export(exported, xpath != '//DISK')
682
678
  end
683
679
 
684
680
  [rc, images, templates]
@@ -755,7 +755,7 @@ module OpenNebula
755
755
  # will replace the existing ones or delete it if empty. Attributes that
756
756
  # can be updated are: INPUT/{TYPE, BUS}; RAW/{TYPE, DATA, DATA_VMX},
757
757
  # OS/{BOOT, BOOTLOADER, ARCH, MACHINE, KERNEL, INITRD},
758
- # FEATURES/{ACPI, APIC, PAE, LOCALTIME, HYPERV, GUEST_AGENT},
758
+ # FEATURES/{ACPI, APIC, PAE, LOCALTIME, HYPERV, GUEST_AGENT, VIRTIO_SCSI_QUEUES, VIRTIO_BLK_QUEUES, IOTHREADS},
759
759
  # GRAPHICS/{TYPE, LISTEN, PASSWD, KEYMAP},
760
760
  # and VIDEO/{TYPE, IOMMU, ATS, VRAM, RESOLUTION}
761
761
  # @param append, append template, do not delete empty attributes
data/lib/opennebula.rb CHANGED
@@ -79,5 +79,5 @@ require 'opennebula/backupjob_pool'
79
79
  module OpenNebula
80
80
 
81
81
  # OpenNebula version
82
- VERSION = '6.7.80'
82
+ VERSION = '6.8.1'
83
83
  end
@@ -2028,7 +2028,7 @@ end
2028
2028
  :unitNumber => unumber
2029
2029
  }
2030
2030
  if @vi_client.vim.serviceContent.about.apiVersion.to_f >= 7.0
2031
- card_spec[:key] = Time.now.utc.strftime('%m%d%M%S%L').to_i
2031
+ card_spec[:key] = -100 - card_num.to_i
2032
2032
  end
2033
2033
 
2034
2034
  if (limit || rsrv) && (limit > 0)
@@ -2175,7 +2175,7 @@ end
2175
2175
  :addressType => 'generated'
2176
2176
  }
2177
2177
  if @vi_client.vim.serviceContent.about.apiVersion.to_f >= 7.0
2178
- card_spec[:key] = Time.now.utc.strftime('%m%d%M%S%L').to_i
2178
+ card_spec[:key] = -100 - card_num.to_i
2179
2179
  end
2180
2180
 
2181
2181
  if (limit || rsrv) && (limit > 0)
@@ -2720,7 +2720,7 @@ end
2720
2720
  img_name = VCenterDriver::FileHelper.unescape_path(img_name_escaped)
2721
2721
 
2722
2722
  vc_disks.each do |d|
2723
- key_matches = (unmanaged_key && d[:key] == unmanaged_key.to_i)
2723
+ key_matches = unmanaged_key && d[:key] == unmanaged_key.to_i
2724
2724
  path_matches = (d[:path_wo_ds] == img_name)
2725
2725
 
2726
2726
  if key_matches || path_matches
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.80.pre
4
+ version: 6.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-27 00:00:00.000000000 Z
11
+ date: 2023-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rbvmomi
42
+ name: rbvmomi2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -258,9 +258,9 @@ 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: 1.3.1
263
+ version: '0'
264
264
  requirements: []
265
265
  rubygems_version: 3.1.2
266
266
  signing_key: