microsoft / microsoft/MSLab

Add options to deployed VMs

Open
#466 23 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.3k
Forks
304
PR merge metrics
No merged PRs in 30d

Description

Please consider the following user story for automation:

I know that most, if not all, labs include a dual-homed VM to run the Scenario.ps1 commands from - whether the DC, Windows 10, or other. On this dual-homed VM, I want to configure a static MAC address on the vNIC connected to the external vSwitch. This would allow me to create a DHCP reservation outside of the MSLabs environment that will ensure that the external interface always gets the same IP. This will allow me to RDP directly to the dual-homed VM from my lab's launch pad rather than jumping to the Hyper-V host and connecting to the VM.

This story also requires that RDP and ICMPv4 requests are enabled on the dual-homed VM. I am accomplishing this on the cluster nodes using the CustomPowerShellCommands option:

1..4 | ForEach-Object { $LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI20H2_G2.vhdx' ; HDDNumber = 10 ; HDDSize = 10TB ; MemoryStartupBytes = 1GB; VMProcessorCount = "Max" ; CustomPowerShellCommands = "Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name 'fDenyTSConnections' -value 0","Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'","New-NetFirewallRule -DisplayName 'Allow inbound ICMPv4' -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -Action Allow" } }

Contributor guide

Open the contributing guide

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

Start with Scenario.ps1 and the VM configuration path that handles CustomPowerShellCommands. Trace how deployed VM network adapters and post-deployment commands are configured, then verify that the requested external vNIC MAC option, RDP access, and ICMPv4 access are applied consistently to the dual-homed VM.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.