opennebula 6.4.3 → 6.5.80.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ActionManager.rb +1 -1
  3. data/lib/CommandManager.rb +10 -7
  4. data/lib/DriverExecHelper.rb +1 -1
  5. data/lib/OpenNebulaDriver.rb +1 -1
  6. data/lib/VirtualMachineDriver.rb +28 -14
  7. data/lib/cloud/CloudClient.rb +3 -3
  8. data/lib/datacenter.rb +25 -21
  9. data/lib/datastore.rb +1 -1
  10. data/lib/distributed_firewall.rb +1 -1
  11. data/lib/file_helper.rb +1 -1
  12. data/lib/host.rb +2 -2
  13. data/lib/logical_port.rb +1 -1
  14. data/lib/logical_switch.rb +1 -1
  15. data/lib/memoize.rb +1 -1
  16. data/lib/models/role.rb +48 -2
  17. data/lib/models/service.rb +1 -1
  18. data/lib/models.rb +1 -1
  19. data/lib/network.rb +1 -1
  20. data/lib/nsx_client.rb +1 -1
  21. data/lib/nsx_component.rb +1 -1
  22. data/lib/nsx_constants.rb +1 -1
  23. data/lib/nsx_driver.rb +1 -1
  24. data/lib/nsx_error.rb +1 -1
  25. data/lib/nsx_rule.rb +1 -1
  26. data/lib/nsxt_client.rb +1 -1
  27. data/lib/nsxt_dfw.rb +1 -1
  28. data/lib/nsxt_logical_port.rb +1 -1
  29. data/lib/nsxt_rule.rb +1 -1
  30. data/lib/nsxt_tz.rb +1 -1
  31. data/lib/nsxv_client.rb +1 -1
  32. data/lib/nsxv_dfw.rb +1 -1
  33. data/lib/nsxv_logical_port.rb +1 -1
  34. data/lib/nsxv_rule.rb +1 -1
  35. data/lib/nsxv_tz.rb +1 -1
  36. data/lib/opaque_network.rb +1 -1
  37. data/lib/opennebula/acl.rb +1 -1
  38. data/lib/opennebula/acl_pool.rb +1 -1
  39. data/lib/opennebula/client.rb +1 -1
  40. data/lib/opennebula/cluster.rb +1 -1
  41. data/lib/opennebula/cluster_pool.rb +1 -1
  42. data/lib/opennebula/datastore.rb +4 -3
  43. data/lib/opennebula/datastore_pool.rb +1 -1
  44. data/lib/opennebula/document.rb +1 -1
  45. data/lib/opennebula/document_json.rb +1 -1
  46. data/lib/opennebula/document_pool.rb +1 -1
  47. data/lib/opennebula/document_pool_json.rb +1 -1
  48. data/lib/opennebula/error.rb +1 -1
  49. data/lib/opennebula/flow/grammar.rb +1 -1
  50. data/lib/opennebula/flow/service_pool.rb +1 -1
  51. data/lib/opennebula/flow/service_template.rb +1 -1
  52. data/lib/opennebula/flow/service_template_ext.rb +1 -1
  53. data/lib/opennebula/flow/service_template_pool.rb +1 -1
  54. data/lib/opennebula/flow/validator.rb +1 -1
  55. data/lib/opennebula/flow.rb +1 -1
  56. data/lib/opennebula/group.rb +1 -1
  57. data/lib/opennebula/group_pool.rb +1 -1
  58. data/lib/opennebula/hook.rb +1 -1
  59. data/lib/opennebula/hook_log.rb +1 -1
  60. data/lib/opennebula/hook_pool.rb +1 -1
  61. data/lib/opennebula/host.rb +1 -1
  62. data/lib/opennebula/host_pool.rb +1 -1
  63. data/lib/opennebula/image.rb +33 -23
  64. data/lib/opennebula/image_pool.rb +1 -1
  65. data/lib/opennebula/ldap_auth.rb +2 -2
  66. data/lib/opennebula/ldap_auth_spec.rb +1 -1
  67. data/lib/opennebula/lockable_ext.rb +1 -1
  68. data/lib/opennebula/marketplace.rb +1 -1
  69. data/lib/opennebula/marketplace_pool.rb +1 -1
  70. data/lib/opennebula/marketplaceapp.rb +1 -1
  71. data/lib/opennebula/marketplaceapp_ext.rb +1 -1
  72. data/lib/opennebula/marketplaceapp_pool.rb +1 -1
  73. data/lib/opennebula/oneflow_client.rb +1 -1
  74. data/lib/opennebula/pool.rb +1 -1
  75. data/lib/opennebula/pool_element.rb +1 -1
  76. data/lib/opennebula/security_group.rb +1 -1
  77. data/lib/opennebula/security_group_pool.rb +1 -1
  78. data/lib/opennebula/server_cipher_auth.rb +1 -1
  79. data/lib/opennebula/server_x509_auth.rb +1 -1
  80. data/lib/opennebula/ssh_auth.rb +1 -1
  81. data/lib/opennebula/system.rb +1 -1
  82. data/lib/opennebula/template.rb +1 -1
  83. data/lib/opennebula/template_ext.rb +1 -1
  84. data/lib/opennebula/template_pool.rb +1 -1
  85. data/lib/opennebula/user.rb +1 -1
  86. data/lib/opennebula/user_pool.rb +1 -1
  87. data/lib/opennebula/utils.rb +1 -1
  88. data/lib/opennebula/vdc.rb +1 -1
  89. data/lib/opennebula/vdc_pool.rb +1 -1
  90. data/lib/opennebula/virtual_machine.rb +31 -3
  91. data/lib/opennebula/virtual_machine_ext.rb +1 -207
  92. data/lib/opennebula/virtual_machine_pool.rb +1 -1
  93. data/lib/opennebula/virtual_network.rb +33 -4
  94. data/lib/opennebula/virtual_network_pool.rb +1 -1
  95. data/lib/opennebula/virtual_router.rb +1 -1
  96. data/lib/opennebula/virtual_router_pool.rb +1 -1
  97. data/lib/opennebula/vm_group.rb +1 -1
  98. data/lib/opennebula/vm_group_pool.rb +1 -1
  99. data/lib/opennebula/vntemplate.rb +1 -1
  100. data/lib/opennebula/vntemplate_pool.rb +1 -1
  101. data/lib/opennebula/wait_ext.rb +1 -1
  102. data/lib/opennebula/x509_auth.rb +1 -1
  103. data/lib/opennebula/xml_element.rb +1 -1
  104. data/lib/opennebula/xml_pool.rb +1 -1
  105. data/lib/opennebula/xml_utils.rb +1 -1
  106. data/lib/opennebula/zone.rb +1 -1
  107. data/lib/opennebula/zone_pool.rb +1 -1
  108. data/lib/opennebula.rb +2 -2
  109. data/lib/rest_client.rb +18 -14
  110. data/lib/scripts_common.rb +1 -1
  111. data/lib/transport_zone.rb +1 -1
  112. data/lib/vcenter_driver.rb +1 -1
  113. data/lib/vcenter_importer.rb +1 -1
  114. data/lib/vi_client.rb +73 -65
  115. data/lib/vi_helper.rb +1 -1
  116. data/lib/virtual_machine.rb +1 -1
  117. data/lib/virtual_wire.rb +1 -1
  118. data/lib/vm_disk.rb +1 -1
  119. data/lib/vm_folder.rb +1 -1
  120. data/lib/vm_helper.rb +1 -1
  121. data/lib/vm_monitor.rb +1 -1
  122. data/lib/vm_nic.rb +1 -1
  123. data/lib/vm_template.rb +1 -1
  124. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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 #
