Skip to content

Commit

Permalink
Ensure that ephemeral_disk is provided for iops
Browse files Browse the repository at this point in the history
The `ephemeral_disk` param can be nil when using the `use_root_disk` to
combine the OS and ephemeral disks into a single disk. This check
happens in DiskManager2#ephemeral_disk method:
https://github.com/cloudfoundry/bosh-azure-cpi-release/blob/73cc023f72410d81b158c27bc7feb40164097f8e/src/bosh_azure_cpi/lib/cloud/azure/disk/disk_manager2.rb#L203

Signed-off-by: Joseph Palermo <[email protected]>
  • Loading branch information
ystros authored and jpalermo committed Jan 17, 2024
1 parent 73cc023 commit 723fc06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def create(bosh_vm_meta, location, vm_props, disk_cids, network_configurator, en
virtual_machine_result = _create_virtual_machine(instance_id, vm_params, network_interfaces, availability_set)

# IOPS and MBPS for the ephemeral disk need to be set after the disk was created
if @use_managed_disks && (vm_params[:ephemeral_disk][:iops] || vm_params[:ephemeral_disk][:mbps])
if @use_managed_disks && vm_params[:ephemeral_disk] && (vm_params[:ephemeral_disk][:iops] || vm_params[:ephemeral_disk][:mbps])

disk_name = virtual_machine_result[:data_disks][0][:name]
@azure_client.update_managed_disk_performance(instance_id.resource_group_name, disk_name, vm_params[:ephemeral_disk][:iops], vm_params[:ephemeral_disk][:mbps])
Expand Down

0 comments on commit 723fc06

Please sign in to comment.