From 723fc06f41f220180db34e86b29147901b2f8296 Mon Sep 17 00:00:00 2001 From: Brian Upton Date: Wed, 17 Jan 2024 11:14:31 -0800 Subject: [PATCH] Ensure that `ephemeral_disk` is provided for iops 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 --- src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb b/src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb index efcd96b13..be6fc3f55 100644 --- a/src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb +++ b/src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb @@ -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])