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

POC-MultiRole> unattend-lab (error on DC1 and S1 images VHDx's) #159

Closed trev-aus closed 6 years ago

trev-aus commented 6 years ago

Please, help!

When I run the unattend-lab on PS D:\AutoLab\Configurations\POC-MultiRole> unattend-lab I get the following message for the DC1 and S1 images,

N1 and Cli1 manage to pass without any error message

**Building the lab environment New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

  • ... ef] $null = New-LabImage -Id $node.Media -ConfigurationData $Configur ...
  • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
  • FullyQualifiedErrorId :

Microsoft.PowerShell.Commands.WriteErrorException,New-LabImage**


Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> cd\ PS C:> d: PS D:> cd .\AutoLab\Configurations\ PS D:\AutoLab\Configurations> cd .\POC-MultiRole\ PS D:\AutoLab\Configurations\POC-MultiRole> unattend-lab

   This runs Setup-Lab, Run-Lab, and validate-Lab

Starting the lab environment

    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's and resources.
    This only occurs the first time.

    **Possible problem, if the downloads finish but the script doesn't continue (pauses)
        Hit the return key once and it will 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 Build the .Mof files from the configs

Directory: D:\AutoLab\Configurations\POC-MultiRole

Mode LastWriteTime Length Name


-a---- 14/10/2018 22:33 526182 DC1.mof -a---- 14/10/2018 22:33 1078 DC1.meta.mof -a---- 14/10/2018 22:33 8916 S1.mof -a---- 14/10/2018 22:33 1076 S1.meta.mof -a---- 14/10/2018 22:33 5820 N1.mof -a---- 14/10/2018 22:33 1076 N1.meta.mof -a---- 14/10/2018 22:33 13260 Cli1.mof -a---- 14/10/2018 22:33 1080 Cli1.meta.mof **Building the lab environment New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [22:34:11] Removing incomplete image 'D:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [22:34:12] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:12] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:12] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' does not exist.'. New-VM : Failed to add device 'Virtual Hard Disk'. Attachment 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' not found. Error: 'The system cannot find the file specified.'. 'DC1' failed to add device 'Virtual Hard Disk'. (Virtual machine ID 21F3A286-9796-4670-BEDE-49B671579D28) 'DC1': Attachment 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' not found. Error: 'The system cannot find the file specified.' (0x80070002). (Virtual machine ID 21F3A286-9796-4670-BEDE-49B671579D28) At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

Set-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:435 char:67

Dismount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:438 char:9

Get-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [22:34:35] Removing incomplete image 'D:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [22:34:35] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:35] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:35] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' does not exist.'. New-VM : Failed to add device 'Virtual Hard Disk'. Attachment 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' not found. Error: 'The system cannot find the file specified.'. 'S1' failed to add device 'Virtual Hard Disk'. (Virtual machine ID DA5F702B-A0DB-45FA-91F1-B7954A7891BD) 'S1': Attachment 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' not found. Error: 'The system cannot find the file specified.' (0x80070002). (Virtual machine ID DA5F702B-A0DB-45FA-91F1-B7954A7891BD) At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

Set-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

Configuring node 'Cli1'. Processing [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo ] Downloading 'http://download.microsoft.com/download/2/5/4/254230E8-AEA5-43C5-94F6-88CE222A5846/14393.0.160715-1616.RS1_ 726,862,382 of 3,903,653,888 bytes (19 %). [oooooooooooooooooooo ]

Get-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

Name : N1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

ChrisLGardner commented 6 years ago

Make sure you update to the latest version of Lability, there was a bug in an older version that meant it wouldn't download iso files correctly.


