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
|
config = env[:machine].provider_config
|
||||||
@nic_model_type = config.nic_model_type
|
@nic_model_type = config.nic_model_type
|
||||||
@nic_adapter_count = config.nic_adapter_count
|
@nic_adapter_count = config.nic_adapter_count
|
||||||
|
@boot_order = config.boot_order
|
||||||
@app = app
|
@app = app
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,12 +28,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @boot_order.count >= 1 %>
|
<% if @boot_order.count >= 1 %>
|
||||||
<% @boot_order.each do |b| %>
|
|
||||||
<boot dev='<%= b %>'/>
|
|
||||||
<% end %>
|
|
||||||
<bootmenu enable='yes'/>
|
<bootmenu enable='yes'/>
|
||||||
<% else %>
|
|
||||||
<boot dev='hd' />
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<kernel><%= @kernel %></kernel>
|
<kernel><%= @kernel %></kernel>
|
||||||
<initrd><%= @initrd %></initrd>
|
<initrd><%= @initrd %></initrd>
|
||||||
@ -51,6 +46,11 @@
|
|||||||
<source file='<%= @domain_volume_path %>'/>
|
<source file='<%= @domain_volume_path %>'/>
|
||||||
<%# we need to ensure a unique target dev -%>
|
<%# we need to ensure a unique target dev -%>
|
||||||
<target dev='vda' bus='<%= @disk_bus %>'/>
|
<target dev='vda' bus='<%= @disk_bus %>'/>
|
||||||
|
<% if @boot_order[0] == 'hd' %>
|
||||||
|
<boot order='1'/>
|
||||||
|
<% elsif @boot_order.count >= 1 %>
|
||||||
|
<boot order='9'/>
|
||||||
|
<% end %>
|
||||||
</disk>
|
</disk>
|
||||||
<%# additional disks -%>
|
<%# additional disks -%>
|
||||||
<% @disks.each do |d| -%>
|
<% @disks.each do |d| -%>
|
||||||
|
@ -6,5 +6,10 @@
|
|||||||
<target dev='vnet<%= @iface_number %>'/>
|
<target dev='vnet<%= @iface_number %>'/>
|
||||||
<alias name='net<%= @iface_number %>'/>
|
<alias name='net<%= @iface_number %>'/>
|
||||||
<model type='<%=@model_type%>'/>
|
<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>
|
</interface>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user