Skip to content

Commit

Permalink
Add support for virtio-scsi via stemcell cloud properties
Browse files Browse the repository at this point in the history
  • Loading branch information
leosco authored and jpalermo committed Oct 8, 2024
1 parent 0ca3587 commit 03bdf80
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def unpack_image(tmp_dir, image_path)
def self.normalize_image_properties(properties)
image_properties = {}
image_options = %w[version os_type os_distro architecture auto_disk_config
hw_vif_model hypervisor_type vmware_adaptertype vmware_disktype
hw_vif_model hw_disk_bus_model hw_scsi_model hw_disk_bus
hypervisor_type vmware_adaptertype vmware_disktype
vmware_linked_clone vmware_ostype]
image_options.reject { |image_option| properties[property_option_for_image_option(image_option)].nil? }.each do |image_option|
image_properties[image_option.to_sym] = properties[property_option_for_image_option(image_option)].to_s
Expand Down
14 changes: 14 additions & 0 deletions src/bosh_openstack_cpi/spec/unit/stemcell_creator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
expect(subject.normalize_image_properties(properties)).to have_key(:version)
end

it 'supports virtio-scsi properties' do
properties = {
'hw_disk_bus_model' => 'virtio-scsi',
'hw_scsi_model' => 'virtio-scsi',
'hw_disk_bus' => 'scsi',
}

expect(subject.normalize_image_properties(properties)).to include(
:hw_disk_bus_model,
:hw_scsi_model,
:hw_disk_bus,
)
end

it 'maps hypervisor key to hypervisor_type' do
properties = {
'hypervisor' => 'kvm',
Expand Down

0 comments on commit 03bdf80

Please sign in to comment.