Skip to content

Commit

Permalink
Merge pull request #503 from microsoft/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
machv authored Mar 10, 2022
2 parents 28b9905 + 5507cd5 commit bf49891
Show file tree
Hide file tree
Showing 11 changed files with 1,657 additions and 337 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/create-prerelase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create prerelease

defaults:
run:
shell: powershell

on:
push:
paths:
- 'Scripts/**'
branches: [ dev ]

jobs:
new-prerelease:
name: Create prerelease
if: "!contains(github.event.head_commit.message, '[no release]')"
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build scripts
id: build
shell: powershell
run: |
./build.ps1 -Version prerelease
$filename = "mslab_dev-$((Get-Date -Format "yyyyMMdd")).zip"
mv ./Release.zip $filename
echo "::set-output name=filename::$filename"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
prerelease: true
title: "dev branch preview"
files: |
${{ steps.build.outputs.filename }}
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To start using MSLab just download the latest version of the scripts from the [R
- [Hands on Labs](#hands-on-labs)
- [Issue reproduction](#issue-reproduction)
- [Sessions](#sessions)
- [Run in PowerShell Core 7](#run-in-powershell-core-7)
- [Run in PowerShell Core 7](#run-in-powershell-core-7)

<!-- /TOC -->

Expand Down Expand Up @@ -93,7 +93,7 @@ For more session slides navigate to [Slides](https://1drv.ms/u/s!AjTsLJdE37Dwtrs

[![MSLab in CDCGermany](/Docs/media/MSLab_Datacenter_Simulation_presentation_thumb.png)](https://youtu.be/5IX9OLEk50Q)

### Run in PowerShell Core 7
## Run in PowerShell 7
MSLab scripts work also in PowerShell 7, if you want to test it just install latest version of PowerShell 7.

If you also would like to have context menu integration like this:
Expand All @@ -117,3 +117,17 @@ New-Item -Path "HKCR:\Microsoft.PowerShellScript.1\Shell\1" -Name "Command"
Set-ItemProperty -Path "HKCR:\Microsoft.PowerShellScript.1\Shell\1\Command" -Name "(Default)" -Value ('"{0}" "-Command" "if((Get-ExecutionPolicy ) -ne ''AllSigned'') {{ Set-ExecutionPolicy -Scope Process Bypass }}; & ''%1''"' -f $pwshPath)
```

## Linux (preview)

There is en experimental support for building Linux parent images in MSLab. For building those images MSLab use [Packer](https://www.packer.io/) tool. Supported Packer templates are hosted in separate GitHub repository https://github.com/microsoft/MSLab-templates.

To build a Linux parent disk `Linux = $true` need to be added to the `LabConfig.ps1` before running any MSLab scripts. When `1_Prereq.ps1` is ran MSLab would download Packer if not present on the machine yet, generates SSH key pair unique per a MSLab instance folder. This SSH key will be hardcoded in every parent disk built by that instance.

After prerequisites stage additional PowerShell script `CreateLinuxParentDisk.ps1` will be `ParentDisks` folder. You can use that script to build a Linux parent disk in the similar way like the Windows images.

You can also use your own SSH key that can be shared by multiple MSLab instances by explicitely specifying a path to it using `SshKeyPath` option in `LabConfig.ps1`.

`Deploy.ps1` script is using `hv_socket` to connect to a Linux instances and provision them online (similar to how PowerShell Direct work for Windows virtual machines). By default, Linux virtual machines would also be joined to MSLab Active Directory via [sssd](https://sssd.io/) tool.

All the supported Linux distributions and their Packer templates are in the [Microsoft/MSLab-templates](https://github.com/microsoft/MSLab-templates) repository. Should you run to any problem with specific distribution, please open an issue directly in that repository.
900 changes: 867 additions & 33 deletions Scenarios/AzSHCI and AVD/Scenario.ps1

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Scenarios/AzSHCI and Arc-enabled VMs/LabConfig.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
$LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' ; Prefix = 'MSLab-' ; DCEdition='4'; Internet=$true ; TelemetryLevel='Full' ; TelemetryNickname='' ; AdditionalNetworksConfig=@(); VMs=@()}

#2 nodes for AzSHCI Cluster
1..2 | ForEach-Object {$VMNames="ArcVMs" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 4TB ; MemoryStartupBytes= 10GB; VMProcessorCount="Max" ; NestedVirt=$true ; VirtualTPM=$true}}
1..2 | ForEach-Object {$VMNames="ArcVMs" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 4TB ; MemoryStartupBytes= 14GB; VMProcessorCount="Max" ; NestedVirt=$true ; VirtualTPM=$true}}

#or 2 nodes for Windows Server 2022
#1..2 | ForEach-Object {$VMNames="ArcVMs" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2022Core_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 4TB ; MemoryStartupBytes= 24GB; VMProcessorCount="Max" ; NestedVirt=$true ; VirtualTPM=$true}}
#1..2 | ForEach-Object {$VMNames="ArcVMs" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2022Core_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 4TB ; MemoryStartupBytes= 14GB; VMProcessorCount="Max" ; NestedVirt=$true ; VirtualTPM=$true}}

#Windows Admin Center gateway
#optional Windows Admin Center gateway
#$LabConfig.VMs += @{ VMName = 'WACGW' ; ParentVHD = 'Win2022Core_G2.vhdx' ; MGMTNICs=1 }


#optional Windows Management machine
#$LabConfig.VMs += @{ VMName = 'Management' ; ParentVHD = 'Win2022_G2.vhdx' ; MGMTNICs=1 }

Loading

0 comments on commit bf49891

Please sign in to comment.