arcgis-powershell-dsc icon indicating copy to clipboard operation
arcgis-powershell-dsc copied to clipboard

ArcGIS_xDisk.psm1 has DataDisk hardcoded as DiskNumber =2, but this is not present on VMs that do not have a temporary disk.

Open mundayn opened this issue 1 year ago • 1 comments

Module Version

ModuleVersion = '4.2.0'

Affected Resource(s)

ArcGIS Enterprise Cloud Builder 11.2 for Microsoft Azure

Configuration Files

n/a for now

Expected Behavior

I deployed a VM using Standard_D8as_v5, but this SKU does not have a temporary disk.

I redeployed using Standard_D8ds_v5, which has a temp disk, and it works. (well it got further, but that's another issue)

I looked at the PowerShell files and found this hard coded - “ArcGIS_xDisk.psm1” image

When I run 'Get-Disk' on the other SKU, it only had disk 0 and 1, no disk 2. When changing SKU, this is resolved, as disk 2 is now the data disk.

There needs to be logic added to check for this scenario.

Actual Behavior

Error message: "DSC Configuration 'BaseDeploymentSingleTierConfiguration' completed with error(s). Following are the first few: No MSFT_Disk objects found with property 'Number' equal to '2'.

Steps to Reproduce

Build a VM with a SKU with no temp disk.

mundayn avatar Dec 16 '23 02:12 mundayn

I noticed the following template contains additional logic for formatting and partitioning: https://github.com/Esri/arcgis-powershell-dsc/blob/main/Modules/ArcGIS/Configurations-Azure/DiskConfiguration.ps1

However, it contains the same hardcoded integer value assuming that a temp disk is always present. Do we assume that partition happens before the basedeployment DSC configuration is run?

AndrewQuartic avatar Mar 25 '24 17:03 AndrewQuartic

@AndrewQuartic Thanks! This has been addressed in ArcGIS Enterprise Cloud Builder 11.3 for Microsoft Azure.

cameronkroeker avatar May 23 '24 17:05 cameronkroeker

@cameronkroeker This issue is not yet addressed, we just forked and attempted again using a VM SKU without temp disk and the result was the same.

AndrewQuartic avatar Jun 06 '24 23:06 AndrewQuartic

We are proposing the following code fix:

$UnallocatedDataDisks = Get-Disk | Where-Object partitionstyle -eq 'raw' | Sort-Object number
# Initialize an array of disks starting with F
$Letters = 70. .89 | ForEach - Object {
    [char] $_
}
$Count = 0

# iterate though unallocated disks and partition each in sequence ordered by disk number
foreach($Disk in $UnallocatedDataDisks) {
    $DataDiskDriveLetter = $Letters[$Count].ToString()
    ArcGIS_xDisk DataDisk$ {
        DataDiskDriveLetter
    } {
        DiskNumber = $Disk.number
        DriveLetter = $DataDiskDriveLetter
    }
    if (Get - Partition - DriveLetter $DataDiskDriveLetter - ErrorAction Ignore) {
        ArcGIS_Disk DataDiskSize {
            DriveLetter = $DataDiskDriveLetter
            SizeInGB = 4095
            DependsOn = $Depends
        }
    }
    $Depends += "[ArcGIS_xDisk]DataDisk${DataDiskDriveLetter}"
    $Count++
}

AndrewQuartic avatar Jun 06 '24 23:06 AndrewQuartic

@cameronkroeker This issue is not yet addressed, we just forked and attempted again using a VM SKU without temp disk and the result was the same.

It didn't work using ArcGIS Enterprise Cloud Builder 11.3 for Microsoft Azure or didn't work using the DSC ArcGIS Module directly? Just want to verify because it is not designed to work outside of CloudBuilder.

cameronkroeker avatar Jun 07 '24 15:06 cameronkroeker