From: trev-aus notifications@github.com Sent: Sunday, October 14, 2018 10:51:35 PM To: theJasonHelmick/PS-AutoLab-Env Cc: Subscribed Subject: [theJasonHelmick/PS-AutoLab-Env] POC-MultiRole> unattend-lab (error on DC1 and S1 images VHDx's) (#159)

Please, help!

When I run the unattend-lab on PS D:\AutoLab\Configurations\POC-MultiRole> unattend-lab I get the following message for the DC1 and S1 images,

N1 and Cli1 manage to pass without any error message

**Building the lab environment New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

Microsoft.PowerShell.Commands.WriteErrorException,New-LabImage**


Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> cd PS C:> d: PS D:> cd .\AutoLab\Configurations PS D:\AutoLab\Configurations> cd .\POC-MultiRole PS D:\AutoLab\Configurations\POC-MultiRole> unattend-lab

This runs Setup-Lab, Run-Lab, and validate-Lab

Starting the lab environment

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's and resources.
This only occurs the first time.

**Possible problem, if the downloads finish but the script doesn't continue (pauses)
    Hit the return key once and it will 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 Build the .Mof files from the configs

Directory: D:\AutoLab\Configurations\POC-MultiRole

Mode LastWriteTime Length Name


-a---- 14/10/2018 22:33 526182 DC1.mof -a---- 14/10/2018 22:33 1078 DC1.meta.mof -a---- 14/10/2018 22:33 8916 S1.mof -a---- 14/10/2018 22:33 1076 S1.meta.mof -a---- 14/10/2018 22:33 5820 N1.mof -a---- 14/10/2018 22:33 1076 N1.meta.mof -a---- 14/10/2018 22:33 13260 Cli1.mof -a---- 14/10/2018 22:33 1080 Cli1.meta.mof **Building the lab environment New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [22:34:11] Removing incomplete image 'D:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [22:34:12] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:12] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:12] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' does not exist.'. New-VM : Failed to add device 'Virtual Hard Disk'. Attachment 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' not found. Error: 'The system cannot find the file specified.'. 'DC1' failed to add device 'Virtual Hard Disk'. (Virtual machine ID 21F3A286-9796-4670-BEDE-49B671579D28) 'DC1': Attachment 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' not found. Error: 'The system cannot find the file specified.' (0x80070002). (Virtual machine ID 21F3A286-9796-4670-BEDE-49B671579D28) At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

*

    $null = New-VM @parameters

*

            ~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : NotSpecified: (:) [New-VM], VirtualizationException
 *   FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.NewVM

Set-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

*

    $null = Set-VM @parameters

*

            ~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : ObjectNotFound: (:) [Set-VM], VirtualizationException
 *   FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.SetVM

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

*

$vhd = Mount-Vhd -Path $vhdPath -Passthru;

*

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (:) [Mount-VHD], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.MountVhd

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

*

$vhdDriveLetter = Get-Partition -DiskNumber $vhd.DiskNumber |

*

                                            ~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidData: (:) [Get-Partition], ParameterBindingValidationException
 *   FullyQualifiedErrorId : ParameterArgumentValidationError,Get-Partition

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:435 char:67

Dismount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:438 char:9

*

Dismount-Vhd -Path $VhdPath;

*

~~~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (:) [Dismount-VHD], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.DismountVHD

Get-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

*

Write-Output -InputObject (Get-VM -Name $displayName);

*

                           ~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (DC1:String) [Get-VM], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM

New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [22:34:35] Removing incomplete image 'D:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [22:34:35] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:35] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [22:34:35] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' does not exist.'. New-VM : Failed to add device 'Virtual Hard Disk'. Attachment 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' not found. Error: 'The system cannot find the file specified.'. 'S1' failed to add device 'Virtual Hard Disk'. (Virtual machine ID DA5F702B-A0DB-45FA-91F1-B7954A7891BD) 'S1': Attachment 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' not found. Error: 'The system cannot find the file specified.' (0x80070002). (Virtual machine ID DA5F702B-A0DB-45FA-91F1-B7954A7891BD) At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

*

    $null = New-VM @parameters

*

            ~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : NotSpecified: (:) [New-VM], VirtualizationException
 *   FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.NewVM

Set-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

*

    $null = Set-VM @parameters

*

            ~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : ObjectNotFound: (:) [Set-VM], VirtualizationException
 *   FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.SetVM

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'D:\AutoLab\VMVirtualHardDisks\S1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

*

$vhd = Mount-Vhd -Path $vhdPath -Passthru;

*

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (:) [Mount-VHD], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.MountVhd

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

*

$vhdDriveLetter = Get-Partition -DiskNumber $vhd.DiskNumber |

*

                                            ~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidData: (:) [Get-Partition], ParameterBindingValidationException
 *   FullyQualifiedErrorId : ParameterArgumentValidationError,Get-Partition

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

Configuring node 'Cli1'. Processing [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo ] Downloading 'http://download.microsoft.com/download/2/5/4/254230E8-AEA5-43C5-94F6-88CE222A5846/14393.0.160715-1616.RS1_ 726,862,382 of 3,903,653,888 bytes (19 %). [oooooooooooooooooooo ]

*

Dismount-Vhd -Path $VhdPath;

*

~~~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (:) [Dismount-VHD], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.DismountVHD

Get-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

*

Write-Output -InputObject (Get-VM -Name $displayName);

*

                           ~~~~~~~~~~~~~~~~~~~~~~~~~

 *   CategoryInfo : InvalidArgument: (S1:String) [Get-VM], VirtualizationException
 *   FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM

Name : N1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/theJasonHelmick/PS-AutoLab-Env/issues/159, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQDqFi9QUh3qZtEcFW_IJIA2yQHbTHDiks5uk7HngaJpZM4XbWfR.

bokenterp commented 6 years ago

I am having the same or similar issue. DC1 and S1 will not build. I have installed the latest and greatest lability...

PS C:\AutoLab\Configurations\POC-MultiRole> Unattend-Lab

   This runs Setup-Lab, Run-Lab, and validate-Lab

Starting the lab environment

    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's and resources.
    This only occurs the first time.

    **Possible problem, if the downloads finish but the script doesn't continue (pauses)
        Hit the return key once and it will 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 Build the .Mof files from the configs

Directory: C:\AutoLab\Configurations\POC-MultiRole

Mode LastWriteTime Length Name


-a---- 10/28/2018 12:55 AM 526278 DC1.mof -a---- 10/28/2018 12:55 AM 1174 DC1.meta.mof -a---- 10/28/2018 12:55 AM 9012 S1.mof -a---- 10/28/2018 12:55 AM 1172 S1.meta.mof -a---- 10/28/2018 12:55 AM 5916 N1.mof -a---- 10/28/2018 12:55 AM 1172 N1.meta.mof -a---- 10/28/2018 12:55 AM 13356 Cli1.mof -a---- 10/28/2018 12:55 AM 1176 Cli1.meta.mof Building the lab environment New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [1:12:15 AM] Removing incomplete image 'C:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [1:12:15 AM] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [1:12:15 AM] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [1:12:15 AM] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'C:\AutoLab\VMVirtualHardDisks\DC1.vhdx' does not exist.'. New-VM : Adding the device 'Microsoft:Hyper-V:Virtual Hard Disk' to 'DC1' failed. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

Set-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'C:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:435 char:67

Dismount-Vhd : 'C:\AutoLab\VMVirtualHardDisks\DC1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:438 char:9

Get-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

New-LabImage : Either the Name or Index parameter is required At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:357 char:27

WARNING: [1:12:33 AM] Removing incomplete image 'C:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'. WARNING: [1:12:33 AM] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [1:12:33 AM] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generation'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.'. WARNING: [1:12:33 AM] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'C:\AutoLab\VMVirtualHardDisks\S1.vhdx' does not exist.'. New-VM : Adding the device 'Microsoft:Hyper-V:Virtual Hard Disk' to 'S1' failed. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:350 char:21

Set-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:371 char:21

Set-VMFirmware : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xV MHyperV.psm1:399 char:21

Mount-Vhd : 'C:\AutoLab\VMVirtualHardDisks\S1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:423 char:16

Get-Partition : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:425 char:53

SetLabVMDiskFileResource : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:430 char:69

SetLabVMDiskFileBootstrap : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:431 char:70

SetLabVMDiskFileUnattendXml : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:432 char:72

SetLabVMDiskFileMof : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:433 char:64

SetLabVMDiskFileCertificate : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:434 char:72

SetLabVMDiskFileModule : Cannot validate argument on parameter 'VhdDriveLetter'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:435 char:67

Dismount-Vhd : 'C:\AutoLab\VMVirtualHardDisks\S1.vhdx' is not an existing virtual hard disk file. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVMDiskFile.ps1:438 char:9

Get-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\LabVM.ps1:433 char:36

Name : N1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

Name : Cli1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

WARNING: [1:37:53 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'. WARNING: [1:37:53 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'.

Name : N1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

Name : Cli1 State : Off CpuUsage : 0 MemoryAssigned : 0 MemoryDemand : 0 MemoryStatus : Uptime : 00:00:00 Status : Operating normally ReplicationState : Disabled Generation : 2

    Next Steps:

    When complete, run:
    Run-Lab

    Run the following to validatae when configurations have converged:
    Validate-Lab

    To enable Internet access for the VM's, run:
    Enable-Internet

    To stop the lab VM's:
    Shutdown-lab

    When the configurations have finished, you can checkpoint the VM's with:
    Snapshot-Lab

    To quickly rebuild the labs from the checkpoint, run:
    Refresh-Lab

    To destroy the lab to build again:
    Wipe-Lab

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

VM Completion Test Tests failed 00:01:45 remaining.

Waiting until next test run

Starting the lab environment Start-VM : Hyper-V was unable to find a virtual machine with name "DC1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\Lab.ps1:57 char:13

Start-VM : Hyper-V was unable to find a virtual machine with name "S1". At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\Src\Lab.ps1:57 char:13

Caption : Description : ElementName : InstanceID : CommunicationStatus : DetailedStatus : HealthState : InstallDate : Name : ;C<8;@B8=8;55?:55;55; OperatingStatus : OperationalStatus : PrimaryStatus : Status : StatusDescriptions : AvailableRequestedStates : EnabledDefault : 2 EnabledState : OtherEnabledState : RequestedState : 12 TimeOfLastStateChange : TransitioningToState : 12 CreationClassName : SystemCreationClassName : SystemName : NameFormat : OtherTypeDescription : ProtocolIFType : 4096 ProtocolType : Address : AddressOrigin : 0 AddressType : IPv4Address : 192.168.3.1 IPv6Address : IPVersionSupport : PrefixLength : 24 SubnetMask : AddressFamily : IPv4 AddressState : Tentative InterfaceAlias : vEthernet (LabNet) InterfaceIndex : 50 IPAddress : 192.168.3.1 PreferredLifetime : 10675199.02:48:05.4775807 PrefixOrigin : Manual SkipAsSource : False Store : ActiveStore SuffixOrigin : Manual Type : Unicast ValidLifetime : 10675199.02:48:05.4775807 PSComputerName : ifIndex : 50

Caption : Description : ElementName : InstanceID : CommunicationStatus : DetailedStatus : HealthState : InstallDate : Name : ;C<8;@B8=8;55?:55;55: OperatingStatus : OperationalStatus : PrimaryStatus : Status : StatusDescriptions : AvailableRequestedStates : EnabledDefault : 2 EnabledState : OtherEnabledState : RequestedState : 12 TimeOfLastStateChange : TransitioningToState : 12 CreationClassName : SystemCreationClassName : SystemName : NameFormat : OtherTypeDescription : ProtocolIFType : 4096 ProtocolType : Address : AddressOrigin : 0 AddressType : IPv4Address : 192.168.3.1 IPv6Address : IPVersionSupport : PrefixLength : 24 SubnetMask : AddressFamily : IPv4 AddressState : Invalid InterfaceAlias : vEthernet (LabNet) InterfaceIndex : 50 IPAddress : 192.168.3.1 PreferredLifetime : 10675199.02:48:05.4775807 PrefixOrigin : Manual SkipAsSource : False Store : PersistentStore SuffixOrigin : Manual Type : Unicast ValidLifetime : 10675199.02:48:05.4775807 PSComputerName : ifIndex : 50

Caption : Description : ElementName : InstanceID : LabNat;0 Active : True ExternalIPInterfaceAddressPrefix : IcmpQueryTimeout : 30 InternalIPInterfaceAddressPrefix : 192.168.3.0/24 InternalRoutingDomainId : {00000000-0000-0000-0000-000000000000} Name : LabNat Store : Local TcpEstablishedConnectionTimeout : 1800 TcpFilteringBehavior : AddressDependentFiltering TcpTransientConnectionTimeout : 120 UdpFilteringBehavior : AddressDependentFiltering UdpIdleSessionTimeout : 120 UdpInboundRefresh : False PSComputerName :

    Next Steps:

    When complete, run:
    Run-Lab

    And run:
    Validate-Lab

[10/28/2018 01:39:02] Starting the VM testing process. This could take some time complete. Errors are expected until all tests complete successfully.

trev-aus commented 6 years ago

If you run the following PowerShell and re-run from the start!

update-module lability

bokenterp commented 6 years ago

apologies,,,from which directory in powershell. I dont seem to be able to run the command

bokenterp commented 6 years ago

I figured out how to remove the old lability and put 16 in. That did it. Thx!

tcn84 commented 5 years ago

Brokenterp, I have the exact same issue of DC1, and unable to update the liability module. How did you find 16 and replace the old liability?