mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-01-08 23:13:08 -06:00
added boot_order option
This commit is contained in:
parent
76942c38ba
commit
6c0d15288e
@ -54,6 +54,9 @@ module VagrantPlugins
|
||||
@video_type = config.video_type
|
||||
@video_vram = config.video_vram
|
||||
@keymap = config.keymap
|
||||
|
||||
# Boot order
|
||||
@boot_order = config.boot_order
|
||||
|
||||
# Storage
|
||||
@storage_pool_name = config.storage_pool_name
|
||||
@ -124,6 +127,10 @@ module VagrantPlugins
|
||||
env[:ui].info(" -- Video Type: #{@video_type}")
|
||||
env[:ui].info(" -- Video VRAM: #{@video_vram}")
|
||||
env[:ui].info(" -- Keymap: #{@keymap}")
|
||||
|
||||
@boot_order.each do |device|
|
||||
env[:ui].info(" -- Boot device: #{device}")
|
||||
end
|
||||
|
||||
if @disks.length > 0
|
||||
env[:ui].info(" -- Disks: #{_disks_print(@disks)}")
|
||||
@ -150,6 +157,7 @@ module VagrantPlugins
|
||||
# Is there a way to tell fog to create new domain with already
|
||||
# existing volume? Use domain creation from template..
|
||||
begin
|
||||
print to_xml('domain')
|
||||
server = env[:libvirt_compute].servers.create(
|
||||
xml: to_xml('domain'))
|
||||
rescue Fog::Errors::Error => e
|
||||
|
@ -55,6 +55,7 @@ module VagrantPlugins
|
||||
attr_accessor :memory
|
||||
attr_accessor :cpus
|
||||
attr_accessor :cpu_mode
|
||||
attr_accessor :boot_order
|
||||
attr_accessor :machine_type
|
||||
attr_accessor :machine_arch
|
||||
attr_accessor :disk_bus
|
||||
@ -113,10 +114,23 @@ module VagrantPlugins
|
||||
@video_vram = UNSET_VALUE
|
||||
@keymap = UNSET_VALUE
|
||||
|
||||
# Boot order
|
||||
@boot_order = []
|
||||
# Storage
|
||||
@disks = []
|
||||
@cdroms = []
|
||||
end
|
||||
|
||||
def _handle_boot_order(options={})
|
||||
boot_order = {
|
||||
:dev => options[:dev]
|
||||
}
|
||||
@boot_order << boot_order # append
|
||||
end
|
||||
|
||||
def boot(options={})
|
||||
_handle_boot_order(options)
|
||||
end
|
||||
|
||||
def _get_device(disks)
|
||||
# skip existing devices and also the first one (vda)
|
||||
@ -299,6 +313,9 @@ module VagrantPlugins
|
||||
@video_type = 'cirrus' if @video_type == UNSET_VALUE
|
||||
@video_vram = 9216 if @video_vram == UNSET_VALUE
|
||||
@keymap = 'en-us' if @keymap == UNSET_VALUE
|
||||
|
||||
# Boot order
|
||||
@boot_order = [] if @boot_order == UNSET_VALUE
|
||||
|
||||
# Storage
|
||||
@disks = [] if @disks == UNSET_VALUE
|
||||
|
@ -27,7 +27,9 @@
|
||||
<type>hvm</type>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<boot dev='hd'/>
|
||||
<% @boot_order.each do |b| %>
|
||||
<boot dev='<%= b[:dev] %>'/>
|
||||
<% end %>
|
||||
<kernel><%= @kernel %></kernel>
|
||||
<initrd><%= @initrd %></initrd>
|
||||
<cmdline><%= @cmd_line %></cmdline>
|
||||
|
@ -19,7 +19,7 @@ class EnvironmentHelper
|
||||
1024
|
||||
end
|
||||
|
||||
%w(cpus cpu_mode machine_type disk_bus nested volume_cache kernel cmd_line initrd graphics_type graphics_autoport graphics_port graphics_ip graphics_passwd video_type video_vram keymap storage_pool_name disks cdroms driver).each do |name|
|
||||
%w(cpus cpu_mode boot_order machine_type disk_bus nested volume_cache kernel cmd_line initrd graphics_type graphics_autoport graphics_port graphics_ip graphics_passwd video_type video_vram keymap storage_pool_name disks cdroms driver).each do |name|
|
||||
define_method(name.to_sym) do
|
||||
nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user