@@ -286,160 +286,6 @@ module OpenNebula::VirtualMachineExt
286
286
  raise
287
287
  end
288
288
 
289
- #-------------------------------------------------------------------
290
- # Backups a VM. TODO Add final description
291
- # @param keep [Bool]
292
- # @param logger[Logger]
293
- # @param binfo[Hash] Oneshot
294
- #-------------------------------------------------------------------
295
- def backup(keep = false, logger = nil, binfo = nil)
296
- # --------------------------------------------------------------
297
- # Check backup consistency
298
- # --------------------------------------------------------------
299
- rc = info
300
-
301
- raise rc.message if OpenNebula.is_error?(rc)
302
-
303
- binfo.merge!(backup_info) do |_key, old_val, new_val|
304
- new_val.nil? ? old_val : new_val
305
- end
306
-
307
- raise 'No backup information' if binfo.nil?
308
-
309
- raise 'No frequency defined' unless valid?(binfo[:freq])
310
-
311
- raise 'No marketplace defined' unless valid?(binfo[:market])
312
-
313
- return if Time.now.to_i - binfo[:last].to_i < binfo[:freq].to_i
314
-
315
- # --------------------------------------------------------------
316
- # Save VM as new template
317
- # --------------------------------------------------------------
318
- logger.info 'Saving VM as template' if logger
319
-
320
- tid = save_as_template(
321
- binfo[:name], '', :poweroff => true, :logger => logger
322
- )
323
-
324
- tmp = OpenNebula::Template.new_with_id(tid, @client)
325
- rc = tmp.info
326
-
327
- raise rc.message if OpenNebula.is_error?(rc)
328
-
329
- # --------------------------------------------------------------
330
- # Import template into Marketplace & update VM info
331
- # --------------------------------------------------------------
332
- logger.info "Importing template #{tmp.id} to marketplace "\
333
- "#{binfo[:market]}" if logger
334
-
335
- tmp.extend(OpenNebula::TemplateExt)
336
-
337
- rc, ids = tmp.mp_import(binfo[:market], true, binfo[:name],
338
- :wait => true, :logger => logger)
339
-
340
- raise rc.message if OpenNebula.is_error?(rc)
341
-
342
- logger.info "Imported app ids: #{ids.join(',')}" if logger
343
-
344
- rc = update(backup_attr(binfo, ids), true)
345
-
346
- if OpenNebula.is_error?(rc)
347
- raise 'Could not update the backup reference: ' \
348
- " #{rc.message}. New backup ids are #{ids.join(',')}."
349
- end
350
-
351
- # --------------------------------------------------------------
352
- # Cleanup
353
- # --------------------------------------------------------------
354
- backup_cleanup(keep, logger, binfo, tmp)
355
- rescue Error, StandardError => e
356
- backup_cleanup(keep, logger, binfo, tmp)
357
-
358
- logger.fatal(e.inspect) if logger
359
-
360
- raise
361
- end
362
-
363
- #-------------------------------------------------------------------
364
- # Restores VM information from previous backup
365
- #
366
- # @param datastore [Integer] Datastore ID to import app backup
367
- # @param logger [Logger] Logger instance to print debug info
368
- #
369
- # @return [Integer] VM ID
370
- #-------------------------------------------------------------------
371
- def restore(datastore, logger = nil)
372
- rc = info
373
-
374
- if OpenNebula.is_error?(rc)
375
- raise "Error getting VM: #{rc.message}"
376
- end
377
-
378
- logger.info 'Reading backup information' if logger
379
-
380
- backup_ids = backup_info[:apps]
381
-
382
- # highest (=last) of the app ids is the template id
383
- app_id = backup_ids.last
384
-
385
- app = OpenNebula::MarketPlaceApp.new_with_id(app_id, @client)
386
- rc = app.info
387
-
388
- if OpenNebula.is_error?(rc)
389
- raise "Can not find appliance #{app_id}: #{rc.message}."
390
- end
391
-
392
- if logger
393
- logger.info "Restoring VM #{self['ID']} from " \
394
- "saved appliance #{app_id}"
395
- end
396
-
397
- app.extend(OpenNebula::MarketPlaceAppExt)
398
-
399
- exp = app.export(:dsid => Integer(datastore),
400
- :name => "#{self['NAME']} - RESTORED")
401
-
402
- if OpenNebula.is_error?(exp)
403
- raise "Can not restore app: #{exp.message}."
404
- end
405
-
406
- # Check possible errors when exporting apps
407
- exp[:image].each do |image|
408
- next unless OpenNebula.is_error?(image)
409
-
410
- raise "Error restoring image: #{image.message}."
411
- end
412
-
413
- template = exp[:vmtemplate].first
414
-
415
- if OpenNebula.is_error?(template)
416
- raise "Error restoring template: #{template.message}."
417
- end
418
-
419
- if logger
420
- logger.info(
421
- "Backup restored, VM template: #{exp[:vmtemplate]}, " \
422
- "images: #{exp[:image]}"
423
- )
424
-
425
- logger.info(
426
- "Instantiating the template #{exp[:vmtemplate]}"
427
- )
428
- end
429
-
430
- tmpl = OpenNebula::Template.new_with_id(template, @client)
431
- rc = tmpl.instantiate
432
-
433
- if OpenNebula.is_error?(rc)
434
- raise "Can not instantiate the template: #{rc.message}."
435
- end
436
-
437
- rc
438
- rescue Error, StandardError => e
439
- logger.fatal(e.inspect) if logger
440
- raise
441
- end
442
-
443
289
  ####################################################################
