mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Use per device boot order when boot_order is set
This allows for network boot with any of the NICs that are defined instead of only from the primary NIC.
This commit is contained in:
parent
fd4efde95e
commit
dc2f5cb4aa
@ -20,6 +20,7 @@ module VagrantPlugins
|
||||
config = env[:machine].provider_config
|
||||
@nic_model_type = config.nic_model_type
|
||||
@nic_adapter_count = config.nic_adapter_count
|
||||
@boot_order = config.boot_order
|
||||
@app = app
|
||||
end
|
||||
|
||||
|
@ -28,12 +28,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @boot_order.count >= 1 %>
|
||||
<% @boot_order.each do |b| %>
|
||||
<boot dev='<%= b %>'/>
|
||||
<% end %>
|
||||
<bootmenu enable='yes'/>
|
||||
<% else %>
|
||||
<boot dev='hd' />
|
||||
<% end %>
|
||||
<kernel><%= @kernel %></kernel>
|
||||
<initrd><%= @initrd %></initrd>
|
||||
@ -51,6 +46,11 @@
|
||||
<source file='<%= @domain_volume_path %>'/>
|
||||
<%# we need to ensure a unique target dev -%>
|
||||
<target dev='vda' bus='<%= @disk_bus %>'/>
|
||||
<% if @boot_order[0] == 'hd' %>
|
||||
<boot order='1'/>
|
||||
<% elsif @boot_order.count >= 1 %>
|
||||
<boot order='9'/>
|
||||
<% end %>
|
||||
</disk>
|
||||
<%# additional disks -%>
|
||||
<% @disks.each do |d| -%>
|
||||
|
@ -6,5 +6,10 @@
|
||||
<target dev='vnet<%= @iface_number %>'/>
|
||||
<alias name='net<%= @iface_number %>'/>
|
||||
<model type='<%=@model_type%>'/>
|
||||
<% if @boot_order[0] == 'network' %>
|
||||
<boot order='<%= @iface_number+1 %>'/>
|
||||
<% elsif @boot_order.include?('network') %>
|
||||
<boot order='<%= @iface_number+2 %>'/>
|
||||
<% end %>
|
||||
</interface>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user