Deploying User Networks and VMs
Prerequisites
- Make sure you've initialized the course
- You've build and configured the course gateway
- You've built the base virtual machines you wish to clone
Initializing User Networks
The following screenshot shows an excerpt of a run of OMJ-100.01.ps1. Networks are created for each user in the course roster.
The following code excerpt is responsible for initializing networks. It uses the networks key value/pair from the course json file.
$rangecontrol = [RangeControl]::new($configuration_file,$roster)
$rangecontrol.InitializeUserNetworks()
"networks":["LAN","DMZ","MGMT","OPT"]
User VMs
The following screenshot shows the course.ps1 driver, deploying VMs to each user in the roster.
The following code uses the initialized rangecontrol object to create linked clones for each user in the roster. The first parameter is the base VM and the second is the prefix name for the virtual machine.
$rangecontrol.DeployClones("rocky.9.1.base","web01")
$rangecontrol.DeployClones("pf.2.6.0.base","fw1")
$rangecontrol.DeployClones("ubuntu.22.04.1.base","web01")
$rangecontrol.DeployClones("server.2019.base.v2","dc1")
$rangecontrol.DeployClones("windows10.ltsc.base","wks1")
A note on Access Control
User VMs and Networks are moved into a student folder that has permissions such that the named user has access to only their own virtual machines, networks and the Course WAN.