444
290
  # Private extended interface
445
291
  ####################################################################
@@ -457,58 +303,6 @@ module OpenNebula::VirtualMachineExt
457
303
  !att.nil?
458
304
  end
459
305
 
460
- #-------------------------------------------------------------------
461
- # Get backup information from the VM
462
- #-------------------------------------------------------------------
463
- def backup_info
464
- base = '//USER_TEMPLATE/BACKUP'
465
- binfo = {}
466
-
467
- app_ids = self["#{base}/MARKETPLACE_APP_IDS"] || ''
468
-
469
- binfo[:name] = "#{self['NAME']} - BACKUP " \
470
- " - #{Time.now.strftime('%Y%m%d_%k%M')}"
471
-
472
- binfo[:freq] = self["#{base}/FREQUENCY_SECONDS"]
473
- binfo[:last] = self["#{base}/LAST_BACKUP_TIME"]
474
- binfo[:market] = Integer(self["#{base}/MARKETPLACE_ID"])
475
- binfo[:apps] = app_ids.split(',')
476
-
477
- binfo
478
- rescue StandardError
479
- binfo
480
- end
481
-
482
- #-------------------------------------------------------------------
483
- # Generate backup information string
484
- #-------------------------------------------------------------------
485
- def backup_attr(binfo, ids)
486
- 'BACKUP=[' \
487
- " MARKETPLACE_APP_IDS = \"#{ids.join(',')}\"," \
488
- " FREQUENCY_SECONDS = \"#{binfo[:freq]}\"," \
489
- " LAST_BACKUP_TIME = \"#{Time.now.to_i}\"," \
490
- " MARKETPLACE_ID = \"#{binfo[:market]}\" ]"
491
- end
492
-
493
- #-------------------------------------------------------------------
494
- # Cleanup backup leftovers in case of failure
495
- #-------------------------------------------------------------------
496
- def backup_cleanup(keep, logger, binfo, template)
497
- if template
498
- logger.info "Deleting template #{template.id}" if logger
499
-
500
- template.delete(true)
501
- end
502
-
503
- binfo[:apps].each do |id|
504
- logger.info "Deleting appliance #{id}" if logger
505
-
506
- papp = OpenNebula::MarketPlaceApp.new_with_id(id, @client)
507
-
508
- papp.delete
509
- end if !keep && binfo[:apps]
510
- end
511
-
512
306
  end
