Azure / Azure/azure-quickstart-templates

301-sql-alwayson-md-ilb-zones fails when re-deployed

Open
#5,342 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

[301-sql-alwayson-md-ilb-zones](https://github.com/Azure/azure-quickstart-templates/tree/master/301-sql-alwayson-md-ilb-zones)

### Issue Details
When re-running the deployment, it fails if it previously got as far as configuring the Storage Spaces for the F:\ drive. This is because both PrepSQLAO.ps1 and ConfigSQLAO.ps1 contain the below code, which always returns the next free drive letter.

```
#Finding the next avaiable disk letter for Add disk
$NewDiskLetter = ls function:[f-z]: -n | ?{ !(test-path $_) } | select -First 1
$NextAvailableDiskLetter = $NewDiskLetter[0]
```

The above returns F the first time it's run, then G the second time. When this is passed into **xSqlCreateVirtualDataDisk NewVirtualDisk** it causes **Test-TargetResource** to return false (correctly, because there is no G:\ drive) which in turn causes **Set-TargetResource** to fail because no additional disks have been added so there are none free with which to create the new Storage Space.

### Repro steps
1. Deploy 301-sql-alwayson-md-ilb-zones as instructed
2. Once completed, re-deploy again

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with PrepSQLAO.ps1 and ConfigSQLAO.ps1, then trace how the selected drive letter is passed to xSqlCreateVirtualDataDisk NewVirtualDisk. Reproduce the issue by deploying 301-sql-alwayson-md-ilb-zones and re-deploying after Storage Spaces config reaches the F:\ drive. Done means the second deployment succeeds without requiring nonexistent additional disks.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.