-
There are similar questions in the discussion, but the answers are not clear. So, I'm reposting here instead of resurrecting an old thread. Once a lab is deployed:
Huge Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Xergy ! This info is missing from the wiki, I will add that, thanks for noticing. 1 - Add and remove machinesAn AutomatedLab is defined by several XML files we export in the background. Those can To remove a VM, import the lab first, then remove it: Import-Lab -Name YourLab -NoValidation # NoValidation - fast import, because we don't need validation to run every time
Remove-LabVm -Name YourMachine # That is enough To modify a deployment, either: Import-LabDefinition -Name YourLab
Add-LabMachineDefinition -Name newMachine
Remove-LabMachineDefinition -Name AnotherMachine
Install-Lab or add the machine definitions in your original script - AutomatedLab detects if a role has been deployed and skips it. As long 2 - Deploy labs that use existing lab infraYour scenario sounds like you would just do as in 1. and extend the existing lab. But, if you want to deploy a second lab, you can reuse components. In this case, AutomatedLab will not help you as much, so you will need to take care of networking, using the proper The trick is to add certain roles using the SkipDeployment parameter. The Member Server in Lab 2 can be joined to the domain defined in Lab 1 by adding only a reference to the domain controller. One example: Lab 1 (Auto-generate everything): New-LabDefinition -Name l1 -DefaultVirtualizationEngine HyperV
Add-LabMachineDefinition -Name DC1 -DomainName contoso.com -Role RootDc
Install-Lab Lab 2 (Detect resources from lab 1 and reuse): Import-Lab -Name l1 -NoValidation -NoDisplay
$net = (Get-Lab).VirtualNetworks
$domain = (Get-Lab).Domains
$dc = Get-LabVm -Role RootDC
New-LabDefinition -Name l2 -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name $domain.Name -AdminUser $domain.Administrator.UserName -AdminPassword $domain.administrator.Password
Add-LabVirtualNetworkDefinition -Name $net.Name -AddressSpace $net.AddressSpace
Add-LabMachineDefinition -Name DC1 -DomainName $domain.Name -Role RootDc -SkipDeployment -IpAddress $dc.IpV4Address
Add-LabMachineDefinition -Name MS1 -DomainName $domain.Name -Network $net.Name -IpAddress $net.NextIpAddress()
Install-Lab |
Beta Was this translation helpful? Give feedback.
Hi @Xergy !
This info is missing from the wiki, I will add that, thanks for noticing.
1 - Add and remove machines
An AutomatedLab is defined by several XML files we export in the background. Those can
be modified to some extent by AutomatedLab cmdlets.
To remove a VM, import the lab first, then remove it:
To modify a deployment, either:
or add the machine definitions in your original scri…