opennebula 6.4.3 → 6.4.4

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: f5f6ca2f486dd7127edf5b9320376397e778f33335e3d9403b6fa2f2b96fc2cd
4
- data.tar.gz: 0101d985b9b7d4bc22499a3a2478b54a98fdb6d1384a235f66515851fab9f399
3
+ metadata.gz: 96a1db3dafa076b57aaa80ad46375d0830f6819fa0e70124b77b1ca8d648f29c
4
+ data.tar.gz: bbed8b41708c8c6e1a3348b320c3995bc141efbcc0e7e95a051e5ceeb25dc18f
5
5
  SHA512:
6
- metadata.gz: 619e3110a10dcb5959009b1c077685448b38cae6cd8e5bb2e53ff1ec3d922d660e6e91be9d17012f5046ea5b9055697399a80ddbb7b7408fd9fedb196c46e0fa
7
- data.tar.gz: 12561af3a0ceffd756e90da166dba0625444118cf137ebb9d781f034175b330ee4d0cd8fe99997285ac0ee55c51af58acca4ec9dea0f494f4a27d3b22301eede
6
+ metadata.gz: 2750f136ca555d0a4e2f002bf58f6b6706d5a9a92d6094fa84d1afba3d7148e5cd9ae1b7911a90a58ae0a913ba64b9052c2e021dd5da07f7ee94e04c42a8a89c
7
+ data.tar.gz: 2b0252237e2513b95bf2da0355275dc6a3d797b7c5f6a5dba4ec9b64fe9cc017de031042e740921ecd870fbedda4a8ee73e047168307a3c6676e3c3527f3ae25
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '6.4.3'
54
+ VERSION = '6.4.4'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
data/lib/datastore.rb CHANGED
@@ -743,9 +743,9 @@ module VCenterDriver
743
743
  image_path = ''
744
744
 
745
745
  # Skip not relevant files
746
- next unless %w[FloppyImageFileInfo
747
- IsoImageFileInfo
748
- VmDiskFileInfo].include? image.class.to_s
746
+ next unless ['FloppyImageFileInfo',
747
+ 'IsoImageFileInfo',
748
+ 'VmDiskFileInfo'].include? image.class.to_s
749
749
 
750
750
  # Get image path and name
751
751
  image_path << folderpath << image.path
data/lib/file_helper.rb CHANGED
@@ -109,7 +109,7 @@ module VCenterDriver
109
109
  def self.needs_unpack?(file_path)
110
110
  type = get_type(file_path)
111
111
  type.gsub!(%r{^application/(x-)?}, '')
112
- %w[bzip2 gzip tar].include?(type)
112
+ ['bzip2', 'gzip', 'tar'].include?(type)
113
113
  end
114
114
 
115
115
  def self.vcenter_file_info(file_path)
data/lib/models/role.rb CHANGED
@@ -32,26 +32,26 @@ module OpenNebula
32
32
  attr_reader :service
33
33
 
34
34
  # Actions that can be performed on the VMs of a given Role
