GithubHelp home page GithubHelp logo

automatedlab / automatedlab Goto Github PK

View Code? Open in Web Editor NEW
1.9K 86.0 357.0 38.37 MB

AutomatedLab is a provisioning solution and framework that lets you deploy complex labs on HyperV and Azure with simple PowerShell scripts. It supports all Windows operating systems from 2008 R2 to 2022, some Linux distributions and various products like AD, Exchange, PKI, IIS, etc.

License: MIT License

PowerShell 88.31% Batchfile 0.01% C# 11.60% HTML 0.01% ASP.NET 0.07%
powershell deployment active directory pki exchange scripted active-directory domain-controller automated-deployment

automatedlab's Introduction

AutomatedLab

Build Status Last Commit Latest Release
Develop Build status dev GitHub last commit
Master Build status GitHub last commit GitHub releasePowerShell Gallery

GitHub issues Downloads PowerShell Gallery

Project Summary

AutomatedLab (AL) enables you to setup test and lab environments on Hyper-v or Azure with multiple products or just a single VM in a very short time. There are only two requirements you need to make sure: You need the DVD ISO images and a Hyper-V host or an Azure subscription.

Requirements

Apart from the module itself your system needs to meet the following requirements:

  • Windows Management Framework 5+ (Windows)
  • .NET 4.7.1 (Windows PowerShell) or .NET Core 2.x (PowerShell 6+)
  • Windows Server 2012 R2+/Windows 8.1+ (Hyper-V, Azure) or Linux (Azure)
  • Recommended OS language is en-us
  • Admin privileges are required
  • ISO files for all operating systems and roles to be deployed
  • Intel VT-x or AMD/V capable CPU
  • A decent amount of RAM
  • Low-Latency high-throughput storage (No spinning disks please, as there are issues related to them)

Windows

  • Windows Management Framework 5+
  • Windows Server 2012 R2+/Windows 8.1+
  • Recommended OS language is en-us
  • Admin privileges are required

Linux

  • Ubuntu, Ubuntu WSL & Azure Cloud Shell supported
  • Tested on Ubuntu. Due to fragmented nature of Linux distributions, we cannot support anything else.
  • PowerShell Core 6+
  • gss-ntlmssp to enable remoting (mandatory - no remoting, no way for AutomatedLab to do its thing)
    • If in doubt, try to Install-Module PSWSMAN; Install-WSMAN - no success warranted
  • IP and route commands available
  • Azure subscription
    • At the moment, AutomatedLab only works using Azure.
    • KVM planned for a later date.

Download AutomatedLab

There are two options installing AutomatedLab:

Supported products

This solution supports setting up virtual machines with the following products

  • Windows 7, 2008 R2, 8 / 8.1 and 2012 / 2012 R2, 10 / 2016, 2019, 2022
  • SQL Server 2008, 2008R2, 2012, 2014, 2016, 2017, 2019
  • Visual Studio 2012, 2013, 2015
  • Team Foundation Services 2018, Azure DevOps Server
  • Exchange 2013, 2016, 2019
  • System Center Orchestrator 2012
  • System Center Operations Manager 2019
  • System Center Service Manager 2019
  • Microsoft Endpoint Manager Configuration Manager 1902 (and newer)
  • MDT
  • ProGet (Private PowerShell Gallery)
  • Office 2013, 2016, 2019
  • DSC Pull Server (with SQL Reporting)

Feature List

  • AutomatedLab (AL) makes the setup of labs extremely easy. Setting up a lab with just a single machine is only 3 lines. And even complex labs can be defined with about 100 lines (see sample scripts).
  • Labs on Azure can be connected to each other or connected to a Hyper-V lab using a single command.
  • AL can be used to setup scenarios to demo a PowerShell Gallery using Inedo ProGet, PowerShell DSC Pull Server scenarios, ADFS or a lab with 3 Active Directory forests trusting each other.
  • Create, restore and remove snapshots of some or all lab machines with one cmdlet (Checkpoint-LabVM, Restore-LabVMSnapshot, Remove-LabVMSnapshot).
  • Install Windows Features on one, some or all lab machines with one line of code (Install-LabWindowsFeature).
  • Install software to a bunch of lab machines with just one cmdlet (Install-LabSoftwarePackages). You only need to know the argument to make the MSI or EXE go into silent installation mode. This can also work in parallel thanks to PowerShell workflows.
  • Run any custom activity (Script or ScriptBlock) on a number of lab machines (Invoke-LabCommand). You do not have to care about credentials or double-hop authentication issues as CredSsp is always enabled and can be used with the UseCredSsp switch.
  • Creating a virtual environment that is connected to the internet was never easier. The only requirements are defining an external facing virtual switch and a machine with two network cards that acts as the router. AL takes care about all the configuration details like setting the gateway on all machines and also the DNS settings (see introduction script 05 Single domain-joined server (internet facing).ps1).
  • AL offers offline patching with a single command. As all machines a based on one disk per OS, it is much more efficient to patch the ISO files that are used to create the base images (Update-LabIsoImage). See script 11 ISO Offline Patching.ps1 for more details.
  • If a lab is no longer required, one command is enough to remove everything to be ready to start from scratch (Remove-Lab)

Local build

While we frequently release prereleases to the PowerShell Gallery, you might be interested to build the entire module locally yourself.

While the steps remain the same, the prerequisites are slightly different on Windows and Linux