513
307
  end
514
308
 
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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 #
@@ -44,7 +44,7 @@ module OpenNebula
44
44
  :recover => "vn.recover"
45
45
  }
46
46
 
47
- VN_STATES=%w{INIT READY LOCK_CREATE LOCK_DELETE DONE ERROR}
47
+ VN_STATES=%w{INIT READY LOCK_CREATE LOCK_DELETE DONE ERROR UPDATE_FAILURE}
48
48
 
49
49
  SHORT_VN_STATES={
50
50
  "INIT" => "init",
@@ -52,7 +52,8 @@ module OpenNebula
52
52
  "LOCK_CREATE" => "lock",
53
53
  "LOCK_DELETE" => "lock",
54
54
  "DONE" => "done",
55
- "ERROR" => "err"
55
+ "ERROR" => "err",
56
+ "UPDATE_FAILURE"=> "fail"
56
57
  }
57
58
 
58
59
  # Creates a VirtualNetwork description with just its identifier
@@ -326,7 +327,7 @@ module OpenNebula
326
327
  # Recovers an stuck Virtual Network
327
328
  #
328
329
  # @param result [Integer] Recover with failure (0), success (1),
329
- # delete (2)
330
+ # delete (2), retry (3)
330
331
  # @return [nil, OpenNebula::Error] nil in case of success, Error
