lamw / lamw/vmware-scripts

Set-FT.ps1: typo in foreach loop that builds the VM disk array

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
951
Forks
504
PR merge metrics
No merged PRs in 30d

Description

On line 52, the "foreach" loop is referencing the variable "$d", but I believe it should reference the variable "$devices":

       # VM Devices
        $devices = $vmView.Config.Hardware.Device

        $diskArray = @()
        # Build VM Disk Array to map to datastore
        foreach ($device in $d) {
	        if($device -is [VMware.Vim.VirtualDisk]) {
		        $temp = New-Object Vmware.Vim.FaultToleranceDiskSpec
                $temp.Datastore = $datastoreView.Moref
                $temp.Disk = $device
                $diskArray += $temp
	        }
        }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open powershell/Set-FT.ps1 at line 52 and inspect how the VM device list is assigned before the disk array loop. Correct the loop's variable reference so it uses the assigned device collection, then verify that the disk array is built from the VM devices shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
infrastructure
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.