Windows:

  • WiX 3 targets installed properly (!)
  • .NET SDKs 4.6.2 and 6.0 Linux:
  • .NET 6.0

After the prerequisites are satisfied, you can:

  • ./.build/01-prerequisites.ps1
  • ./.build/02-build.ps1
  • ./.build/03-validate.ps1 - Optionally validate the built module

The fourth step, publishing, relies on AppVeyor. The built module will be stores in ./publish, the installer can be found in `./Install/bin

automatedlab's People

Contributors

ajdalholm avatar astavitsky avatar bgraeb avatar bill-long avatar carfesh avatar codaamok avatar constantinhager avatar dependabot[bot] avatar dmi3mis avatar drummerviking avatar drunkrhin0 avatar emixam360 avatar fpschultze avatar glennjc avatar groovecs avatar jawz84 avatar kevinmarquette avatar mathematicaken avatar mlinowski avatar mr-kappelmann avatar nyanhp avatar pauby avatar raandree avatar sintaxasn avatar solid03 avatar theposhwolf avatar tiberriver256 avatar trentent avatar wikijm avatar x-limitless-x 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

automatedlab's Issues

2.0.0.0 - Install-LabWindowsFeature throws error

This issue was imported from CodePlex

photoadrian wrote 2014-07-10 at 20:25
Command:

Install-LabWindowsFeature -Name MEMBER1 -FeatureName RSAT, GPMC, RSAT-DHCP, RSAT-DNS-Server

MEMBER1 is a SERVER2012R2DATACENTER statically configured. Error returned is:

VERBOSE: Starting Installation Activity ''
VERBOSE: Credentials prepared for user 'winfra.local\Administrator'
VERBOSE: Creating session to computer 'MEMBER1'
VERBOSE: New-LWPSSession Entering... (ComputerName=MEMBER1,Credential=System.Management.Automation.PSCredential)
VERBOSE: Session to computer 'MEMBER1' created
VERBOSE: New-LWPSSession...leaving - return value is '[PSSession]Session7'
VERBOSE: The Output of the task on machine 'MEMBER1' will be available in the variable 'a7b8f16f-2cbd-4ac5-a696-e76aa8a923d0'
The request to add or remove features on the specified server failed.
Installation of one or more roles, role services, or features failed.
The source files could not be downloaded. 
Use the "source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see 
http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f0906
    + CategoryInfo          : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature], Exception
    + FullyQualifiedErrorId : DISMAPI_Error__Cbs_Download_Failure,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
    + PSComputerName        : MEMBER1
VERBOSE: Session closed
VERBOSE: Finished Installation Activity ''

Need to understand which role/feature was not installed. Also, these are standard features, so why the problem?

raandree wrote 2014-07-10 at 20:51
Just tested this and the result is fine. Also the dynamic variable shows that the installation went well.

What is the operating system of MEMBER1?

VERBOSE: OS ISO mounted on drive letter 'F:'

VERBOSE: Dism PowerShell Cmdlets Version 6.3.0.0

VERBOSE: The Windows Image list contains 2 items

VERBOSE: Dismounting ISO

VERBOSE: Get-LWImageOperatingSystemList...leaving - return value is '2'

VERBOSE: Get-LabAvailableOperatingSystems...leaving.

VERBOSE: Invoke-LWPostInstallationActivity Entering...

(UserName=test.net\administrator,ComputerName=KerbWeb0,Password=Password0,IsoImagePath=E:\LabSources\ISOs\en_windows_server_2012_r2_x64_dvd_2707946.i

so,ScriptBlock=Install-WindowsFeature RSAT, GPMC, RSAT-DHCP, RSAT-DNS-Server -Source d:\sources\sxs -IncludeAllSubFeature)

VERBOSE: Starting Installation Activity ''

VERBOSE: Credentials prepared for user 'test.net\administrator'

VERBOSE: Creating session to computer 'KerbWeb0'

VERBOSE: New-LWPSSession Entering... (ComputerName=KerbWeb0,Credential=System.Management.Automation.PSCredential)

VERBOSE: Session to computer 'KerbWeb0' created

VERBOSE: New-LWPSSession...leaving - return value is '[PSSession]Session1'

VERBOSE: The Output of the task on machine 'KerbWeb0' will be available in the variable '292c4435-a18b-44a5-8eb5-7ea128b52be5'

VERBOSE: Session closed

VERBOSE: Finished Installation Activity ''

VERBOSE: Invoke-LWPostInstallationActivity...leaving - return value is 'System.Management.Automation.PSVariable'

VERBOSE: Install-LabWindowsFeature...leaving.

PS C:\Users\Raimund\Dropbox\Desktop> (Get-Variable 292c4435-a18b-44a5-8eb5-7ea128b52be5).Value

PSComputerName : KerbWeb0

RunspaceId : 4a022da7-d16f-42a8-8a2a-9371a0781acd

Success : True

RestartNeeded : No

FeatureResult : {RAS Connection Manager Administration Kit (CMAK), Group Policy Management, Hyper-V Module for Windows PowerShell, Hyper-V GUI

             Management Tools...}

ExitCode : Success

photoadrian wrote 2014-07-10 at 21:53
OS is SERVER2012R2DATACENTER

I will re-test and update.

Office2016 Parameter in Install-Lab not working...

I try to install a clientvm including office2016 with:

Install-Lab -Office2016

...there is a role for Office2016 - but in Install-Lab the parameter 'Office2016' does not exist - only 'Office2013' is available in this cmdlet...

Installing DC on Windows Server 2016 sometimes does not work

Installing a AD DC role on Server 2016 did not work sometimes. The reason for this is that the ADDS role simply was not available. Get-WindowsFeatures did not return all the features that the normally available.

This issue was observed only with Eval ISOs.

After rebooting the machine a 2nd time, the features have been added - no idea how and why.

We are monitoring this issue.

There isn't a single operating system ISO available in the lab with AL 3.8.0.9

Did version 3.8.0.9 break auto ISO image import?

18:38:38|00:01:19|00:00:00.000| Creating base images
There isn't a single operating system ISO available in the lab. Please add one and use the switch 'IsOperatingSystem' to mark it as an OS image
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabDisks.psm1:21 char:3

  •     throw "There isn't a single operating system ISO available in the lab. Please  ...
    
+ CategoryInfo          : OperationStopped: (There isn't a s... as an OS image:String) [], RuntimeException
+ FullyQualifiedErrorId : There isn't a single operating system ISO available in the lab. Please add one and use the switch 'IsOperatingSystem' to mark it as an OS  

image

All ISO images were imported successfully and Get-LabAvailableOperatingSystem reports all operating systems I'm using for the lab.

However, it looks like AutomatedLabDisks.psm1 line 21 does a check for IsOperatingSystem:
$lab = Get-lab
$isos = $lab.Sources.ISOs | Where-Object { $_.IsOperatingSystem }

When I run $lab.Sources.ISOs, the "OS Count" column reports 0 for each ISO. The same command on my other Hyper-V host lists 1 or more in the OS Count column for the same ISO images. That host is running 3.8.07 (TechNet version).
I tried calling add-labisoimagedefinition with the -IsOperatingSystem parameter and it gave a warning that The -IsOperatingSystem switch parameter is obsolete and thereby ignored.

Auto discovery of physical volumes is ommitting MPIO devices

Get-LabVolumesOnPhysicalDisks is eliminating MPIO drives as it does it tests for the serial numbers returned from Get-CimInstance Win32_DiskDrives and their existence in $physicalDisks.SerialNumber.

The returned serial number is an array, which doesn't pass the condition.

Failed to run first lab

I tried running the instructions on this page
https://github.com/AutomatedLab/AutomatedLab/wiki/2.-Getting-Started

New-LabDefinition -Name GettingStarted -DefaultVirtualizationEngine HyperV
Add-LabMachineDefinition -Name FirstServer -OperatingSystem 'Windows Server 2012 R2 SERVERSTANDARD'
Install-Lab
Show-LabInstallationTime

I get the following errors
No local drive found matching requirements for free space
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLabDefinition\AutomatedLabDefinition.psm1:1044 char:17

  •             Throw 'No local drive found matching requirements for free space ...
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (No local drive ... for free space:String) [], RuntimeException
    • FullyQualifiedErrorId : No local drive found matching requirements for free space

issue

Save-LabVM does not work

Save-LabVM seems like never being tested. The internal worker function to save Hyper-V VMs does not exist

Postactivity seeems not to be executed

I have made a script to make a automatedlab.
It includes
DC1, DC2 (domainecontrolers)
GW (Routing role)
Exch1 (Exchange2016 role)
NAV2016 (Install script to Demo NAV2016)
Client1 (Win10 domainejoiend)

But it dosnt do it right....First it is is starting DC1, and waits for it to complete, then GW is started, and then it waites for routing changes to DC1 and DC2 is setup - but DC2 isnt up at all. But manual start makes it going.
Then when DC2 is up and configures, the rest og the machines is started. But no Exchange is installed, No Nav is installed and no users is setup in AD.

What am i dooing wrong? And how to debug. It seems that stuf in rescources isnt copied and executed on machines....
My script is located here:
https://github.com/andlo/AutomatedLab-Scripts-/blob/master/LAB.ps1

Make usage of Windows Defender configurable

I noticed Windows Defender is deactivated when setting up labs.
As I need it running in some of my labs, can you make the use of Windows Defender a configurable option.

Would be great!

Summary after deployment

After the successful lab deployment a summary should be shown with:

  • Machines deployed with connection info and roles
  • Useful cmdlets
  • Get-AutomatedLabCommand

Load balancer does not support multiple subnets

This error did not appear before the load balancer implementation.

AL error:

Failed to create the following Azure machines: F2DC1, F3DC1'. For further information take a look at the background job's result (Get-Job, Receive-Job)
At C:\Program iles\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabVirtualMachines.psm1:107 char:9
throw "Failed to create the following Azure machines: $machin ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Failed to creat...b, Receive-Job):String) [], RuntimeException
+ FullyQualifiedErrorId : Failed to create the following Azure machines: F2DC1, F3DC1'. For further information take a look at the background job's result (Get-Job, Receive-Job)

Receiving the failed job shows:

Network interface /subscriptions/eaea1f5a-643c-483a-acb0-c32bfa0546a9/resourceGroups/MultiForest3/providers/Microsoft.Network/networkInterfaces/f3dc1nic0 uses load balancer /subscriptions/eaea1f5a-
643c-483a-acb0-c32bfa0546a9/resourceGroups/MultiForest3/providers/Microsoft.Network/loadBalancers/MultiForest3loadbalancer but does not use the same VNET (/subscriptions/eaea1f5a-643c-483a-acb0-c32
bfa0546a9/resourceGroups/MULTIFOREST3/providers/Microsoft.Network/virtualNetworks/FOREST1) as other network interfaces already connected to the load balancer.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : '75b2d5cf-b520-467f-aaed-8906080b8ec4'
+ CategoryInfo : CloseError: (:) [New-AzureRmNetworkInterface], NetworkCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.NewAzureNetworkInterfaceCommand
+ PSComputerName : localhost

not properly workig LabSourcesLocation on MSI level

Hello,

I install MSI with relocation samples to I: drive. It add entry to LabSourcesLocation, not replace (while scrips assume that there are one entry).

`Results bellow.
PS I:\Users\z> Get-LabSourcesLocation
I:\LabSources
C:\LabSources
PS I:\Users\z> New-LabDefinition -Name 'Lab1' -DefaultVirtualizationEngine HyperV
19:48:05|00:00:00|00:00:00.000| Initialization
19:48:05|00:00:00|00:00:00.031| - Host operating system version: '10.0.14393'
19:48:05|00:00:00|00:00:00.031| - Creating new lab definition with name 'Lab1'
19:48:05|00:00:00|00:00:00.046| - Location of lab definition files will be 'C:\Users\z\Documents\AutomatedLab-Labs\Lab1'
19:48:08|00:00:03|00:00:03.115| - Location of LabSources folder is '(I:\LabSources C:\LabSources)'
Get-ChildItem : Cannot find path 'I:\LabSources C:\LabSources' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLabDefinition\AutomatedLabDefinition.psm1:819 char:13

  •     if (Get-ChildItem -Path "$(Get-LabSourcesLocation)\ISOs" -Fil ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (I:\LabSources C:\LabSources:String) [Get-ChildItem], ItemNotFoundException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

19:48:08|00:00:03|00:00:03.333| - No ISO files found in I:\LabSources C:\LabSources\ISOs folder. If using Hyper-V for lab machines, please add ISO files manually using 'Add-LabIsoImageDefinition'`

Base Image creation fails

Hi,

setting up a new environment for automatedlab. It always fails during base image creation with:

bcdboot.exe not found

In C:\Program Files\WindowsPowerShell\Modules\AutomatedLabWorker\AutomatedLabWorkerDisks.psm1:152 Zeichen:9

  •     bcdboot.exe $vhdWindowsVolume\Windows /s "$($freeDrive):" /f  ...
    
  •     ~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (bcdboot.exe:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Any idea?

Thx.

PowerCli 6

This issue was imported from CodePlex

phrogZ wrote 2015-08-31 at 12:55
Hello,

With the new
PowerCli 6 for vmware
, PSSnapins have been converted to modules.

In AutomatedLab.psm1 it will be needed to add one more condition like "((Get-Module -Name VMware.VimAutomation.*).Count -eq 0)" at line 269.

Regards,

L.H.

raandree wrote 2015-09-09 at 13:36
Thanks for reporting this. Unfortunately I do not have a VMWare test environment, hence I cannot drive this forward. However we are always seeking for people participating in this project.

-Raimund

Start-LWAzureVM should work in parallel

Stop-LWAzureVM word in parallel, Start-LWAzureVM does not. Starting machines takes quite long. Background jobs could be used to make this function more efficient,

Disks.xml cannot be found and subsequent errors

These errors appear from time to time. The error does not have to have an impact of the actual deployment.

Remove-Item : Cannot find path 'C:\Users\Raimund\Documents\AutomatedLab-Labs\DSCLab2\Disks.xml' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\AutomatedLab.psm1:352 char:5
+ Remove-Item -Path $lab.DiskDefinitionFiles[0].Path
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Raimun...CLab2\Disks.xml:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Method invocation failed because [System.Collections.Generic.List`1[[AutomatedLab.Disk, AutomatedLab, Version=3.9.2.0, Culture=neutral, PublicKeyToken=null]]] does not contain a method name
d 'Export'.
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\AutomatedLab.psm1:355 char:5
+ $lab.Disks.Export($lab.DiskDefinitionFiles[0].Path)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

