Ensure disk controller passed to create domain (#1520)

Previous PR added tests but missed that the disk controller was not
being set correctly in the create domain action by default.

Update config documentation to include option.
This commit is contained in:
Darragh Bailey
2022-06-25 15:48:05 +01:00
committed by GitHub
parent 37c3330de1
commit c5ed4bd89c
4 changed files with 28 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ module VagrantPlugins
@nvram = config.nvram
@machine_type = config.machine_type
@machine_arch = config.machine_arch
@disk_controller_model = config.disk_controller_model
@disk_driver_opts = config.disk_driver_opts
@nested = config.nested
@memory_size = config.memory.to_i * 1024

View File

@@ -122,8 +122,9 @@
<target dev='<%= volume[:device] %>' bus='<%= volume[:bus] %>'/>
</disk>
<%- end -%>
<%- if @disk_bus == "scsi" and @disk_controller_model != nil %>
<%- for idx in 0..(@domain_volumes.length / 7) do %>
<%- scsi_volumes = @domain_volumes.select { |x| x[:bus] == 'scsi' } %>
<%- if !scsi_volumes.empty? and !@disk_controller_model.nil? %>
<%- for idx in 0..(scsi_volumes.length / 7) do %>
<controller type='scsi' model='<%= @disk_controller_model %>' index='<%= idx -%>'/>
<%- end -%>
<%- end -%>