Skip to content

[Bug / Issue]: LocalBox - LocalBoxLogonScript.ps1 fails on every logon after initial deployment (missing idempotency) #3413

Description

@erjosito

Jumpstart Solution

  • Jumpstart ArcBox
  • Jumpstart LocalBox
  • Jumpstart Agora
  • A specific Jumpstart scenario
  • Jumpstart Drops
  • Something else

What happened?

After the initial deployment completes successfully, every subsequent logon to LocalBox-Client produces errors from LocalBoxLogonScript.ps1 at line 107:

  • New-StoragePool: Cannot validate argument on parameter 'PhysicalDisks'. The argument is null or empty.
  • The storage pool does not have sufficient eligible resources for the creation of the specified virtual disk.

This happens because the script unconditionally attempts to create the storage pool and virtual disks without checking whether they already exist. On first boot everything succeeds, but on subsequent logons the physical disks are already claimed by the existing pool, so Get-PhysicalDisk -CanPool $true returns nothing.

The error is cosmetic (the cluster works fine), but it confuses users who see red errors on every login and may think their environment is broken.

Suggested fix — add idempotency guards:

# Before creating storage pool
if (-not (Get-StoragePool -FriendlyName "LocalBoxPool" -ErrorAction SilentlyContinue)) {
    $physicalDisks = Get-PhysicalDisk -CanPool $true
    if ($physicalDisks) {
        New-StoragePool -FriendlyName "LocalBoxPool" -StorageSubSystemFriendlyName "Windows Storage*" -PhysicalDisks $physicalDisks
    }
}

# Before creating virtual disk
if (-not (Get-VirtualDisk -FriendlyName "LocalBoxVDisk" -ErrorAction SilentlyContinue)) {
    New-VirtualDisk -StoragePoolFriendlyName "LocalBoxPool" -FriendlyName "LocalBoxVDisk" -UseMaximumSize -ResiliencySettingName Simple
}

This pattern (check-before-create) makes the logon script safely re-runnable.

We need a URL from you

https://jumpstart.azure.com/azure_jumpstart_localbox/getting_started

Deployment Method

Bicep

Relevant log output.

New-StoragePool: C:\LocalBox\LocalBoxLogonScript.ps1:107
Cannot validate argument on parameter 'PhysicalDisks'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.

The storage pool does not have sufficient eligible resources for the creation of the specified virtual disk.
The storage pool does not have sufficient eligible resources for the creation of the specified virtual disk.

Code of Conduct and Licensing

  • I agree to follow this project's Code of Conduct and Licensing terms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug-IssueIt either shouldn't be doing this or needs an investigationLocalBoxJumpstart LocalBox relatedNeeds-TriageThis work item needs to be triaged by a member of the core team

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions