pluralsight / PS-AutoLab-Env

A PowerShell module for creating lab configurations using Lability and Desired State Configuration. Look at README.md for more information.
MIT License
268 stars 75 forks source link

Setup-Lab TImeout New-LabImage #203

Closed junz05 closed 4 years ago

junz05 commented 4 years ago

Hi All, I have the following error when setting up any lab that involves a server. Windows10 image creation works fine. Please assist.

PSAutoLabSetting PSVersion : 5.1.18362.145 Edition : Desktop OS : Microsoft Windows 10 Pro PSAutolab : 4.3.0 Lability : 0.18.0 Pester : 4.9.0 Memory : 12454856

Error Building the lab environment for MultiRole Failed to start lab configuration. New-LabImage : The semaphore timeout period has expired. At line:120 char:27

jdhitsolutions commented 4 years ago

I'm testing this configuration again. Can you build the SingleServer configuration? If so, try the MultiRole again but first use Start-Transcript to start a log. Run the install. Stop the transcript and then post the transcript. Hopefully, that will provide some insight into what is different about your environment. Did you have previous versions of this module installed?

jdhitsolutions commented 4 years ago

I have not been able to duplicate your error. Another possibility that comes to mind is that your desktop is low on memory and that's why you are getting a timeout error. Before you start the lab, how much free memory do you have?

Get-CimInstance Win32_OperatingSystem | Select-object FreePhysicalMemory,TotalVisibleMemorySize,
@{Name="PctFree";Expression = {($_.FreePhysicalMemory/$_.TotalVisibleMemorySize)*100  }}

You might try closing as many other applications as you can and then try running the lab.

junz05 commented 4 years ago

Thank you Jeff. I tried the above and still the same error. Before i start the lab I have about 7.5GB available. I have tried the Win10 and Single Server labs and they I get the same issue Please see below powershell transcript:


Windows PowerShell transcript start Start time: 20191123132156 Configuration Name: Machine: MEDIA-NZXT (Microsoft Windows NT 10.0.18362.0) Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Process ID: 11396 PSVersion: 5.1.18362.145 PSEdition: Desktop PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.18362.145 BuildVersion: 10.0.18362.145 CLRVersion: 4.0.30319.42000 WSManStackVersion: 3.0 PSRemotingProtocolVersion: 2.3 SerializationVersion: 1.1.0.1


Transcript started, output file is C:\Users\Documents\PowerShell_transcript.MEDIA-NZXT.M3Cmnhnj.20191123132156.txt PS C:\Autolab\Configurations\Windows10> setup-lab

    This is the Setup-Lab script. This script will perform the following:

    * Run the configs to generate the required .mof files
    Note! - If there is an error creating the .mofs, the setup will fail

    * Run the lab setup
    Note! If this is the first time you have run this, it can take several
    hours to download the ISO files and resources depending on the configuration.
    You may also see new drives being added and removed as the ISO is mounted
    and converted. This step should only happen the first time you run this
    command.

    ** Possible problem
    If the downloads finish but the script doesn't continue (pauses),
    press the Enter key once and it should continue

    *You will be able to wipe and rebuild this lab without needing to perform
    the downloads again.

Installing required DSCResource modules from PSGallery You may need to say "yes" to a Nuget Provider xComputerManagement [v4.1.0.0] requires no updates. xNetworking [v5.7.0.0] requires no updates. xWindowsUpdate [v2.8.0.0] requires no updates. xPSDesiredStateConfiguration [v8.9.0.0] requires no updates. xPendingReboot [v0.4.0.0] requires no updates. Build the .Mof files from the configs Building the lab environment for Windows10 PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist." PS C:\Autolab\Configurations\Windows10> TerminatingError(Resolve-Path): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\Lability\0.18.0\Config\CustomMedia.json' because it does not exist."

jdhitsolutions commented 4 years ago

This looks like you have an incomplete or corrupted installation of the Lability module. I'd suggest uninstalling the module:

uninstall-module lability

and then re-install the module

install-module lability -RequiredVersion 0.18.0

Open a new elevated PowerShell session and try again.

junz05 commented 4 years ago

Tried your reinstalling lability module as suggested but still have the same issue.

I will reinstall my OS and try again. It keeps looking for the custommedia.json which is not in the lability module config folder even after the reinstall.

jdhitsolutions commented 4 years ago

This shouldn't be an OS problem. I checked, and even I don't have that file. I have media.json. This makes me wonder if you have old versions of anything. Have you ever had older versions of the Autolab module installed? If you run:

get-module lability -listavailable

Do you have anything older than 0.18.0 installed?

junz05 commented 4 years ago

No older versions only have the below

image

junz05 commented 4 years ago

Reinstalled my OS and its working now. Haven't run any updates after install so will try again after updates are run

jdhitsolutions commented 4 years ago

Very odd but I'm glad it is working now.