Git Product home page Git Product logo

mslab's Introduction

MSLab

tl;dr

To start using MSLab just download the latest version of the scripts from the Releases section of this repository or follow Dell GEOS hands-on-labs.

💡 Shortcut to the latest version is https://aka.ms/mslab/download

Download MSLab

Introduction

MSLab is a GitHub project that aims to provide virtual environments in Hyper-V, that can be built in a consistent way. It comes at no additional cost, it's free and available under the MIT License.

Unlike other solutions, MSLab focuses on simplicity (all actions can be done without typing complex scripts) and low profile (all disks are differencing, minimum requirements are 8GB RAM and 40GB free space). There is no special hardware requirement. MSLab can run on almost any machine that has SSD and decent amount of memory.

Requirements

  • Windows 10 Pro/Enterprise (as Hyper-V is required) or Windows Server 2016/2019
  • 8GB RAM
  • CPU with Virtualization support
  • SSD
  • 40GB free space

Scripts

The main part of MSLab are the Scripts that will help you preparing lab files (Hydration Phase). This phase is the most time consuming (1-2hours), but needs to be done only once. It will create virtual hard disks from of provided ISO and will create Domain Controller. MSLab Deployment takes only few minutes as it will just import Domain Controller and will add other Virtual Machines as specified in LabConfig.ps1

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

How to get the Scripts

In the past, this ZIP file was stored in the git repository, and recently we switched to using a native Releases feature of Github, where all releases are available at https://github.com/microsoft/MSLab/releases. Also, we have a static direct link to the latest MSLab release on http://aka.ms/mslab/download which is updated automatically when we create a new version.

This built ZIP file is more optimized, e. g. the file 0_Shared.ps1 is in-lined to the rest of the scripts to keep the number of MSLab files as low as possible. Compared to the git repository where I tend to split those scripts to multiple independent files for a better supportability on our side.

Scenarios

Over the time, we have developed multiple scenarios simulating Azure Stack HCI and even deep dives into other technologies such as Windows Admin Center, Certification Authority or Just Enough Administration. Scenarios can be reused for real environments. For example S2D Hyperconverged can be used to deploy real Azure Stack HCI clusters.

Use cases

Prototyping

MSLab is ideal for prototyping. It will quickly spin Windows Server/Client environments that are connected to Internet and ready to be played with. If something goes wrong, there is nothing easier than just run Cleanup and then Deploy again

Hands on Labs

MSLab virtual machines are defined in LabConfig.ps1 as simple hash table. This way you can share your configurations and create consistent, complex environments. Labs are easy to distribute. Once you are done with Hydration Phase, you can just copy result folder to multiple computers and deliver entire classes.

Issue reproduction

Many times happened, that there was an issue that was hard to reproduce. And even if you could reproduce it, another person did not have the same environment, so even with the same steps, the issue might not occur again. MSLab changes this as all MSLab environments with the same LabConfig are the same. So only thing you need to share to other person to reproduce issue are steps and LabConfig.ps1.

Sessions

For more session slides navigate to Slides OneDrive

MSLab in MVPDays

MSLab with Carsten

MSLab in MVPDays

MSLab in MVPDays

MSLab in CDCGermany

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:

You can use this script to register PowerShell Core integration in Explorer.

# Set context menu option
$pwshPath = "c:\Program Files\PowerShell\7-preview\pwsh.exe"

if(-not (Get-PSDrive -PSProvider Registry | Where-Object Root -EQ "HKEY_CLASSES_ROOT")) {
    New-PSDrive -PSProvider Registry -Root "HKEY_CLASSES_ROOT" -Name "HKCR"
}

New-Item -Path "HKCR:\Microsoft.PowerShellScript.1\Shell" -Name "1"
New-ItemProperty -Path "HKCR:\Microsoft.PowerShellScript.1\Shell\1" -PropertyType String -Name "MUIVerb" -Value "Run with PowerShell &Core"
New-ItemProperty -Path "HKCR:\Microsoft.PowerShellScript.1\Shell\1" -PropertyType String -Name "Icon" -Value $pwshPath

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)

Execution Policy

