Azure / Azure/AKS-Edge

[Enhancement] Upgrade PowerShell cmdlets should perform a controller-based check for connected devices

Open
#154 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
PowerShell
Stars
66
Forks
50
PR merge metrics
No merged PRs in 30d

Description

The upgrade PowerShell cmdlets Start-AksEdgeControlPlaneUpdate and Start-AksEdgeWorkerNodeUpdate mount an ISO based on the function 'Add-IsoFileToVmmsVm'. In this function, a free LUN is detected, and a specific check is performed on connected DVD drives only.

```powershell
[int[]]$luns = (Get-VMDvdDrive -VMName $vmName -ControllerNumber $controllerNumber).ControllerLocation
```

However, this check does not take into account other devices connected to the controller. I am aware that this is not a currently not an official supported scenario, but it would be better to perform this check on the scsi controller (instead of only DVD drives) to avoid conflicts. Background in our scenario we attach additional data disks to the VM, see also [[Feature] Support for additional data disks for Single Machine Cluster](https://github.com/Azure/AKS-Edge/issues/149) these disk where added to the first available LUN and then this results in a conflict wile attaching the update iso.

Proposed fix:

```powershell
[int[]]$luns = (Get-VMScsiController -VMName $vmName -ControllerNumber $controllerNumber).Drives.ControllerLocation
```

This small adjustment ensures a more comprehensive check on the controller, addressing potential conflicts caused by other connected devices.

> Note: I registered this a as an Enhancement, as i couldn't find the PowerShell cmdlets in any public available repo to create a PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.