vagrant-libvirt 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -15
- data/lib/vagrant-libvirt/action.rb +2 -0
- data/lib/vagrant-libvirt/action/create_domain.rb +12 -0
- data/lib/vagrant-libvirt/action/read_ssh_info.rb +0 -5
- data/lib/vagrant-libvirt/config.rb +22 -0
- data/lib/vagrant-libvirt/templates/domain.xml.erb +7 -5
- data/lib/vagrant-libvirt/util/network_util.rb +3 -2
- data/lib/vagrant-libvirt/version.rb +1 -1
- data/vagrant-libvirt.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51177f85551c960b41b4ff1a07c5d26a5c0c9e04
|
4
|
+
data.tar.gz: 0aa138d06f5c151c96a05b891efe0a1ea6cf95cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6efc95bb91d5ffdee56802775ab3b485c3c7ee70578b31f254a394b6adbbeaa46e6ea644260c9edd9d64d734e8c6dc2db88bb689482b3dddf3389568d30c13c9
|
7
|
+
data.tar.gz: a7afeebe910244f5e92058040baa3baeb4167c9058ac5b40de30d17d823b80aaa2370f0456474c8adab65cd82588b99e2280ccef65e7ac163c592435ae5b1b11
|
data/README.md
CHANGED
@@ -151,6 +151,11 @@ end
|
|
151
151
|
* `initrd` - To specify the initramfs/initrd to use for the guest. Equivalent to qemu `-initrd`.
|
152
152
|
* `random_hostname` - To create a domain name with extra information on the end to prevent hostname conflicts.
|
153
153
|
* `cmd_line` - Arguments passed on to the guest kernel initramfs or initrd to use. Equivalent to qemu `-append`.
|
154
|
+
* `graphics_type` - Sets the protocol used to expose the guest display. Defaults to `vnc`. Possible values are "sdl", "curses", "none", "gtk", or "vnc".
|
155
|
+
* `graphics_port` - Sets the port for the display protocol to bind to. Defaults to 5900.
|
156
|
+
* `graphics_ip` - Sets the IP for the display protocol to bind to. Defaults to "127.0.0.0.1".
|
157
|
+
* `video_type` - Sets the graphics card type exposed to the guest. Defaults to "cirrus". Possible values are "cirrus", "std", "vmware", "qxl", "tcx", "cg3", or "none".
|
158
|
+
* `video_vram` - Used by some graphics card types to vary the amount of RAM dedicated to video. Defaults to 9216.
|
154
159
|
|
155
160
|
|
156
161
|
Specific domain settings can be set for each domain separately in multi-VM
|
@@ -289,21 +294,7 @@ end
|
|
289
294
|
|
290
295
|
## SSH Access To VM
|
291
296
|
|
292
|
-
|
293
|
-
Vagrantfile. Untill provider version 0.0.5, root user was hardcoded and used to
|
294
|
-
access VMs ssh. Now, vagrant user is used by default, but it's configurable via
|
295
|
-
`config.ssh.username` option in Vagrantfile now.
|
296
|
-
|
297
|
-
If you are still using CentOS 6.4 box from example in this README, please set
|
298
|
-
ssh username back to root, because user vagrant is not usable (I forgot to add
|
299
|
-
necessary ssh key to his authorized_keys).
|
300
|
-
|
301
|
-
Configurable ssh parameters in Vagrantfile after provider version 0.0.5 are:
|
302
|
-
|
303
|
-
* `config.ssh.username` - Default is username vagrant.
|
304
|
-
* `config.ssh.guest_port` - Default port is set to 22.
|
305
|
-
* `config.ssh.forward_agent` - Default is false.
|
306
|
-
* `config.ssh.forward_x11` - Default is false.
|
297
|
+
vagrant-libvirt supports vagrant's [standard ssh settings](https://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html).
|
307
298
|
|
308
299
|
## Forwarded Ports
|
309
300
|
|
@@ -329,6 +320,23 @@ it an setting the type, e.g.
|
|
329
320
|
|
330
321
|
config.vm.synced_folder './', '/vagrant', type: 'rsync'
|
331
322
|
|
323
|
+
## Customized Graphics
|
324
|
+
|
325
|
+
vagrant-libvirt supports customizing the display and video settings of the
|
326
|
+
managed guest. This is probably most useful for VNC-type displays with multiple
|
327
|
+
guests. It lets you specify the exact port for each guest to use deterministically.
|
328
|
+
|
329
|
+
Here is an example of using custom display options:
|
330
|
+
|
331
|
+
```ruby
|
332
|
+
Vagrant.configure("2") do |config|
|
333
|
+
config.vm.provider :libvirt do |libvirt|
|
334
|
+
libvirt.graphics_port = 5901
|
335
|
+
libvirt.graphics_ip = '0.0.0.0'
|
336
|
+
libvirt.video_type = 'qxl'
|
337
|
+
end
|
338
|
+
end
|
339
|
+
```
|
332
340
|
|
333
341
|
## Box Format
|
334
342
|
|
@@ -35,6 +35,12 @@ module VagrantPlugins
|
|
35
35
|
@kernel = config.kernel
|
36
36
|
@cmd_line = config.cmd_line
|
37
37
|
@initrd = config.initrd
|
38
|
+
@graphics_type = config.graphics_type
|
39
|
+
@graphics_autoport = config.graphics_autoport
|
40
|
+
@graphics_port = config.graphics_port
|
41
|
+
@graphics_ip = config.graphics_ip
|
42
|
+
@video_type = config.video_type
|
43
|
+
@video_vram = config.video_vram
|
38
44
|
|
39
45
|
# Storage
|
40
46
|
@storage_pool_name = config.storage_pool_name
|
@@ -89,6 +95,12 @@ module VagrantPlugins
|
|
89
95
|
env[:ui].info(" -- Volume Cache: #{@domain_volume_cache}")
|
90
96
|
env[:ui].info(" -- Kernel: #{@kernel}")
|
91
97
|
env[:ui].info(" -- Initrd: #{@initrd}")
|
98
|
+
env[:ui].info(" -- Graphics Type: #{@graphics_type}")
|
99
|
+
env[:ui].info(" -- Graphics Port: #{@graphics_port}")
|
100
|
+
env[:ui].info(" -- Graphics IP: #{@graphics_ip}")
|
101
|
+
env[:ui].info(" -- Video Type: #{@video_type}")
|
102
|
+
env[:ui].info(" -- Video VRAM: #{@video_vram}")
|
103
|
+
|
92
104
|
if @disks.length > 0
|
93
105
|
env[:ui].info(" -- Disks: #{_disks_print(@disks)}")
|
94
106
|
end
|
@@ -43,17 +43,12 @@ module VagrantPlugins
|
|
43
43
|
ssh_info = {
|
44
44
|
:host => ip_address,
|
45
45
|
:port => machine.config.ssh.guest_port,
|
46
|
-
:username => machine.config.ssh.username,
|
47
46
|
:forward_agent => machine.config.ssh.forward_agent,
|
48
47
|
:forward_x11 => machine.config.ssh.forward_x11,
|
49
48
|
}
|
50
49
|
|
51
50
|
ssh_info[:proxy_command] = "ssh '#{machine.provider_config.host}' -l '#{machine.provider_config.username}' nc %h %p" if machine.provider_config.connect_via_ssh
|
52
51
|
|
53
|
-
if not ssh_info[:username]
|
54
|
-
ssh_info[:username] = machine.config.ssh.default.username
|
55
|
-
end
|
56
|
-
|
57
52
|
ssh_info
|
58
53
|
end
|
59
54
|
end
|
@@ -46,6 +46,7 @@ module VagrantPlugins
|
|
46
46
|
# Libvirt default network
|
47
47
|
attr_accessor :management_network_name
|
48
48
|
attr_accessor :management_network_address
|
49
|
+
attr_accessor :management_network_mode
|
49
50
|
|
50
51
|
# Default host prefix (alternative to use project folder name)
|
51
52
|
attr_accessor :default_prefix
|
@@ -61,6 +62,12 @@ module VagrantPlugins
|
|
61
62
|
attr_accessor :kernel
|
62
63
|
attr_accessor :cmd_line
|
63
64
|
attr_accessor :initrd
|
65
|
+
attr_accessor :graphics_type
|
66
|
+
attr_accessor :graphics_autoport
|
67
|
+
attr_accessor :graphics_port
|
68
|
+
attr_accessor :graphics_ip
|
69
|
+
attr_accessor :video_type
|
70
|
+
attr_accessor :video_vram
|
64
71
|
|
65
72
|
# Storage
|
66
73
|
attr_accessor :disks
|
@@ -77,6 +84,7 @@ module VagrantPlugins
|
|
77
84
|
@random_hostname = UNSET_VALUE
|
78
85
|
@management_network_name = UNSET_VALUE
|
79
86
|
@management_network_address = UNSET_VALUE
|
87
|
+
@management_network_mode = UNSET_VALUE
|
80
88
|
|
81
89
|
# Domain specific settings.
|
82
90
|
@memory = UNSET_VALUE
|
@@ -89,6 +97,12 @@ module VagrantPlugins
|
|
89
97
|
@kernel = UNSET_VALUE
|
90
98
|
@initrd = UNSET_VALUE
|
91
99
|
@cmd_line = UNSET_VALUE
|
100
|
+
@graphics_type = UNSET_VALUE
|
101
|
+
@graphics_autoport = UNSET_VALUE
|
102
|
+
@graphics_port = UNSET_VALUE
|
103
|
+
@graphics_ip = UNSET_VALUE
|
104
|
+
@video_type = UNSET_VALUE
|
105
|
+
@video_vram = UNSET_VALUE
|
92
106
|
|
93
107
|
# Storage
|
94
108
|
@disks = UNSET_VALUE
|
@@ -191,6 +205,7 @@ module VagrantPlugins
|
|
191
205
|
@random_hostname = false if @random_hostname == UNSET_VALUE
|
192
206
|
@management_network_name = 'vagrant-libvirt' if @management_network_name == UNSET_VALUE
|
193
207
|
@management_network_address = '192.168.121.0/24' if @management_network_address == UNSET_VALUE
|
208
|
+
@management_network_mode = 'nat' if @management_network_address == UNSET_VALUE
|
194
209
|
|
195
210
|
# generate a URI if none is supplied
|
196
211
|
@uri = _generate_uri() if @uri == UNSET_VALUE
|
@@ -206,6 +221,13 @@ module VagrantPlugins
|
|
206
221
|
@kernel = nil if @kernel == UNSET_VALUE
|
207
222
|
@cmd_line = '' if @cmd_line == UNSET_VALUE
|
208
223
|
@initrd = '' if @initrd == UNSET_VALUE
|
224
|
+
@graphics_type = 'vnc' if @graphics_type == UNSET_VALUE
|
225
|
+
@graphics_autoport = 'yes' if @graphics_port == UNSET_VALUE
|
226
|
+
@graphics_autoport = 'no' if @graphics_port != UNSET_VALUE
|
227
|
+
@graphics_port = 5900 if @graphics_port == UNSET_VALUE
|
228
|
+
@graphics_ip = '127.0.0.1' if @graphics_ip == UNSET_VALUE
|
229
|
+
@video_type = 'cirrus' if @video_type == UNSET_VALUE
|
230
|
+
@video_vram = 9216 if @video_vram == UNSET_VALUE
|
209
231
|
|
210
232
|
# Storage
|
211
233
|
@disks = [] if @disks == UNSET_VALUE
|
@@ -5,9 +5,11 @@
|
|
5
5
|
|
6
6
|
<% if @nested %>
|
7
7
|
<cpu mode='<%= @cpu_mode %>'>
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
<% if @cpu_mode != 'host-passthrough' %>
|
9
|
+
<model fallback='allow'>qemu64</model>
|
10
|
+
<feature policy='optional' name='vmx'/>
|
11
|
+
<feature policy='optional' name='svm'/>
|
12
|
+
<% end %>
|
11
13
|
</cpu>
|
12
14
|
<% end %>
|
13
15
|
|
@@ -49,9 +51,9 @@
|
|
49
51
|
<target port='0'/>
|
50
52
|
</console>
|
51
53
|
<input type='mouse' bus='ps2'/>
|
52
|
-
<graphics type='
|
54
|
+
<graphics type='<%= @graphics_type %>' port='<%= @graphics_port %>' autoport='<%= @graphics_autoport %>' listen='<%= @graphics_ip %>' keymap='en-us'/>
|
53
55
|
<video>
|
54
|
-
|
56
|
+
<model type='<%= @video_type %>' vram='<%= @video_vram %>' heads='1'/>
|
55
57
|
</video>
|
56
58
|
</devices>
|
57
59
|
</domain>
|
@@ -10,7 +10,8 @@ module VagrantPlugins
|
|
10
10
|
def configured_networks(env, logger)
|
11
11
|
management_network_name = env[:machine].provider_config.management_network_name
|
12
12
|
management_network_address = env[:machine].provider_config.management_network_address
|
13
|
-
|
13
|
+
management_network_mode = env[:machine].provider_config.management_network_mode
|
14
|
+
logger.info "Using #{management_network_name} at #{management_network_address} as the management network #{management_network_mode} is the mode"
|
14
15
|
|
15
16
|
begin
|
16
17
|
management_network_ip = IPAddr.new(management_network_address)
|
@@ -33,7 +34,7 @@ module VagrantPlugins
|
|
33
34
|
ip: $1,
|
34
35
|
netmask: $2,
|
35
36
|
dhcp_enabled: true,
|
36
|
-
forward_mode:
|
37
|
+
forward_mode: management_network_mode,
|
37
38
|
}
|
38
39
|
|
39
40
|
# add management network to list of networks to check
|
data/vagrant-libvirt.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
|
|
22
22
|
|
23
23
|
gem.add_runtime_dependency 'fog', '1.15'
|
24
24
|
gem.add_runtime_dependency 'ruby-libvirt', '0.4.0'
|
25
|
-
gem.add_runtime_dependency 'nokogiri', '1.6'
|
25
|
+
gem.add_runtime_dependency 'nokogiri', '~> 1.6.0'
|
26
26
|
|
27
27
|
gem.add_development_dependency 'rake', '10.1.0'
|
28
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-09-
|
13
|
+
date: 2014-09-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-core
|
@@ -86,16 +86,16 @@ dependencies:
|
|
86
86
|
name: nokogiri
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
91
|
+
version: 1.6.0
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
98
|
+
version: 1.6.0
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: rake
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|