PlagueHO / LabBuilder

PowerShell Module for building a Hyper-V Lab environment from a simple XML configuration file.
MIT License
223 stars 39 forks source link

Template Windows Server 2016 Datacenter Full' could not be found - Labuild does not respect given path #367

Open eliassal opened 4 years ago

eliassal commented 4 years ago

PSVersion 5.1.18362.752 Console Win 10 64bit ModuleType Version Name ExportedCommands

I updated the folders sample file "Sample_WS2016_NanoDomain.xml" as follows

labpath="H:\Hyper-V\LabBuilder\vm\NANOTEST.COM" isopath="H:\Hyper-V\LabBuilder\ISOs\" vhdpath="H:\Hyper-V\LabBuilder\VHDs\"

When I run the build, it looks somwhere else and uses some paths that I don't know why such as (and et the end I get always the error emplate Windows Server 2016 Datacenter Full' could not be found)

VERBOSE: [13:53:28]: Mounting C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\ISOFiles\14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO to use source WIM to create Template VHD Windows Server 2016 Datacenter Full VERBOSE: [13:53:28]: Converting 'Windows Server 2016 SERVERDATACENTER' in 'D:\Sources\Install.WIM' to a bootable Dynamic VHDx 'C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\VHDFiles\Windows Server 2016 Datacenter Full.vhdx'.

VERBOSE: Temporary VHDX path is : C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\VHDFiles\810b1fbe-0676-4244-9fa3-d24508b0a178.vhdx

VERBOSE: [13:53:34]: Creating the 'Nano Server 2016 Datacenter' VM Template VHD 'C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\VHDFiles\Nano Server 2016 Datacenter.vhdx'. VERBOSE: [13:53:34]: Mounting C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\ISOFiles\14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO to use source WIM to create Template VHD Nano Server 2016 Datacenter

VERBOSE: [13:55:42]: Dismounting C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\ISOFiles\14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO used for source WIM to create Template VHD Nano Server 2016 Datacenter

**New-LabException : The Template Source VHD 'C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\Samples\VHDFiles\Windows Server 2016 Datacenter Full.vhdx' in Template 'Template Windows Server 2016 Datacenter Full' could not be found. At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:9032 char:17

tehmessiah75 commented 8 months ago

I'm having the same issue with the server 2019 example xml (Sample_WS2019_DCandDHCPandCA). `New-LabException : The Template Source VHD 'c:\MyLab\VHDFiles\Windows Server 2019 Datacenter.vhdx' in Template 'Template Windows Server 2019 Datacenter' could not be found. At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.2.0\LabBuilder.psm1:9097 char:17

The log files contain nothing more than what is already printed in the PS window.

I couldn't find seperate Core and Full server images at microsoft. The latest image I downloaded from MS is: 17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso

I tried replacing the template names for the isos to match my iso name. I tried the same iso name in both templates. Everything that I have tried has resulted in the same or similar error message

I created all to folders as instructed. I checked the Install.wim files and I also have been unable to find the Server Core and Server Full ISOs. I checked the ISOs that I have and the WIM files contain; `Details for image : Install.wim

Index : 1 Name : Windows Server 2019 Standard Description : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools. Size : 8,239,696,686 bytes

Index : 2 Name : Windows Server 2019 Standard (Desktop Experience) Description : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it. Size : 14,458,486,323 bytes

Index : 3 Name : Windows Server 2019 Datacenter Description : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools. Size : 8,240,234,076 bytes

Index : 4 Name : Windows Server 2019 Datacenter (Desktop Experience)`

tehmessiah75 commented 8 months ago

ok Different ISOs contain different "Edition" names. I had to mount the ISO and run the following cmd to get the actual names from my ISO Replace "D" with the mounted drive letter assigned to your ISO

DISM /Get-WimInfo /WimFile:"D:\sources\install.esd"

Part of the output. The name must be all of the name after "Name:" for the edition in the TemplateVHD section. Index : 4 Name : **Windows Server 2019 Datacenter Evaluation (Desktop Experience)** Description : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it. Size : 14,835,362,678 bytes

<templatevhd name="Windows Server 2019 Datacenter Full" iso="17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" url="https://software-download.microsoft.com/download/pr/" vhd="Windows Server 2019 Datacenter Full.vhdx" edition=**"Windows Server 2019 Datacenter Evaluation (Desktop Experience)"** ostype="Server" vhdformat="vhdx" vhdtype="dynamic" generation="2" vhdsize="50GB" />