Method invocation failed because [System.Collections.Generic.List`1[[AutomatedLab.Disk, AutomatedLab, Version=3.9.2.0, Culture=neutral, PublicKeyToken=null]]] does not contain a method name
d 'AddFromFile'.
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\AutomatedLab.psm1:361 char:5
+ $lab.Disks.AddFromFile($lab.DiskDefinitionFiles[0].Path)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

Lability and AL on same machine - some cmdlets not working...

Issue:

i tried to install software packages in my lab - using the sample scripts MediumLab2012R2SQL.ps1 and BigLab2012R2EXSQLORCHVSOFF.ps1

in line 62 of MediumLab2012R2SQL.ps1 there is the command:

Get-LabMachines -All

give´s me the error: A parameter cannot be found that matches parameter name 'all'

in line 117 of BigLab2012R2EXSQLORCHVSOFF.ps1 there is the command:

$machines = Get-LabMachines

they asks for a parameter called ConfigurationData...

Reason:

i had another PS module called Lability installed before, you have to remove the Lability Module with:

Get-Module Lability | Remove-Module

(display all installed Modules with Get-Module to be sure that Lability is removed)

after that, AL commandlets works as expected...

Recognize Azure Profile expiration

If the Azure profile stored in a json file is expired, you get some weird errors that are not actually pointing you to the root cause. There is no expiration date inside the json file. Knowing whether the profile is expired before starting a deployment would increase usability.

How to install?

I find a .msi installer n codeplex, but it seems that it is not the latest AutomatedLab as It cannot use a Windows Server 2016 Standard

Add-LabMachineDefinition : Cannot validate argument on parameter 'OperatingSystem'. The argument "Windows Server 2016 SERVER STANDARD" does not belong to the set "Windows 7 PROFESSIONAL;Windows 7 ULTIMATE;Windows 7 Enterprise;Windows 8 Pro;Windows 8 Enterprise;Windows 8.1 Pro;Windows 8.1 Enterprise;Windows 10 Pro;Windows 10 Enterprise;Windows 10 Pro Technical Preview;Win dows 10 Enterprise Technical Preview;Windows Server 2008 R2 SERVERDATACENTER;Windows Server 2008 R2 SERVERDATACENTERCORE;Win dows Server 2008 R2 SERVERENTERPRISE;Windows Server 2008 R2 SERVERENTERPRISECORE;Windows Server 2008 R2 SERVERSTANDARD;Windo ws Server 2008 R2 SERVERSTANDARDCORE;Windows Server 2008 R2 SERVERWEB;Windows Server 2008 R2 SERVERWEBCORE;Windows Server 20 12 SERVERDATACENTER;Windows Server 2012 SERVERDATACENTERCORE;Windows Server 2012 SERVERSTANDARD;Windows Server 2012 SERVERST ANDARDCORE;Windows Server 2012 R2 SERVERDATACENTER;Windows Server 2012 R2 SERVERDATACENTERCORE;Windows Server 2012 R2 SERVER STANDARD;Windows Server 2012 R2 SERVERSTANDARDCORE;Windows Server 2016 Technical Preview 4 SERVERSTANDARDCORE;Windows Server 2016 Technical Preview 4 SERVERSTANDARD;Windows Server 2016 Technical Preview 4 SERVERDATACENTERCORE;Windows Server 2016 Te chnical Preview 4 SERVERDATACENTER;Windows Server 2016 Technical Preview 5 SERVERSTANDARDCORE;Windows Server 2016 Technical Preview 5 SERVERSTANDARD;Windows Server 2016 Technical Preview 5 SERVERDATACENTERCORE;Windows Server 2016 Technical Preview 5 SERVERDATACENTER" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command a gain.

Error calling Set-VMFirmware creating a Gen1 machine

Creating 2008 R2 / Gen 1 machines works but shows an ugly error:

Set-VMFirmware : The Generation 1 virtual machine or snapshot "2008RootMember" does not support the VMFirmware cmdlets. Use Get-VMBios and Set-VMBios instead.
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLabWorker\AutomatedLabWorkerVirtualMachines.psm1:281 char:15

Lab sources folder should synchronize with Azure

The lab sources folder should be synchronized with Azure for Azure-based labs in order to make use of Azure resources instead of local resources when copying files to machines, installing software on machines, ...

The virtual machine does not start

I use the script "01 Single Win10 Client.ps1" to test AutomatedLab.
Everything happens correctly, apparently, until the virtual machine starts.

The virtual machine remains blocked.

Passing in $ VerbosePreference = 2 mode I have the following message:
COMMENTS: Testing port 5985 on computer '192.168.11.
COMMENTS: Connection Timeout
COMMENTS: Port was NOT open, can not create session.
Error + log.docx

How to troubleshoot: Postinstallation scripts do not appear to run automatically

Hi, I'm leveraging the preparerootdomain.ps1 and New-ADLabAccounts 2.0.ps1 scripts in my lab setup. There is no evidence of the scripts being run during lab setup. If I manually copy the scripts and dependent files into the VMs after the fact, they run successfully.
None of the on-screen text from the lab build reveals the problem. Are there other logs I can leverage to help troubleshoot this?

Here are the relevant sections from the lab install script:

$roles = Get-LabMachineRoleDefinition -Role RootDC -Properties @{ DomainFunctionalLevel = 'Win2008R2'; ForestFunctionalLevel = 'Win2008R2' }
Add-LabMachineDefinition -Name TSDC1 -IpAddress 192.168.3.2 -DomainName tailspintoys.com -Memory 2048MB -Processors 2 -Roles $roles -OperatingSystem 'Windows Server 2016 SERVERSTANDARD' -PostInstallationActivity $postInstallActivity

and

$roles = Get-LabMachineRoleDefinition -Role FirstChildDC -Properties @{ ParentDomain = 'tailspintoys.com'; NewDomain = 'tschild'; DomainFunctionalLevel = 'Win2008R2'}
$postInstallActivity = Get-LabPostInstallationActivity -ScriptFileName 'New-ADLabAccounts 2.0.ps1' -DependencyFolder $labSources\PostInstallationActivities\ADDS_small
Add-LabMachineDefinition -Name TSChildDC1 -IpAddress 192.168.3.4 -DnsServer1 192.168.3.2 -DomainName TSchild.tailspintoys.com -Memory 1024MB -Roles $roles -PostInstallationActivity $postInstallActivity

Installer should support updating

Right now the old version of AL needs to be uninstalled before a new version can be installed. In an upgrade scenario the installer should consider the previously selected paths.

Adding disks to VMs does not work

The SM Azure implementation supported adding additional disks to a VM.

Add-LabDiskDefinition -Name BackupRoot -DiskSizeInGb 40
Add-LabMachineDefinition -Name Server1 -Roles SQLServer2012 -DiskName BackupRoot

The RM Azure implementation simply ignores this.

Creating and adding the disks in Azure should be enough. The function Initialize-LWAzureVM takes care of the init and format inside the VMs.

Validator should also verify DNS settings

This issue was imported from CodePlex

raandree wrote 2014-01-16 at 14:22
Member servers need to point to a DNS server in their own domain. If this is not the case, timing issues occurred during various installations.

DCs should point to itself first and then to a 2nd DC in the same domain.

Cannot Create a Lab in Windows 10 Laptop

I have installed the Hyper V and Automated Lab on my Laptop but when I run a script it isn't working. Having an error of "Exception calling "Import" with "1" argument(s): "The given path's Format is not supported. I attached the image error. Please help.
issue

Mount-LabIsoImage sometimes fails to pass through DVD drive letter

AutomatedLab 3.8.0.8 will sometimes fail to pass through the driveletter of the mounted ISO image.

For me this can be reliably reproduced with the Citrix Provisioning Services 7.11 ISO by executing

2016-11-07 06_50_23-administrator_ posh git automatedlab-scripts master

It works fine however for the XenDesktop 7.11 ISO. For now, I'll have to work around that in my script by using static drive letters.

Interestingly enough the drive is mounted without error and looking at the code in Mount-LWIsoImage the WMI query to detect the drive letters returns the mounted drive just fine:

2016-11-07 06_54_09-xa711-pvs1 auf torstenspc - verbindung mit virtuellen computern

pending reboot detection

This issue was imported from CodePlex

twilf wrote 2015-04-23 at 22:55
I keep on having issues with pending reboots blocking the installation of stuff like exchange. It would be nice to have a function that detects if there is a pending reboot.

I am not sure how the approval process works on new stuff, but I would be happy to take this on if its ok.

Trevor

raandree wrote 2015-04-24 at 00:53
I am actually working in a new installation routine for Exchange. This one also works on Azure VMs then.

Do you observe the issue only with the Exchange installation or is it more general?

twilf wrote 2015-04-24 at 01:30
So far exchange has been the my only problem. Im not at my desk at the moment, but i think it is saying that it has a role based reboot pending.

twilf wrote 2015-04-24 at 15:55
Here is the error info:

VERBOSE: D:\Setup /mode:Install /role:ClientAccess,Mailbox /OrganizationName:TestOrg /InstallWindowsComponents /IAcceptExchangeServerLicenseTerms
There is a pending reboot from a previous installation of a Windows Server role or feature. Please restart the computer and then run Setup again.
    + CategoryInfo          : NotSpecified: (There is a pend...un Setup again.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : 192.168.55.52

The Active Directory schema isn't up-to-date, and this user account isn't a member of the 'Schema Admins' and/or 'Enterprise Admins' groups.
Global updates need to be made to Active Directory, and this user account isn't a member of the 'Enterprise Admins' group.
The local domain needs to be updated. You must be a member of the 'Domain Admins' group and 'Organization Management' role group, or 'Enterprise Admins' group to continue.
You must be a member of the 'Organization Management' role group or a member of the 'Enterprise Admins' group to continue.
You must use an account that's a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.
You must use an account that's a member of the Organization Management role group to install the first Client Access server role in the topology.
You must use an account that's a member of the Organization Management role group to install the first Client Access server role in the topology.
You must use an account that's a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.
You must use an account that's a member of the Organization Management role group to install or upgrade the first Client Access server role in the topology.
You must use an account that's a member of the Organization Management role group to install the first Mailbox server role in the topology.
Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the
local computer is not in the same domain and site as the schema master.  Run setup with the /prepareAD parameter on a computer in the domain vm and site Default-First-Site-Name,
and wait for replication to complete.  See the Exchange setup log for more information on this error.
The forest functional level of the current Active Directory forest is not Windows Server 2003 native or later. To install Exchange Server 2013, the forest functional level must
be at least Windows Server 2003 native.
Either Active Directory doesn't exist, or it can't be contacted.

Ill pull, and compile the latest so that I can see what you are doing with exchange.

twilf wrote 2015-04-28 at 18:03
When i step through the functions in the exchange install scripts, I get my first errors with the Install-LabExchange2013Schema function

stepping through Install-LabExchange2013Schema function, running

Invoke-LabCommand -ActivityName Exchange2013ForestPrep -ComputerName $rootDc -ScriptBlock $cmd -DependencyIsoImage $isoImage -UseCredSsp

Here is the error I am getting:

The Active Directory schema isn't up-to-date, and this user account isn't a member of the 'Schema Admins' and/or 'Enterprise Admins' groups.
    + CategoryInfo          : NotSpecified: (The Active Dire...Admins' groups.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : 192.168.55.10

I am not sure which account is being used, however, I have manually verified that the admin account is a member of the schema and enterprise groups. I also manually applied the gpo settings done in Enable-LabVMRemoting because it appeared that only "Allow
delegating fresh credentials" was getting set.

raandree wrote 2015-04-30 at 00:48
Can you try using version 3.3 again, please? Now the Exchange ISO is no longer required, instead AL copies the setup file Exchange2013-x64-cu5.exe (available from

http://www.microsoft.com/en-us/download/details.aspx?id=43103) to the exchange server along with UcmaRuntimeSetup.exe.

Automating the Exchange Setup is really a pain due to various anomalies. I hope the new scripts work better.

Thanks for your time and effort!

twilf wrote 2015-04-30 at 23:26
thank you as well.

I did not have time to dig into it a lot, but it looks like I had a couple problems. I saw the changes you made to the labexchange.psm1 and in my situation, downloading from an un-authed computers is strictly prohibited. So this approach wont work in my situation.
Could we do something where if the file does not exist, then download?

results:

Copy-LabFileItem : Cannot bind argument to parameter 'Path' because it is null.
At \\home.slhs.org\Wilfordt$\My Documents\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabExchange.psm1:247 char:32
+         Copy-LabFileItem -Path $exchangeFile.FullName -DestinationFolder C:\Inst ...
+                                ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-LabFileItem], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Copy-LabFileItem

Copy-LabFileItem : Cannot bind argument to parameter 'Path' because it is null.
At \\home.slhs.org\Wilfordt$\My Documents\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabExchange.psm1:247 char:32
+         Copy-LabFileItem -Path $exchangeFile.FullName -DestinationFolder C:\Inst ...
+                                ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-LabFileItem], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Copy-LabFileItem

Write-Error : Exchange Schema Update failed on server 'T9A-EXCH1'. See content of AL_5e366413-1d5b-473b-a3c5-91dc83b038f6 for details.
At \\home.slhs.org\Wilfordt$\My Documents\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabExchange.psm1:344 char:17
+                 Write-Error "Exchange Schema Update failed on server '$machine'. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error

I changed the following:

function Copy-LabExchangeInstallationFiles
{
    param(
        [Parameter(Mandatory = $true)]
        [AutomatedLab.Machine]$Machine
    )

    #copy the files to the destination machine
    if ($Machine.HostType -eq 'HyperV')
    {
        $exchangeInstallUri = New-Object System.Uri($ExchangeInstallLink)
        $exchangeInstallFileName = $ExchangeInstallUri.Segments[$ExchangeInstallUri.Segments.Count-1]
        $ucmaInstallUri = New-Object System.Uri($UcmaInstallLink)
        $ucmaInstallFileName = $ucmaInstallUri.Segments[$ucmaInstallUri.Segments.Count-1]

        $labSources = Get-LabSourcesLocation

        $ucmaFile = dir -Path $labSources -Filter $ucmaInstallFileName -Recurse
        Copy-LabFileItem -Path $ucmaFile.FullName -DestinationFolder C:\Install -ComputerName $Machine
    
        $exchangeFile = dir -Path $labSources -Filter $exchangeInstallFileName -Recurse
        Copy-LabFileItem -Path $exchangeFile.FullName -DestinationFolder C:\Install -ComputerName $Machine
    }
}

to

function Copy-LabExchangeInstallationFiles
{
    param(
        [Parameter(Mandatory = $true)]
        [AutomatedLab.Machine]$Machine
    )

    #copy the files to the destination machine
    if ($Machine.HostType -eq 'HyperV')
    {
        $exchangeInstallUri = New-Object System.Uri($ExchangeInstallLink)
        $exchangeInstallFileName = $ExchangeInstallUri.Segments[$ExchangeInstallUri.Segments.Count-1]
        $ucmaInstallUri = New-Object System.Uri($UcmaInstallLink)
        $ucmaInstallFileName = $ucmaInstallUri.Segments[$ucmaInstallUri.Segments.Count-1]

        $labSources = Get-LabSourcesLocation

        if (!(test-path $labSources\SoftwarePackages\Exchange\$ucmaInstallFileName)) {
            $ucmaFile = dir -Path $labSources -Filter $ucmaInstallFileName -Recurse
            Copy-LabFileItem -Path $ucmaFile.FullName -DestinationFolder C:\Install -ComputerName $Machine
        }else{
            Copy-LabFileItem -Path $labSources\SoftwarePackages\Exchange\$ucmaInstallFileName -DestinationFolder C:\Install -ComputerName $Machine
        }

        if (!(test-path $labSources\SoftwarePackages\Exchange\$exchangeInstallFileName)) {    
            $exchangeFile = dir -Path $labSources -Filter $exchangeInstallFileName -Recurse
            Copy-LabFileItem -Path $exchangeFile.FullName -DestinationFolder C:\Install -ComputerName $Machine
        }else{
            Copy-LabFileItem -Path $labSources\SoftwarePackages\Exchange\$exchangeInstallFileName -DestinationFolder C:\Install -ComputerName $Machine
        }
    }
}

after changing that the error I get is:

WARNING: Need to do a restart of 'T9A-EXCH1' before installing Exchange
Write-Error : Exchange installation failed on server 'T9A-EXCH1'. See content of AL_569f3c4f-9681-44ac-aa69-8cb2f08a74f8 for details.
At \\home.slhs.org\Wilfordt$\My Documents\WindowsPowerShell\Modules\AutomatedLab\AutomatedLabExchange.psm1:492 char:13
+             Write-Error "Exchange installation failed on server '$machine'. See  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error

Visual Studio images are not considered in Azure

So far AL considers only plain Windows Server and SQL Server images. The images for Visual Studio need to be added.

Note: Client operating systems are only available with an MSDN subscription.

Display a summary after successfull deployment

That summary should contain:

  • Machines (like Get-LabVM) + Roles
  • Useful cmdlets for interacting with the lab

Something like Get-AutomatedLabCommands similar to Get-ExCommands would also be helpful.

Waiting for machines to start up..

AL may sit at the "Waiting for machines to start up.." status indefinitely: On Hyper-V hosts that have preexisting internal networks. My script kept stalling here even though I had connectivity between the host and the machines that it was waiting to start up. The solution was to go into Virtual Switch Manager and remove all the other internal vSwitches.

Invoke-LabCommand -AsJob should add arguments to the job

It is quite hard to debug jobs created by AL. Each PowerShell job has a command property but the scriptblock / command is not easy to understand if the arguments are not stored as well. Adding the arguments to the job should help quite a lot.

Server 2016 does not offer all commonly available Windows Features

Sometimes a Windows Server 2016 RTM does not have all Windows Features after the first boot. Hence installing certain services does not work. After a reboot the server installs the missing features. This happens only sometimes and needs further monitoring.

In case of the problem the Windows Feature list looks like this:
cdfdc210-86f7-11e6-86c3-0e45d4ec5160

Remove-Lab also removes AutomatedLabSources

The AutomatedLabSources Resource Group should not be removed when removing a lab.

23:22:05|00:00:00|00:00:00.000| Removing lab 'ADRESasdad'
23:22:05|00:00:00|00:00:00.018| - Removing lab sessions
23:22:05|00:00:00|00:00:00.334| - Removing lab background jobs
WARNING: READ THIS CAREFULLY!!! The following (2) Azure Resource Groups will be removed including ALL resources (ALL machines, ALL networks etc) within these Azure Resource Groups
WARNING: Azure Resource Group: ADRESasdad
WARNING: Azure Resource Group: AutomatedLabSources

WARNING: Type "Y" (and press ) to continue or any other key to cancel this operation
y
23:22:13|00:00:08|00:00:08.553| - Removing Resource Group(s) 'ADRESasdad,AutomatedLabSources' and all resources in these group(s)

Install-LabSoftwarePackage and MSI packages...

..after playing a little with installing software on my labvm´s - it seems that installing MSI packages with the command:

Install-LabSoftwarePackage -ComputerName <name> -Path <path-to-installer> -CommandLine '/S'

not working as expected - i ended always with the error:

"The specified executable is not a valid application for this OS platform."

.exe installers like Notepad++:

Install-LabSoftwarePackage -ComputerName CLIENT1 -Path D:\LabSources\SoftwarePackages\npp.7.Installer.x64.exe -CommandLine '/S'

or .msu Packages like WindowsTH-RSAT_WS2016.msu:

Install-LabSoftwarePackage -ComputerName CLIENT1 -Path D:\LabSources\SoftwarePackages\WindowsTH-RSAT_WS2016-x64.msu -CommandLine '/quiet /norestart'

are working fine.

CLIENT1 is a Win10Pro-64bit VM - and i try to install the following MSI packages - ending up with the error above:

7-Zip:

Install-LabSoftwarePackage -ComputerName CLIENT1 -Path D:\LabSources\SoftwarePackages\7z1602-x64.msi -CommandLine '/S'

Putty:

Install-LabSoftwarePackage -ComputerName CLIENT1 -Path D:\LabSources\SoftwarePackages\putty-64bit-0.68-installer.msi -CommandLine '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'

Workaround:

on the same client the following command´s are installing both msi packages correctly without errors:

Invoke-LabCommand -ComputerName CLIENT1 -ScriptBlock { msiexec /i "C:\putty-64bit-0.68-installer.msi" }
Invoke-LabCommand -ComputerName CLIENT1 -ScriptBlock { msiexec /i "C:\7z1602-x64.msi" }

adding a new lab machine after re-importing a lab is not possible

This is not necessarily an issue per se, but probably more of a feature request.

It would be great if an existing lab could be extended later by running Import-Lab and then adding machine definitions to it, installing those explicitly.

Attempting to do so currently fails with an error message: "Create a new lab first using 'New-LabDefinition' before adding machines".

This would allow creation of more complex multi-part labs.

Feature request: Add option to have VM name be different than computer name

I would like to be able to define a different name for the VM than the actual computer name. The reason is because AL fails if there is a machine on the hyper-v host that already has the same name.
I would like to have the VM name be $labname_computername like this:

$labName = 'ADDS'

DC name is ContosoDC1

VM name in Hyper-V is:

ADDS_ContosoDC1

Support for Configuration Manager

It'd be great if this automation lab included Configuration Manager or even better the whole stack. I see that it supports Orchestrator and digging into AutomatedLabDefinition.psd1 I see that a memory weight appears to be defined for a few of the System Center stack.

ISO Offline Patching should check for already applied hotfixes

When WSUS Offline (http://www.wsusoffline.net) is used to download hotfixes for a product the fixes are all placed in one folder.
When running offline patching, it tries to apply all fixes in that folder even if they are already applied in one of the previous runs.
This is very time consuming if you update ISO's every month.
At the moment, the only possibility is to copy the old hotfixes into another folder. They need to be copied back befor running WSUS offline again. Otherwise they are all re-donwloaded again.

Offline patching could work with time stamps, check sum or a state file for a specific iso to only apply newer hotfixes

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.