If your environment enforces running signed PowerShell scripts, scripts in release ZIP archive (starting from September 2022) are now signed with a code signing certificate. Although the code signing certificate is trusted you might see this warning when running the MSLab scripts: This is by design behavior of PowerShell runtime, as certificates for scripts are stored in separate certificate store (Cert:\CurrentUser\TrustedPublisher\) and explicit decision is required for each certificate.

Also please keep in mind that any change to LabConfig.ps1 file would then require to sign that file again as any change in LabConfig would invalidate initial signature.

To sign LabConfig.ps1 file you can use this snippet that would select first available Code Signing certificate on your computer:

# Get a Code signing certificate from store
$certificate = Get-ChildItem -Path Cert:\CurrentUser\My\ -CodeSigningCert | Select-Object -First 1

# Add signature to a LabConfig file
Set-AuthenticodeSignature -FilePath "LabConfig.ps1" -Certificate $certificate

Linux (preview)

There is en experimental support for building Linux parent images in MSLab. For building those images MSLab use Packer 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 tool.

All the supported Linux distributions and their Packer templates are in the Microsoft/MSLab-templates repository. Should you run to any problem with specific distribution, please open an issue directly in that repository.

mslab's People

Contributors

andreassobczyk avatar cipgysmo avatar commycz avatar darrylvanderpeijl avatar devalian avatar gandritsos avatar haribo112 avatar jantoman avatar jantorep avatar jaromirk avatar jformacek avatar jrp2014 avatar kant avatar karl-we avatar kkkekai avatar li-yanzhi avatar lukemurraynz avatar m12net avatar machv avatar mattmcspirit avatar mcpjanmarek avatar microsoft-github-policy-service[bot] avatar msftgits avatar nesegreven avatar philipelder avatar pronichkin avatar tdslinden avatar tollilf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mslab's Issues

VM data location in Cluster Sets

Hi Jaromirk,

Thank you for the awesome lab! I like that it's so easy to setup the environment.
I tried out Cluster Sets scenario, and I noticed that the VM data is placed in Cluster master's InfraSOFS (\MC-SOFS), but the docs (https://docs.microsoft.com/en-us/windows-server/storage/storage-spaces/cluster-sets) places them in each member clusters' InfraSOFS (ex. \CL1-SOFS). Is it a mistake or is it intentional? If there are different usages for these InfraSOFSs, I would like to know the difference.

Thanks!!

DC was not imported successfully

Issue just started where the WSLabs Deploy script no longer works correctly. Any time Deploy.ps1 is ran the following error occurs and is logged . I tried a completely fresh setup us WSLabs and get the same results on multiple systems.

Directory: C:\NewLabs\scripts\LAB

Mode LastWriteTime Length Name


d----- 4/17/2019 9:47 AM VMs
Looking for Tools Parent Disks
Tools parent disk C:\NewLabs\scripts\ParentDisks\tools.vhdx found
Looking for DC to be imported
DC was not imported successfully Press any key to continue ...
Press enter to continue ...

WSLab/Scenarios/S2D Tools/Restart-S2DCluster/

