foreman_xen 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -9
- data/app/controllers/foreman_xen/snapshots_controller.rb +1 -0
- data/app/helpers/xen_compute_helper.rb +5 -7
- data/app/models/foreman_xen/xenserver.rb +10 -6
- data/lib/foreman_xen/engine.rb +2 -2
- data/lib/foreman_xen/version.rb +1 -1
- data/lib/foreman_xen/vnc_tunnel.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cdd6bcd07d559882c14aeb7ff2846ec2374c6d2d499106a3164a8e69209d667
|
4
|
+
data.tar.gz: adec7df98c1e131f35aeac15e51fd13c74df1db4149a352f656c7cde6715344a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa108f441b9d2b3fa86d6a92c0dfad446bef725be5516564071b155757c85c457384d1e1024331ff077e641b1d2e75a0a9cc558cf58c979979b0a2a4866e5499
|
7
|
+
data.tar.gz: e50152b26e2a04b0b341f9e7ee3e3143ff2611595ab7d773f1da82b2690b91fe59b7586ab3290e459882e1a314e7f0657d7f34c314b8d66a5969f4f9273576c2
|
data/README.md
CHANGED
@@ -15,15 +15,16 @@ Please see the Foreman manual for further instructions:
|
|
15
15
|
|
16
16
|
## Compatibility
|
17
17
|
|
18
|
-
| Foreman Version | Plugin Version
|
19
|
-
|
20
|
-
| >=1.5, <1.8 | 0.0.x (unmaintained)
|
21
|
-
| >=1.8.1, <1.10 | 0.1.x (unmaintained)
|
22
|
-
| >=1.10, <1.11 | 0.2.x (unmaintained)
|
23
|
-
| >=1.11, <1.13 | 0.3.x (unmaintained)
|
24
|
-
| >=1.13, <1.14 | 0.4.x (unmaintained)
|
25
|
-
| >=1.14, <1.17 | 0.5.x
|
26
|
-
| >=1.17
|
18
|
+
| Foreman Version | Plugin Version |
|
19
|
+
| --------------- | ---------------------|
|
20
|
+
| >=1.5, <1.8 | 0.0.x (unmaintained) |
|
21
|
+
| >=1.8.1, <1.10 | 0.1.x (unmaintained) |
|
22
|
+
| >=1.10, <1.11 | 0.2.x (unmaintained) |
|
23
|
+
| >=1.11, <1.13 | 0.3.x (unmaintained) |
|
24
|
+
| >=1.13, <1.14 | 0.4.x (unmaintained) |
|
25
|
+
| >=1.14, <1.17 | 0.5.x (unmaintained) |
|
26
|
+
| >=1.17, <1.18 | 0.6.x (unmaintained) |
|
27
|
+
| >=1.18 | 0.7.x |
|
27
28
|
|
28
29
|
## Support
|
29
30
|
|
@@ -31,19 +31,17 @@ module XenComputeHelper
|
|
31
31
|
compute_attributes = compute_resource.compute_profile_attributes_for(params['host']['compute_profile_id'])
|
32
32
|
attribute_map = filter_compute_attributes(attribute_map, compute_attributes)
|
33
33
|
elsif new
|
34
|
-
attribute_map[:cpu_count] = new.vcpus_max
|
35
|
-
attribute_map[:memory_min] = new.memory_static_min
|
36
|
-
attribute_map[:memory_max] = new.memory_static_max
|
34
|
+
attribute_map[:cpu_count] = new.vcpus_max || nil
|
35
|
+
attribute_map[:memory_min] = new.memory_static_min || nil
|
36
|
+
attribute_map[:memory_max] = new.memory_static_max || nil
|
37
37
|
if new.vbds
|
38
38
|
vdi = new.vbds.first.vdi
|
39
39
|
if vdi
|
40
|
-
attribute_map[:volume_selected] = vdi.sr.uuid
|
40
|
+
attribute_map[:volume_selected] = vdi.sr.uuid || nil
|
41
41
|
attribute_map[:volume_size] = vdi.virtual_size ? (vdi.virtual_size.to_i / 1_073_741_824).to_s : nil
|
42
42
|
end
|
43
43
|
end
|
44
|
-
if new.vifs
|
45
|
-
attribute_map[:network_selected] = new.vifs.first.network.name ? new.vifs.first.network.name : nil
|
46
|
-
end
|
44
|
+
attribute_map[:network_selected] = new.vifs.first.network.name || nil if new.vifs
|
47
45
|
end
|
48
46
|
attribute_map
|
49
47
|
end
|
@@ -19,6 +19,7 @@ module ForemanXen
|
|
19
19
|
Foreman::Logging.exception("Failed retrieving xenserver vm by uuid #{uuid}", e)
|
20
20
|
raise(ActiveRecord::RecordNotFound) if e.message.include?('HANDLE_INVALID')
|
21
21
|
raise(ActiveRecord::RecordNotFound) if e.message.include?('VM.get_record: ["SESSION_INVALID"')
|
22
|
+
|
22
23
|
raise e
|
23
24
|
end
|
24
25
|
|
@@ -92,6 +93,7 @@ module ForemanXen
|
|
92
93
|
|
93
94
|
available_hypervisors.each do |host|
|
94
95
|
next unless sr.reference == host.suspend_image_sr
|
96
|
+
|
95
97
|
found = true
|
96
98
|
subresults[:name] = sr.name
|
97
99
|
subresults[:display_name] = sr.name + '(' + host.hostname + ')'
|
@@ -161,10 +163,11 @@ module ForemanXen
|
|
161
163
|
|
162
164
|
def find_snapshots_for_vm(vm)
|
163
165
|
return [] if vm.snapshots.empty?
|
166
|
+
|
164
167
|
tmps = begin
|
165
168
|
client.servers.templates.select(&:is_a_snapshot)
|
166
|
-
|
167
|
-
|
169
|
+
rescue
|
170
|
+
[]
|
168
171
|
end
|
169
172
|
retval = []
|
170
173
|
tmps.each do |snapshot|
|
@@ -176,8 +179,8 @@ module ForemanXen
|
|
176
179
|
def find_snapshots
|
177
180
|
tmps = begin
|
178
181
|
client.servers.templates.select(&:is_a_snapshot)
|
179
|
-
|
180
|
-
|
182
|
+
rescue
|
183
|
+
[]
|
181
184
|
end
|
182
185
|
tmps.sort_by(&:name)
|
183
186
|
end
|
@@ -185,6 +188,7 @@ module ForemanXen
|
|
185
188
|
def new_vm(attr = {})
|
186
189
|
test_connection
|
187
190
|
return unless errors.empty?
|
191
|
+
|
188
192
|
opts = vm_instance_defaults.merge(attr.to_hash).symbolize_keys
|
189
193
|
|
190
194
|
%i[networks volumes].each do |collection|
|
@@ -368,8 +372,7 @@ module ForemanXen
|
|
368
372
|
protected
|
369
373
|
|
370
374
|
def client
|
371
|
-
@client ||=
|
372
|
-
:provider => 'XenServer',
|
375
|
+
@client ||= Fog::XenServer::Compute.new(
|
373
376
|
:xenserver_url => url,
|
374
377
|
:xenserver_username => user,
|
375
378
|
:xenserver_password => password,
|
@@ -423,6 +426,7 @@ module ForemanXen
|
|
423
426
|
|
424
427
|
def get_hypervisor_host(args)
|
425
428
|
return client.hosts.first unless args[:hypervisor_host] != ''
|
429
|
+
|
426
430
|
client.hosts.find { |host| host.name == args[:hypervisor_host] }
|
427
431
|
end
|
428
432
|
|
data/lib/foreman_xen/engine.rb
CHANGED
@@ -42,11 +42,11 @@ module ForemanXen
|
|
42
42
|
config.to_prepare do
|
43
43
|
begin
|
44
44
|
# extend fog xen server and image models.
|
45
|
-
require 'fog/compute/
|
45
|
+
require 'fog/xenserver/compute/models/server'
|
46
46
|
require File.expand_path('../../app/models/concerns/fog_extensions/xenserver/server', __dir__)
|
47
47
|
require File.expand_path('../../app/models/concerns/foreman_xen/host_helper_extensions', __dir__)
|
48
48
|
|
49
|
-
Fog::Compute::
|
49
|
+
Fog::XenServer::Compute::Server.send(:include, ::FogExtensions::Xenserver::Server)
|
50
50
|
::HostsHelper.send(:include, ForemanXen::HostHelperExtensions)
|
51
51
|
rescue => e
|
52
52
|
Rails.logger.warn "Foreman-Xen: skipping engine hook (#{e})"
|
data/lib/foreman_xen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_xen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Nemirovsky
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-11-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fog-xenserver
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0
|
21
|
+
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '0
|
28
|
+
version: '1.0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,9 +81,9 @@ files:
|
|
81
81
|
- locale/Makefile
|
82
82
|
- test/foreman_xen_test.rb
|
83
83
|
- test/test_helper.rb
|
84
|
-
homepage:
|
84
|
+
homepage: https://github.com/theforeman/foreman-xen
|
85
85
|
licenses:
|
86
|
-
- GPL-3
|
86
|
+
- GPL-3.0
|
87
87
|
metadata: {}
|
88
88
|
post_install_message:
|
89
89
|
rdoc_options: []
|