331
332
  # otherwise
332
333
  def recover(result)
@@ -377,6 +378,34 @@ module OpenNebula
377
378
  SHORT_VN_STATES[state_str]
378
379
  end
379
380
 
381
+ # Returns three arrays with the numeric VM IDs for VMs updated,
382
+ # outdated (include updating) and error
383
+ def vm_ids
384
+ updated = Array.new
385
+
386
+ self.each('UPDATED_VMS/ID') do |id|
387
+ updated << id.text.to_i
388
+ end
389
+
390
+ outdated = Array.new
391
+
392
+ self.each('OUTDATED_VMS/ID') do |id|
393
+ outdated << id.text.to_i
394
+ end
395
+
396
+ self.each('UPDATING_VMS/ID') do |id|
397
+ outdated << id.text.to_i
398
+ end
399
+
400
+ error = Array.new
401
+
402
+ self.each('ERROR_VMS/ID') do |id|
403
+ error << id.text.to_i
404
+ end
405
+
406
+ [updated, outdated, error]
407
+ end
408
+
380
409
  private
381
410
  def set_publish(published)
382
411
  group_u = published ? 1 : 0
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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/opennebula.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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 #
@@ -77,5 +77,5 @@ require 'opennebula/flow'
77
77
  module OpenNebula
78
78
 
79
79
  # OpenNebula version
80
- VERSION = '6.4.3'
80
+ VERSION = '6.5.80'
81
81
  end
data/lib/rest_client.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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 #
@@ -69,21 +69,25 @@ module VCenterDriver
69
69
  end
70
70
 
71
71
  def self.new_from_host(host_id)
72
- client = OpenNebula::Client.new
73
- host = OpenNebula::Host.new_with_id(host_id, client)
74
- rc = host.info(true)
75
- if OpenNebula.is_error?(rc)
76
- raise "Could not get host info for ID: \
77
- #{host_id} - #{rc.message}"
78
- end
72
+ begin
73
+ client = OpenNebula::Client.new
74
+ host = OpenNebula::Host.new_with_id(host_id, client)
75
+ rc = host.info(true)
76
+ if OpenNebula.is_error?(rc)
77
+ raise "Could not get host info for ID: \
78
+ #{host_id} - #{rc.message}"
79
+ end
79
80
 
80
- connection = {
81
- :hostname => host['TEMPLATE/VCENTER_HOST'],
82
- :username => host['TEMPLATE/VCENTER_USER'],
83
- :password => host['TEMPLATE/VCENTER_PASSWORD']
84
- }
81
+ connection = {
82
+ :hostname => host['TEMPLATE/VCENTER_HOST'],
83
+ :username => host['TEMPLATE/VCENTER_USER'],
84
+ :password => host['TEMPLATE/VCENTER_PASSWORD']
85
+ }
85
86
 
86
- new(connection)
87
+ new(connection)
88
+ rescue StandardError => e
89
+ raise e
90
+ end
87
91
  end
88
92
 
89
93
  def get_or_create_tag(
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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-2023, OpenNebula Project, OpenNebula Systems #
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 #