At C:\Users\LabAdmin\Desktop\RestartCluster.ps1:13 char:40

  • foreach ($ClusterNode in $ClusterNodes){
  •                                    ~
    

Missing closing '}' in statement block or type definition.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndCurlyBrace

Azure template is not working

Hi all,

I found, that suddenly azure template stopped working. Will investigate more next week (if I'll find some time)

VMFleet fails to setup as it is not able to assign letter

VHD that is used for VMFleet does not work. Looks like it cannot assign letter .

VHD is created with convert-windowsimage and necessary folders are created. For some reason is Add-PartitionAccessPath failing. Investigating the reason now.

$o=Mount-VHD C:\ClusterStorage\S2D1\vm-base-S2D1-1\vm-base-S2D1-1.vhdx -Passthru
$p = Get-Disk -number $o.DiskNumber | Get-Partition | sort -Property size -Descending | select -first 1
$p | Add-PartitionAccessPath -AccessPath Z:
Add-PartitionAccessPath : Not Supported
Activity ID: {f21a2511-a82d-4d77-92d9-ab8b81efa893}
At line:1 char:6
+ $p | Add-PartitionAccessPath -AccessPath Z:
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (StorageWMI:ROOT/Microsoft/.../MSFT_Partition) [Add-PartitionAccessPat
   h], CimException
    + FullyQualifiedErrorId : StorageWMI 1,Add-PartitionAccessPath

Include 0_Shared.ps1 fails

Hi, happy using WSLab!

I got an error executing Prereq.ps1 at line 19: . .\0_Shared.ps1
I got it working changing line 19 to: . "$PSScriptRoot\0_Shared.ps1" (similar to line 38)
Working with Windows PowerShell 5.1, not sure if this has something to do.

SCVMM - Installing ADK(1709) gets stuck - how to install it manually

Hello Jaromirk.

I was tasked by the chair of my universtity to evaluate S2D with a 3 Server Cluster and if it should be managaged using SCVMM (Version 1801) or if SCVMM is not necessary.
So I downloaded the scripts and Labconfig for this scenario from github. I added InstallSCVMM='Yes' in the Labconfig and skipped creation of Management and WDS (since I wanted to run everything from DC).
The Scripts work fine until in the create_parent_disk script executes the install_ADK part (Version 1709). This stept always gets stuck for me. (I tried it 4 times)
--> See image 1

I gave the install script more than one hour.
Then I logged in to DC maually. I opened the Tools-Disk and started the ADK setup manually.
--> See image 2

After the install finished I checked if the files had been installed into the right directory.
--> See image 3

Now I restarted DC manually to continue with the main Script (create_Parent_Disks) which should now install SCVMM.
--> See image 4

The main script tells me that SCVMM was installed after 1.54 Minutes.
--> See image 5

Now I executed the Deploy-Script which worked fine.
-->See image 6

I connected to DC but SCVMM is nowhere to be found even though all prerequesites (SQL Server 2017 is running and ADK is installed) are given.
--> See image 7

So after several tries I decided to also install SCVMM manually as well.
--> See image 8

But I get stuck at configuring the datebase connection, since the admin login credentials are rejected.
I tried LabAdmin, Administrator, VMM_SA, SQL_SA with the password LS1setup! but everything was rejected. I couldn't find any other login credentials within your scripts.
-->See image 9

I have two main questions.

Can you tell me which credetials are supposed to be used in image 9, so that the following scenario script works?

I saw that there was an issue before with the install_adk script. Did you maybe find out why it gets stuck? Maybe my manual installation of ADK causes issues with the following SCVMM setup.

Regards
Marcel

PS: Sorry that the screenshots partly contain german text, but I'm sure you know the console output by heart anyway.
Image 1
1-adk-install-script-stuck
Image 2
2-adk-on-dc-manual-install
Image 3
3-adk-on-dc-installed
Image 4
4-dc-manual-restart
Image 5
5-vmm-install-finished-fast
Image 6
6-deploy
Image 7
7-scvmm-is-not-installed
Image 8
8-scvmm-manual-setup
Image 9
9-scvmm-manual-setup-db-connection

Browse failures on 1709 DataCenter server

Hi,

I tried to run these (faaantastic! Thankyou..) scripts on a 1709 release of Server 2016 DataCenter edition, and whenever it went prompting for ISO / MSU / etc media, the script would fail. Obviously there is no 'real' gui in 1709. The fix was to manually comment out the browse for server and client ISO media lines and manually pop in the file path at the mount-image step.

All ran fine after that. Hopefully there is a way to prompt for media on the console rather than selecting in explorer ?

Thanks, and great work!
Josh

Server Core Remote Hydration

Hi more of a request.

I have setup a 2019 core server with hyper-v. I want to be able spinup the labs on the server but manage from my laptop.
When I run the CreateParentDisks script directly on the core server I get a message that I must install hyper-v management tools (which are GUI)

am i missing something? if i run the scripts locally on my laptop, is there someway to point them at my lab server to install the VMs there?

Problems on setting up the Hyperconverged S2D with Nano Servers

Hi,

I have problems on setting up the Hyperconverged S2D with Nano Servers.
The first issue is an error appearing on the configuration check for the cluster:
error on check

Next issue is while I'm trying to set up a storage pool I get the following error:
cluster-problem1

I checked the physical disks on S2D1 and got the following screen:
listofdisks

So, where I'm doing wrong, I'd be happy if you'd help me out.

Byes
TGC

Windows Server 2016 TP5 Nano won't start

Hi all, I just found, that on Windows 10 Anniversary update TP5 nano server refuses to start. I tried 2 last Cumulative updates with no luck. I think reverting back to v7 config should work.

Does someone know some combination that works? I don't want to spend much time since all these issues are fixed in RTM.

Jaromir

DSC part is failing on one customers Laptop

Need to investigate more...

here is a log

Creating DSC Configs for DC
PSDesiredStateConfiguration\Node : The term 'xDscWebService' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\WSLab\2_CreateParentDisks.ps1:590 char:17

  •             Node $AllNodes.Where{$_.Role -eq "Parent DC"}.Nodenam ...
    
  •             ~~~~
    
    • CategoryInfo : ObjectNotFound: (xDscWebService:String) [PSDesiredStateConfiguration\node],
      ParentContainsErrorRecordException
    • FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
      PSDesiredStateConfiguration\Node : The term 'xDscWebService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
      the spelling of the name, or if a path was included, verify that the path is correct and try again.
      At C:\WSLab\2_CreateParentDisks.ps1:590 char:17
  •             Node $AllNodes.Where{$_.Role -eq "Parent DC"}.Nodenam ...
    
  •             ~~~~
    
    • CategoryInfo : ObjectNotFound: (xDscWebService:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node

PS>TerminatingError(): "Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration code appropriately."
PS>TerminatingError(): "Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration code appropriately."

TerminatingError(): "Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration code appropriately."
TerminatingError(): "Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration code appropriately."
Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration code appropriately.
Compilation errors occurred while processing configuration 'DCHydration'. Please review the errors reported in error stream and modify your configuration
code appropriately.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5

  • throw $ErrorRecord
    
  • ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (DCHydration:String) [], InvalidOperationException
    • FullyQualifiedErrorId : FailToProcessConfiguration

While Creating SCVMM parent disk, always blocked at step "Installing ADK"

Hi

Hope you're doing well ! While I am trying to creating SCVMM parent disk by CreateParentDisk script, it always block at the step "Install ADK". After I console to the DC Hyper-V VM. It seems no process is running for install ADK. The "Installer" folder is integrallty in the ToolDisk. If I try to run the script named install-adk on the DC directly. It will complete successfully. Something worry? or any workaround?

Configuration of DHCP role fails when using non-English Windows Server iso

The script looks for an interface with an alias Ethernet while configuring the DHCP role, but will fail if you use an non-English Windows Server iso. In my case I was using 14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_JA-JP.ISO for the iso and the interface alias was イーサネット.
https://github.com/microsoft/WSLab/blob/95408e80df8587b445af9b0e21078d8b5779b53c/Scripts/2_CreateParentDisks.ps1#L735

As an workaround, I had to logon and rename the interface to Ethernet to proceed.

Can't go pass Active Directory start

Hi Jaromir,
I am trying to use your script on my laptop and haven't change anything . I am getting stuck at "Waiting for Active Directory on WSLab-DC to be Started." . Would you please suggest how can i solve the issue ?
thanks,
Fazle
WSLab Issue

Complete run Deploy Script very soon and no VM be found

Hi
Hope this finds you well!

While I am trying to deploy my lab with this 3_deploy script. I found an issue or maybe it is just by design.

Issue: If I set $LABConfig.VMs argument "Configuration" not equal "S2D", such as "SDN", the script will finished very soon (around 2min without any error) and no VM would be deployed. Compare to use "S2D", everything is doing well as I want.

S2D with SCVMM

I have the cluster setup, and now i am going through the S2D with SCVMM and it fails with the error below:

https://github.com/microsoft/WSLab/tree/master/Scenarios/S2D%20and%20SCVMM%202019

Set-SCVirtualNetwork : Cannot apply settings from the logical switch 'SETSwitch' to the standard virtual
switch 'SETSwitch' because the SR-IOV setting configured in the logical switch 'False' is different from the
setting in the standard switch 'True'. (Error ID: 50109)

One option is to delete the virtual switch from the host and create a new instance of the logical switch.
Another option is to create a logical switch that uses the same SR-IOV setting as the standard switch on the
host. After making changes, retry the operation.

To restart the job, run the following command:
PS> Restart-Job -Job (Get-VMMServer DC | Get-Job | where { $_.ID -eq
"{e56d51e3-d6b2-4a02-a292-8523ec1f62ea}"})
At line:13 char:5

  • Set-SCVirtualNetwork -ConvertToLogicalSwitch -LogicalSwitch $logi ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ReadError: (:) [Set-SCVirtualNetwork], CarmineException
    • FullyQualifiedErrorId : 50109,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.SetVirtualNetworkCm
      dlet

Can not start VMs in Scenario S2D Hyperconverged

I'm running WSlab with the Scenario on Windows 10, latest Version 2004 (Build 19041.330).
Creation of Lab was successful, i haven't seen any error.
When i try to start a Test- or self created VM i get:

"Virtual Machine TestVMMyVolumeonHDDs1_1' failed to start.
'TestVMMyVolumeonHDDs1_1' failed to start. (Virtual machine ID D2296854-A16F-40AC-99CB-8CE953744865)
The Virtual Machine Management Service failed to start the virtual machine 'TestVMMyVolumeonHDDs1_1' because one of the Hyper-V components is not running (Virtual machine ID D2296854-A16F-40AC-99CB-8CE953744865)."
and
"Cluster resource 'Virtual Machine TestVMMyVolumeonHDDs1_1' of type 'Virtual Machine' in clustered role 'TestVMMyVolumeonHDDs1_1' failed. The error code was '0x80004005' ('Unspecified error').
Based on the failure policies for the resource and role, the cluster service may try to bring the resource online on this node or move the group to another node of the cluster and then restart it. Check the resource and group state using Failover Cluster Manager or the Get-ClusterResource Windows PowerShell cmdlet."

I've no Idea what is missing, all Services are running ...

Server CORE as host and issue at mounting ISO

Hi,

I got a hands on physical server for my Home Lab and installed 17713 CORE edition. I wanted to use it as starting point for testing some of your labs, but I came across error, which throws me out of powershell and generates following output:
"Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
screenshot

This happens, when script should ask me for ISO.
To avoid this, I changed Labconfig and pushed in Server ISO parameter, but it seems that CORE detection mechanism is not working.

Regards,
Matjaž

Attempting to upgrade the 2016 S2d cluster to 2019 fails

Hello, I am wondering how I can go about testing the upgrade path from 2016 S2D to 2019. I attempted already, but received "safe_os phase error" on first reboot. I turned off secure boot to no help. I know i can just deploy a 2019 Farm, but i am trying to test this prior to upgrading our physical S2D nodes.
Thank you

Windows 10 - svhdx filter driver installation error

Thanks for a great deployment scripts, I have used the lab deployment scripts before and it works great!

At home I tried to run a copied version from a lab exercise and I get this error:

unable to load svhdx filter driver. Exiting Please use Server SKU or figure out how to install svhdx into the client SKU

any ideas on how I can install or should I get the SKU from the registry?

Proxy credentials

I suggest to include optional configuration to use Proxy with the cmdlets that download Nuget and the DSC Resources.
We can add them in the LabConfig.PS1 and use $PSDefaultParameterValues to apply it if configured, here's an example,
if ($labconfig.ProxyServer){
$PSDefaultParameterValues = @{
"*:Proxy" = $labconfig.ProxyServer
"*:ProxyCredential" = $labconfig.ProxyCreds
}
}
https://github.com/Microsoft/ws2016lab/blob/1957e84ce8e26f1556c2b6d814e2d1249d4e9feb/Scripts/1_Prereq.ps1#L495

Prereq fails at download diskspd

Hi, wslab is awesome!

Now I got stuck with this:

Prereq.ps1 line 163 contains:
$downloadurl = $webcontent.BaseResponse.ResponseUri.AbsoluteUri.Substring(0,$webcontent.BaseResponse.ResponseUri.AbsoluteUri.LastIndexOf('/'))+($webcontent.Links | where-object { $_.'data-url' -match '/Diskspd.*zip$' }|Select-Object -ExpandProperty "data-url")

After executing, $downloadurl contains just "https://github.com/microsoft". The where-object clause returns empty

issue formatting disks createparentdisks.ps1

When I run the second script, I get an error when the script tries to format the volume.
"Format-Volume : Invalid Parameter". See screenshot. I a running win10 enterprise 1803 and using Win2016 eval ISO ver. 14393.

capture

Log entry:
Format-Volume : Invalid Parameter
Activity ID: {c7bb7eb5-96a7-41a0-a059-0e02b046b6fa}
At C:\S2DVMs\tools\convert-windowsimage.ps1:1935 char:41

  • ... temVolume = Format-Volume -Partition $systemPartition -FileSystem FAT ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimExcept
      ion
    • FullyQualifiedErrorId : StorageWMI 5,Format-Volume
      Format-Volume : Invalid Parameter
      Activity ID: {c7bb7eb5-96a7-41a0-a059-0e02b046b6fa}
      At C:\S2DVMs\tools\convert-windowsimage.ps1:1935 char:41
  • ... temVolume = Format-Volume -Partition $systemPartition -FileSystem FAT ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimExce
      ption
    • FullyQualifiedErrorId : StorageWMI 5,Format-Volume

Secure copy takes a long time

When deploying SDN Express to VMM it uses over a day to copy the templates. You have any idea why? The whole lab is running from a NVMe.

image

Edition not selected

Hi I've just came across a problem with the Win10 praten timage creation. It wouldn't let me do it erroring with "Edition not selected. Exitting". So after a little tinkering I've decided that I should change one of the loops from:

}else{
            $WindowsImage=Get-WindowsImage -ImagePath "$ISOMediaPath\sources\install.wim"
            if ($BuildNumber -lt 7600){
                if ($ISO -ne $Null){
                    $ISO | Dismount-DiskImage
                }
                WriteErrorAndExit "`t Use Windows 7 or newer!"

to this:

}else{
            $WindowsImage=Get-WindowsImage -ImagePath "$ISOMediaPath\sources\install.esd"
            if ($BuildNumber -lt 7600){
                if ($ISO -ne $Null){
                    $ISO | Dismount-DiskImage
                }
                WriteErrorAndExit "`t Use Windows 7 or newer!"

Maybe some kind of check should be implemented to see whether the ISO file has install.wim or install.esd
Source: https://winaero.com/blog/how-to-see-which-build-and-edition-of-windows-10-the-iso-file-contains/

Cannot Log in to Lab VM´s

After the first Scenario was build on my Testing Machine i cannot Log in to any VM in any way. Error Messages are eiter: "The logon method used is not allowed" or "For remote logon, you must be authorized to log on through Remote Desktop Services. The members of the Administrators group are equipped with this right by default."
I tried MSDN Iso´s en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso and de_windows_server_2019_x64_dvd_17559a5b.iso for creating Parent Disks. I also tried providding the LabConfig.ps1 with another Adminname and Password but always got the same Errors. Maybe i made a configuration Mistake but i have no idea what it is.

Configuration of DHCP-server

"NOTE: In 17744 is a bug, so during deployment process DC creation takes forewer. Workaround is to just log in as corp\Administrator to DC and it magically finishes."

When using 17763.253.190108-0006.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso to create the DC I had to login to finish the configuration of the DHCP-server before the process continued.

The problem occurs in the script 2_CreateParentDisks.ps1

$LabConfig=@{
DomainAdminName='LabAdmin';
AdminPassword='P@ssw0rd!';
Prefix = 'PLSLab-';
SwitchName = 'LabSwitch';
SecureBoot=$true;
DCEdition='4';
InstallSCVMM='No';
AdditionalNetworksInDC=$false;
DomainNetbiosName="test";
DomainName="test.lab";
DefaultOUName="Workshop";
AllowedVLANs="1-10";
Internet=$true;
SkipHostDnsAsForwarder=$true;
CustomDnsForwarders=@("8.8.8.8","1.1.1.1");
PullServerDC=$true;
ServerISOFolder="..\ISO";
ServerMSUsFolder="..\MSU";
EnableGuestServiceInterface=$true;
DCVMProcessorCount=2;
DHCPscope="10.0.0.0"
DCVMVersion="8.0"
AdditionalNetworksConfig=@();
VMs=@();
}
Missunderstood the process and tried to create my own DC. I later discovered that the kit creates its own DC and thats the one which waits for the configuration of the DHCP-server
$LABConfig.VMs += @{
VMName = "DC01" ;
Configuration = 'Simple' ;
ParentVHD = 'Win2016Core_G2.vhdx';
SSDNumber = 0;
SSDSize=800GB ;
HDDNumber = 1;
HDDSize= 40GB;
MemoryStartupBytes= 512MB;
AddToolsVHD = $true;
Unattend='DjoinBlob';
DisableWCF=$true;
CustomPowerShellCommands = "New-Item -Name Temp -Path c:\ -ItemType Directory"

    }

Missing license file

Hi,
Could someone please add the appropriate approved open source license for this project, either a LICENSE or LICENSE.TXT file?

Thanks!

Function Write-W2VWarn and Write-W2VError breaks in PSSession

Function Write-W2VWarn and Write-W2VError return errors in remote sessions.
((Get-Host).PrivateData returns $null

On row 347 and 363 -ForegroundColor is set to $null in remote sessions.

Write-Host "ERROR  : $($text)" -ForegroundColor (Get-Host).PrivateData.ErrorForegroundColor
Write-Host : Cannot bind parameter 'ForegroundColor' to the target. Exception setting "ForegroundColor": "Cannot convert null to type  
"System.ConsoleColor" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The 
 possible enumeration values are "Black,DarkBlue,DarkGreen,DarkCyan,DarkRed,DarkMagenta,DarkYellow,Gray,DarkGray,Blue,Green,Cyan,Red,M 
agenta,Yellow,White"."

Reproduce

Invoke-Command -ComputerName (read-host -Prompt ComputerName ) -ScriptBlock {(Get-Host).PrivateData.ErrorForegroundColor} -Credential $null

NumberOfLogicalProcessors not correctly incremented

On the "3_Deploy.ps1", Line 717 throws errors
Get-CimInstance -ClassName "win32_processor" | Select-Object NumberOfLogicalProcessors | ForEach-Object { $global:NumberOfLogicalProcessors += $_ }

This one works fine for me
Get-CimInstance -ClassName "win32_processor" | Select-Object -ExpandProperty NumberOfLogicalProcessors | ForEach-Object { $global:NumberOfLogicalProcessors += $_ }

Timeout when not enough RAM

I've run WSLab while other VM's in Hyper-V were running and it timeouted on me when "Starting DC"

Starting DC
Start-VM : Nie można uruchomić maszyny „DC”.
Nie można przydzielić 2048 MB pamięci RAM: Zasoby systemowe nie wystarczają do ukończenia żądanej usługi. (0x800705AA).
Nie można uruchomić maszyny wirtualnej „DC”. (Identyfikator maszyny wirtualnej: B491206A-6188-4932-8B05-97D74D66B3A9)
Maszyna wirtualna „DC” nie może przydzielić 2048 MB pamięci RAM: Zasoby systemowe nie wystarczają do ukończenia żądanej usługi. (0x800705AA) (identyfikator maszyny wirtualnej: B491206A-6188-4932-8B05-97D74D66 B3A9).
At C:\temp\WSLab\2_CreateParentDisks.ps1:882 char:19
+             $DC | Start-VM
+                   ~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-VM], VirtualizationException
    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.StartVM

It's in Polish but surely you get the idea. It's saying that there are not enough resources available to complete the service

Maybe the script could check if there's enough RAM in Hyper-V before deploying the VMs?

Error when running the CreateParentDisk script

Hello, I hope that you are doing well.

I have the following error showing when the script reaches Starting DC

Starting DC
Configuring DC using DSC takes a while.
Initial configuration in progress. Sleeping 250 seconds
PS>TerminatingError(Invoke-Command): "Cannot validate argument on parameter 'VMId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again."
Invoke-Command : Cannot validate argument on parameter 'VMId'. The argument is null or empty. Provide an argument that
is not null or empty, and then try the command again.
At E:\WSLab\scripts\2_CreateParentDisks.ps1:905 char:46

  •             $test=Invoke-Command -VMGuid $DC.id -ScriptBlock {Get ...
    

Can you please let me know what am I doing wrong?

Many thanks and best regards

Get-PhysicalDisk fails in 0_Shared.ps1

Hi. sorry to bother again

Createparent script failed in line 77 of Shared.ps1. The line reads $physicalDisk = Get-PhysicalDisk -DeviceId $disk.Index
I got it working with $physicalDisk = Get-PhysicalDisk | Where-Object { $_.DeviceId -eq $disk.Index }
Again, this is Windows PowerShell 5.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.