35
- SCHEDULE_ACTIONS = %w[
36
- terminate
37
- terminate-hard
38
- undeploy
39
- undeploy-hard
40
- hold
41
- release
42
- stop
43
- suspend
44
- resume
45
- reboot
46
- reboot-hard
47
- poweroff
48
- poweroff-hard
49
- snapshot-create
50
- snapshot-revert
51
- snapshot-delete
52
- disk-snapshot-create
53
- disk-snapshot-revert
54
- disk-snapshot-delete
35
+ SCHEDULE_ACTIONS = [
36
+ 'terminate',
37
+ 'terminate-hard',
38
+ 'undeploy',
39
+ 'undeploy-hard',
40
+ 'hold',
41
+ 'release',
42
+ 'stop',
43
+ 'suspend',
44
+ 'resume',
45
+ 'reboot',
46
+ 'reboot-hard',
47
+ 'poweroff',
48
+ 'poweroff-hard',
49
+ 'snapshot-create',
50
+ 'snapshot-revert',
51
+ 'snapshot-delete',
52
+ 'disk-snapshot-create',
53
+ 'disk-snapshot-revert',
54
+ 'disk-snapshot-delete'
55
55
  ]
56
56
 
57
57
  STATE = {
@@ -69,52 +69,52 @@ module OpenNebula
69
69
  'HOLD' => 11
70
70
  }
71
71
 
72
- STATE_STR = %w[
73
- PENDING
74
- DEPLOYING
75
- RUNNING
76
- UNDEPLOYING
77
- WARNING
78
- DONE
79
- FAILED_UNDEPLOYING
80
- FAILED_DEPLOYING
81
- SCALING
82
- FAILED_SCALING
83
- COOLDOWN
84
- HOLD
72
+ STATE_STR = [
73
+ 'PENDING',
74
+ 'DEPLOYING',
75
+ 'RUNNING',
76
+ 'UNDEPLOYING',
77
+ 'WARNING',
78
+ 'DONE',
79
+ 'FAILED_UNDEPLOYING',
80
+ 'FAILED_DEPLOYING',
81
+ 'SCALING',
82
+ 'FAILED_SCALING',
83
+ 'COOLDOWN',
84
+ 'HOLD'
85
85
  ]
86
86
 
87
- RECOVER_DEPLOY_STATES = %w[
88
- FAILED_DEPLOYING
89
- DEPLOYING
90
- PENDING
87
+ RECOVER_DEPLOY_STATES = [
88
+ 'FAILED_DEPLOYING',
89
+ 'DEPLOYING',
90
+ 'PENDING'
91
91
  ]
92
92
 
93
- RECOVER_UNDEPLOY_STATES = %w[
94
- FAILED_UNDEPLOYING
95
- UNDEPLOYING
93
+ RECOVER_UNDEPLOY_STATES = [
94
+ 'FAILED_UNDEPLOYING',
95
+ 'UNDEPLOYING'
96
96
  ]
97
97
 
98
- RECOVER_SCALE_STATES = %w[
99
- FAILED_SCALING
100
- SCALING
98
+ RECOVER_SCALE_STATES = [
99
+ 'FAILED_SCALING',
100
+ 'SCALING'
101
101
  ]
102
102
 
103
- VM_FAILURE_STATES = %w[
104
- BOOT_FAILURE
105
- BOOT_MIGRATE_FAILURE
106
- PROLOG_MIGRATE_FAILURE
107
- PROLOG_FAILURE
108
- EPILOG_FAILURE
109
- EPILOG_STOP_FAILURE
110
- EPILOG_UNDEPLOY_FAILURE
111
- PROLOG_MIGRATE_POWEROFF_FAILURE
112
- PROLOG_MIGRATE_SUSPEND_FAILURE
113
- PROLOG_MIGRATE_UNKNOWN_FAILURE
114
- BOOT_UNDEPLOY_FAILURE
115
- BOOT_STOPPED_FAILURE
116
- PROLOG_RESUME_FAILURE
117
- PROLOG_UNDEPLOY_FAILURE
103
+ VM_FAILURE_STATES = [
104
+ 'BOOT_FAILURE',
105
+ 'BOOT_MIGRATE_FAILURE',
106
+ 'PROLOG_MIGRATE_FAILURE',
107
+ 'PROLOG_FAILURE',
108
+ 'EPILOG_FAILURE',
109
+ 'EPILOG_STOP_FAILURE',
110
+ 'EPILOG_UNDEPLOY_FAILURE',
111
+ 'PROLOG_MIGRATE_POWEROFF_FAILURE',
112
+ 'PROLOG_MIGRATE_SUSPEND_FAILURE',
113
+ 'PROLOG_MIGRATE_UNKNOWN_FAILURE',
114
+ 'BOOT_UNDEPLOY_FAILURE',
115
+ 'BOOT_STOPPED_FAILURE',
116
+ 'PROLOG_RESUME_FAILURE',
117
+ 'PROLOG_UNDEPLOY_FAILURE'
118
118
  ]
119
119
 
120
120
  SCALE_WAYS = {
@@ -129,17 +129,17 @@ module OpenNebula
129
129
  # parents: this has only sense in deploy operation
130
130
  # state: this is internal information managed by OneFlow server
131
131
  # vm_template: this will affect scale operation
132
- IMMUTABLE_ATTRS = %w[
133
- cardinality
134
- last_vmname
135
- nodes
136
- parents
137
- state
138
- vm_template
132
+ IMMUTABLE_ATTRS = [
133
+ 'cardinality',
134
+ 'last_vmname',
135
+ 'nodes',
136
+ 'parents',
137
+ 'state',
138
+ 'vm_template'
139
139
  ]
140
140
 
141
141
  # VM information to save in document
142
- VM_INFO = %w[ID UID GID UNAME GNAME NAME]
142
+ VM_INFO = ['ID', 'UID', 'GID', 'UNAME', 'GNAME', 'NAME']
143
143
 
144
144
  LOG_COMP = 'ROL'
145
145
 
@@ -42,64 +42,64 @@ module OpenNebula
42
42
  'HOLD' => 15
43
43
  }
44
44
 
45
- STATE_STR = %w[
46
- PENDING
47
- DEPLOYING
48
- RUNNING
49
- UNDEPLOYING
50
- WARNING
51
- DONE
52
- FAILED_UNDEPLOYING
53
- FAILED_DEPLOYING
54
- SCALING
55
- FAILED_SCALING
56
- COOLDOWN
57
- DEPLOYING_NETS
58
- UNDEPLOYING_NETS
59
- FAILED_DEPLOYING_NETS
60
- FAILED_UNDEPLOYING_NETS
61
- HOLD
45
+ STATE_STR = [
46
+ 'PENDING',
47
+ 'DEPLOYING',
48
+ 'RUNNING',
49
+ 'UNDEPLOYING',
50
+ 'WARNING',
51
+ 'DONE',
52
+ 'FAILED_UNDEPLOYING',
53
+ 'FAILED_DEPLOYING',
54
+ 'SCALING',
55
+ 'FAILED_SCALING',
56
+ 'COOLDOWN',
57
+ 'DEPLOYING_NETS',
58
+ 'UNDEPLOYING_NETS',
59
+ 'FAILED_DEPLOYING_NETS',
60
+ 'FAILED_UNDEPLOYING_NETS',
61
+ 'HOLD'
62
62
  ]
63
63
 
64
- TRANSIENT_STATES = %w[
65
- DEPLOYING
66
- UNDEPLOYING
67
- SCALING
68
- COOLDOWN
69
- DEPLOYING_NETS
70
- UNDEPLOYING_NETS
64
+ TRANSIENT_STATES = [
65
+ 'DEPLOYING',
66
+ 'UNDEPLOYING',
67
+ 'SCALING',
68
+ 'COOLDOWN',
69
+ 'DEPLOYING_NETS',
70
+ 'UNDEPLOYING_NETS'
71
71
  ]
72
72
 
73
- FAILED_STATES = %w[
74
- FAILED_DEPLOYING
75
- FAILED_UNDEPLOYING
76
- FAILED_SCALING
77
- FAILED_DEPLOYING_NETS
78
- FAILED_UNDEPLOYING_NETS
73
+ FAILED_STATES = [
74
+ 'FAILED_DEPLOYING',
75
+ 'FAILED_UNDEPLOYING',
76
+ 'FAILED_SCALING',
77
+ 'FAILED_DEPLOYING_NETS',
78
+ 'FAILED_UNDEPLOYING_NETS'
79
79
  ]
80
80
 
81
- RECOVER_DEPLOY_STATES = %w[
82
- FAILED_DEPLOYING
83
- DEPLOYING
84
- PENDING
81
+ RECOVER_DEPLOY_STATES = [
82
+ 'FAILED_DEPLOYING',
83
+ 'DEPLOYING',
84
+ 'PENDING'
85
85
  ]
86
86
 
87
- RECOVER_UNDEPLOY_STATES = %w[
88
- FAILED_UNDEPLOYING
89
- UNDEPLOYING
90
- FAILED_UNDEPLOYING_NETS
87
+ RECOVER_UNDEPLOY_STATES = [
88
+ 'FAILED_UNDEPLOYING',
89
+ 'UNDEPLOYING',
90
+ 'FAILED_UNDEPLOYING_NETS'
91
91
  ]
92
92
 
93
- RECOVER_SCALE_STATES = %w[
94
- FAILED_SCALING
95
- SCALING
93
+ RECOVER_SCALE_STATES = [
94
+ 'FAILED_SCALING',
95
+ 'SCALING'
96
96
  ]
97
97
 
98
- RECOVER_DEPLOY_NETS_STATES = %w[DEPLOYING_NETS FAILED_DEPLOYING_NETS]
98
+ RECOVER_DEPLOY_NETS_STATES = ['DEPLOYING_NETS', 'FAILED_DEPLOYING_NETS']
99
99
 
100
- RECOVER_UNDEPLOY_NETS_STATES = %w[
101
- UNDEPLOYING_NETS
102
- FAILED_UNDEPLOYING_NETS
100
+ RECOVER_UNDEPLOY_NETS_STATES = [
101
+ 'UNDEPLOYING_NETS',
102
+ 'FAILED_UNDEPLOYING_NETS'
103
103
  ]
104
104
 
105
105
  # List of attributes that can't be changed in update operation
@@ -114,17 +114,17 @@ module OpenNebula
114
114
  # ready_status_gate: it only has sense when deploying, not in running
115
115
  # state: this is internal information managed by OneFlow server
116
116
  # start_time: this is internal information managed by OneFlow server
117
- IMMUTABLE_ATTRS = %w[
118
- custom_attrs
119
- custom_attrs_values
120
- deployment
121
- log
122
- name
123
- networks
124
- networks_values
125
- ready_status_gate
126
- state
127
- start_time
117
+ IMMUTABLE_ATTRS = [
118
+ 'custom_attrs',
119
+ 'custom_attrs_values',
120
+ 'deployment',
121
+ 'log',
122
+ 'name',
123
+ 'networks',
124
+ 'networks_values',
125
+ 'ready_status_gate',
126
+ 'state',
127
+ 'start_time'
128
128
  ]
129
129
 
130
130
  LOG_COMP = 'SER'
@@ -677,7 +677,7 @@ module OpenNebula
677
677
  vnet.each do |_, net|
678
678
  key = net.keys.first
679
679
 
680
- next unless %w[template_id reserve_from].include?(key)
680
+ next unless ['template_id', 'reserve_from'].include?(key)
681
681
 
682
682
  rc = OpenNebula::VirtualNetwork.new_with_id(
683
683
  net['id'],
data/lib/nsx_constants.rb CHANGED
@@ -127,7 +127,7 @@ end
127
127
  }
128
128
  }
129
129
  NSXV_RULE_BASE = 'xxx'
130
- NSX_RULE_IPSEC_PORTS = %w[500 4500]
130
+ NSX_RULE_IPSEC_PORTS = ['500', '4500']
131
131
  # Logical Ports
132
132
  NSXT_LP_BASE = NSXT_BASE + '/logical-ports/'
133
133
  NSXV_LP_BASE = ''
@@ -50,11 +50,11 @@ module OpenNebula
50
50
  },
51
51
  'shutdown_action' => {
52
52
  :type => :string,
53
- :enum => %w[
54
- terminate
55
- terminate-hard
56
- shutdown
57
- shutdown-hard
53
+ :enum => [
54
+ 'terminate',
55
+ 'terminate-hard',
56
+ 'shutdown',
57
+ 'shutdown-hard'
58
58
  ],
59
59
  :required => false
60
60
  },
@@ -84,10 +84,10 @@ module OpenNebula
84
84
  :properties => {
85
85
  'type' => {
86
86
  :type => :string,
87
- :enum => %w[
88
- CHANGE
89
- CARDINALITY
90
- PERCENTAGE_CHANGE
87
+ :enum => [
88
+ 'CHANGE',
89
+ 'CARDINALITY',
90
+ 'PERCENTAGE_CHANGE'
91
91
  ],
92
92
  :required => true
93
93
  },
@@ -133,10 +133,10 @@ module OpenNebula
133
133
  :properties => {
134
134
  'type' => {
135
135
  :type => :string,
136
- :enum => %w[
137
- CHANGE
138
- CARDINALITY
139
- PERCENTAGE_CHANGE
136
+ :enum => [
137
+ 'CHANGE',
138
+ 'CARDINALITY',
139
+ 'PERCENTAGE_CHANGE'
140
140
  ],
141
141
  :required => true
142
142
  },
@@ -172,7 +172,7 @@ module OpenNebula
172
172
  },
173
173
  'deployment' => {
174
174
  :type => :string,
175
- :enum => %w[none straight],
175
+ :enum => ['none', 'straight'],
176
176
  :default => 'none'
177
177
  },
178
178
  'description' => {
@@ -181,11 +181,11 @@ module OpenNebula
181
181
  },
182
182
  'shutdown_action' => {
183
183
  :type => :string,
184
- :enum => %w[
185
- terminate
186
- terminate-hard
187
- shutdown
188
- shutdown-hard
184
+ :enum => [
185
+ 'terminate',
186
+ 'terminate-hard',
187
+ 'shutdown',
188
+ 'shutdown-hard'
189
189
  ],
190
190
  :required => false
191
191
  },
@@ -235,8 +235,8 @@ module OpenNebula
235
235
  # List of attributes that can't be changed in update operation
236
236
  #
237
237
  # registration_time: this is internal info managed by OneFlow server
238
- IMMUTABLE_ATTRS = %w[
239
- registration_time
238
+ IMMUTABLE_ATTRS = [
239
+ 'registration_time'
240
240
  ]
241
241
 
242
242
  def self.init_default_vn_name_template(vn_name_template)
@@ -314,9 +314,9 @@ module OpenNebula::MarketPlaceAppExt
314
314
  # @param image [OpenNebula::Image] Image information
315
315
  def create_vcenter_template(ds, options, template, image = nil)
316
316
  ret = {}
317
- keys = %w[VCENTER_TEMPLATE_REF
318
- VCENTER_CCR_REF
319
- VCENTER_INSTANCE_ID]
317
+ keys = ['VCENTER_TEMPLATE_REF',
318
+ 'VCENTER_CCR_REF',
319
+ 'VCENTER_INSTANCE_ID']
320
320
 
321
321
  if ds['//VCENTER_TEMPLATE_REF']
322
322
  keys.each do |key|
@@ -79,7 +79,7 @@ module OpenNebula::TemplateExt
79
79
  image['STATE'].to_i
80
80
  ]
81
81
 
82
- unless %w[LOCKED READY USED].include?(i_state)
82
+ unless ['LOCKED', 'READY', 'USED'].include?(i_state)
83
83
  logger.fatal "Wrong image state #{i_state}" if logger
84
84
 
85
85
  rollback(ids)
@@ -204,7 +204,7 @@ module OpenNebula::TemplateExt
204
204
  # @param nic [XMLElement] to delete attributes from
205
205
  #-------------------------------------------------------------------
206
206
  def delete_nic_attributes(nic)
207
- %w[NETWORK NETWORK_ID NETWORK_UNAME SECURITY_GROUPS].each do |a|
207
+ ['NETWORK', 'NETWORK_ID', 'NETWORK_UNAME', 'SECURITY_GROUPS'].each do |a|
208
208
  nic.delete_element(a)
209
209
  end
210
210
  end
@@ -47,17 +47,16 @@ module OpenNebula::VirtualMachineExt
47
47
  # @return [Integer, OpenNebula::Error] the new Template ID in case
48
48
  # of success, error otherwise
49
49
  #-------------------------------------------------------------------
50
- REMOVE_VNET_ATTRS = %w[AR_ID BRIDGE CLUSTER_ID IP MAC TARGET NIC_ID
51
- NETWORK_ID VN_MAD SECURITY_GROUPS VLAN_ID
52
- BRIDGE_TYPE]
53
-
54
- REMOVE_IMAGE_ATTRS = %w[DEV_PREFIX SOURCE ORIGINAL_SIZE SIZE
55
- DISK_SNAPSHOT_TOTAL_SIZE DRIVER IMAGE_STATE
56
- SAVE CLONE READONLY PERSISTENT TARGET
57
- ALLOW_ORPHANS CLONE_TARGET CLUSTER_ID
58
- DATASTORE DATASTORE_ID DISK_ID DISK_TYPE
59
- IMAGE_ID IMAGE IMAGE_UNAME IMAGE_UID
60
- LN_TARGET TM_MAD TYPE OPENNEBULA_MANAGED]
50
+ REMOVE_VNET_ATTRS = ['AR_ID', 'BRIDGE', 'CLUSTER_ID', 'IP', 'MAC', 'TARGET', 'NIC_ID',
51
+ 'NETWORK_ID', 'VN_MAD', 'SECURITY_GROUPS', 'VLAN_ID',
52
+ 'BRIDGE_TYPE']
53
+
54
+ REMOVE_IMAGE_ATTRS = ['DEV_PREFIX', 'SOURCE', 'ORIGINAL_SIZE', 'SIZE',
55
+ 'DISK_SNAPSHOT_TOTAL_SIZE', 'DRIVER', 'IMAGE_STATE', 'SAVE',
56
+ 'CLONE', 'READONLY', 'PERSISTENT', 'TARGET', 'ALLOW_ORPHANS',
57
+ 'CLONE_TARGET', 'CLUSTER_ID', 'DATASTORE', 'DATASTORE_ID',
58
+ 'DISK_ID', 'DISK_TYPE', 'IMAGE_ID', 'IMAGE', 'IMAGE_UNAME',
59
+ 'IMAGE_UID', 'LN_TARGET', 'TM_MAD', 'TYPE', 'OPENNEBULA_MANAGED']
61
60
 
62
61
  def save_as_template(name, desc, opts = {})
63
62
  opts = {
data/lib/opennebula.rb CHANGED
@@ -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.4.4'
81
81
  end
@@ -1126,7 +1126,7 @@ end
1126
1126
  when OPAQUE_CARD.to_s
1127
1127
  # Select only Opaque Networks
1128
1128
  opaque_networks = @item.network.select do |net|
1129
- RbVmomi::VIM::OpaqueNetwork == net.class
1129
+ net.class == RbVmomi::VIM::OpaqueNetwork
1130
1130
  end
1131
1131
  opaque_network = opaque_networks.find do |opn|
1132
1132
  backing.opaqueNetworkId == opn.summary.opaqueNetworkId
@@ -1296,7 +1296,7 @@ end
1296
1296
  when OPAQUE_CARD.to_s
1297
1297
  # Select only Opaque Networks
1298
1298
  opaque_networks = @item.network.select do |net|
1299
- RbVmomi::VIM::OpaqueNetwork == net.class
1299
+ net.class == RbVmomi::VIM::OpaqueNetwork
1300
1300
  end
1301
1301
  opaque_network = opaque_networks.find do |opn|
1302
1302
  nic.backing.opaqueNetworkId ==
@@ -3302,6 +3302,12 @@ end
3302
3302
  @item.MarkAsTemplate
3303
3303
  end
3304
3304
 
3305
+ def mark_as_virtual_machine
3306
+ @item.MarkAsVirtualMachine(
3307
+ :pool => cluster['resourcePool']
3308
+ )
3309
+ end
3310
+
3305
3311
  def reset
3306
3312
  @item.ResetVM_Task.wait_for_completion
3307
3313
  end
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.4.3
4
+ version: 6.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-30 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri