Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Virtual network could not be created automatically #1603

Open
randallt opened this issue Jan 19, 2024 · 1 comment
Open

[Bug]: Virtual network could not be created automatically #1603

randallt opened this issue Jan 19, 2024 · 1 comment
Assignees
Labels
Question The issue is a question. Solution Delivered We think that a solution has been provided but waiting for response

Comments

@randallt
Copy link

Description

My first look into AutomatedLabs. Looks like an awesome project--kudos! I think I'm running v5.50 (as seen in the error message below).

I was trying to create a simple lab in Azure:

Install-Module automatedlab -scope currentuser 
New-LabSourcesFolder

$subscriptionName="my_subscription"
$locName="East US"

New-LabDefinition -Name ExchangePerfLab -DefaultVirtualizationEngine Azure

Add-LabAzureSubscription -DefaultLocationName $locName -SubscriptionName $subscriptionName

$PSDefaultParameterValues = @{
    'Add-LabMachineDefinition:DomainName' = 'lab.mine.local'
    'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2019 Datacenter (Desktop Experience)'
}

Add-LabMachineDefinition -Name E1DC1 -Roles RootDC -Memory 1GB

At this point I get a failure:

11:39:06|00:01:11|00:00:00.182|   - No virtual networks specified. Creating a network automatically
Virtual network could not be created. Please create virtual network manually by calling Add-LabVirtualNetworkDefinition (after calling New-LabDefinition)
At C:\Users\...\Documents\WindowsPowerShell\Modules\AutomatedLabDefinition\5.50.0\AutomatedLabDefinition.psm1:1236 char:25
+ ...             throw 'Virtual network could not be created. Please creat ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Virtual network...-LabDefinition):String) [], RuntimeException
    + FullyQualifiedErrorId : Virtual network could not be created. Please create virtual network manually by calling Add-LabVirtualNetworkDefinition (after calling New-LabDefinition)

Am I missing something, or are the docs/samples not caught up with a new Azure requirement to create the networks manually?

Steps to reproduce the issue

Install-Module automatedlab -scope currentuser 
New-LabSourcesFolder

$subscriptionName="my_subscription"
$locName="East US"

New-LabDefinition -Name ExchangePerfLab -DefaultVirtualizationEngine Azure

Add-LabAzureSubscription -DefaultLocationName $locName -SubscriptionName $subscriptionName

$PSDefaultParameterValues = @{
    'Add-LabMachineDefinition:DomainName' = 'lab.mine.local'
    'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2019 Datacenter (Desktop Experience)'
}

Add-LabMachineDefinition -Name E1DC1 -Roles RootDC -Memory 1GB


### PowerShell Version

```Shell
PS C:\Users\...> $PSVersionTable

Name                           Value                                                                                                                                                                                                                             
----                           -----                                                                                                                                                                                                                             
PSVersion                      5.1.22621.2506                                                                                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                           
BuildVersion                   10.0.22621.2506                                                                                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                               
SerializationVersion           1.1.0.1

AutomatedLab Version

PS C:\Users\...> Get-Module AutomatedLab* -List | Select Name,Version

Name                      Version
----                      -------
AutomatedLab              5.50.0 
AutomatedLab.Common       2.3.17 
AutomatedLab.Recipe       5.50.0 
AutomatedLab.Ships        5.50.0 
AutomatedLabCore          5.50.0 
AutomatedLabDefinition    5.50.0 
AutomatedLabNotifications 5.50.0 
AutomatedLabTest          5.50.0 
AutomatedLabUnattended    5.50.0 
AutomatedLabWorker        5.50.0
@raandree raandree self-assigned this Apr 21, 2024
@raandree raandree added the Question The issue is a question. label Apr 21, 2024
@raandree
Copy link
Member

Sorry for the late reply, @randallt. If you have shared the whole deployment script, it is calling Install-Lab you are missing.

$subscriptionName = "s1 contoso3"
$locName = "East US"

New-LabDefinition -Name ExchangePerfLab -DefaultVirtualizationEngine Azure

Add-LabAzureSubscription -DefaultLocationName $locName -SubscriptionName $subscriptionName

$PSDefaultParameterValues = @{
    'Add-LabMachineDefinition:DomainName' = 'lab.mine.local'
    'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2019 Datacenter (Desktop Experience)'
}

Add-LabMachineDefinition -Name E1DC1 -Memory 1GB -Roles RootDC

Install-Lab

Show-LabDeploymentSummary -Detailed

This script works for me.

@raandree raandree added the Solution Delivered We think that a solution has been provided but waiting for response label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question The issue is a question. Solution Delivered We think that a solution has been provided but waiting for response
Projects
None yet
Development

No branches or pull requests

2 participants