Milestone 3 Nested Virtualization and Templates - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki
This page journals content related to SYS-350 milestone 3.
Table of contents:
Housecleaning
First I ssh'd into ad350 from mgmt1 and I added DNS records for the following:
-
nested1: 10.0.17.20
-
nested2: 10.0.17.30
-
Nested3: 10.0.17.40
Powershell code used:
Add-DnsServerResourceRecordA -CreatePtr -Name "nested1" -ZoneName "oliver.local" -AllowUpdateAny -IPv4Address "10.0.17.20"
Add-DnsServerResourceRecordA -CreatePtr -Name "nested2" -ZoneName "oliver.local" -AllowUpdateAny -IPv4Address "10.0.17.30"
Add-DnsServerResourceRecordA -CreatePtr -Name "nested3" -ZoneName "oliver.local" -AllowUpdateAny -IPv4Address "10.0.17.40"
Auto starting VMs
Then I logged into my ESXi server > "Virtual Machines" tab > selected "GW01-WAN" > "Actions" > "Autostart" > "Enable":
I would do this for mgmt1, ad and vcenter IN THAT ORDER, following shows this:
(NOTE: Following was done after lab completion BUT shouldn't influence the rest of the lab!)
Then I went to the ESXI sidebar > "Manage" > then "Autostart" where I was met with the following:
I would then press "Edit settings" > enabled autostart:
Following shows autostart being enabled:
Housecleaning reflection
This step was nice introduction to using the ESXI autostart feature, as I have never used it before. I originally thought I would have to manually set the time different for each VM to have it boot in a certain order but ESXI auto selects the order/you can set it. Good stuff to know but nothing that burned me there. What did burn me was that I forgot to set the system itself to autostart, but I was able to fix that.
Nested ESXI Setup
I went into vCenter > clicked on my Datacenter "SYS350" > "Deploy OVF Template..." to make nested1:
In this I set the OVF template URL provided by the instructor:
Put it in prod:
On my ESXI server:
Reviewed details and continued > accepted license agreements > selected datastore2 THIN PROVISIONED:
Put it on my 350-WAN:
Customized the template like the following AND ADDED A ROOT PASSWORD:
I would do the same thing for nested2 with the following differences:
-
VM named = "nested2"
-
Used the following network settings:
I would do the same thing for nested3 with the following differences:
-
VM named = "nested3"
-
Used the following network settings:
(NOTE: I would need to when adding the hosts to the datacenter later recreate nested3, the settings of the recreated nested3 are shown above and where the same as the first time I set it up.)
I would later sort the set into their own folder:
Then I started all of the ESXI host. While they started I wen to to my super10.oliver.local server > "Configure" > "Networking" heading and under it "Virtual switches" > went to my "350-WAN" switch > drop down to the left of "Standard Switch: 350-WAN" > "Edit" > "Security" > set the following security settings:
Then I used the process described in Milestone 2 for adding my super10 server to vcenter to add nested1, different settings described below for each nested ESXI host.
nested1 settings:
-
Hostname: nested1
-
Did not manage host with image
- Used the Evalulation license
I would do the same setup with nested2 with hostname "nested2" and nested3 with hostname "nested3":
Nested ESXI Setup
This step for me was the most time consuming of the whole experience. I kept messing up settings on my nested ESXI instances (like missing one setting or mistyping an IP) but that could be solved with just taking my time. My nested3 also had to be re-made once for some reason, as it was using a IPv6 address instead of an IPv4, but when re-made with the same settings it worked fine. Overall a good introduction to nested ESXI and a reminder to take ones time.
Setting up templates
Windows DHCP
I SSH'd into ad350 and setup DHCP with the following commands:
Install-WindowsFeature DHCP -IncludeManagementTools
netsh dhcp add securitygroups
Restart-Service dhcpserver
Add-DHCPServerv4Scope -Name "oliver-scope" -StartRange 10.0.17.101 -EndRange 10.0.17.150 -SubnetMask 255.255.255.0 -State Active -LeaseDuration 1.00:00:00
Set-DHCPServerv4OptionValue -ScopeID 10.0.17.0 -DnsDomain oliver.local -DnsServer 10.0.17.4 -Router 10.0.17.2
Add-DhcpServerInDC -DnsName "ad350-oliver.oliver.local" -IpAddress 10.0.17.4
Restart-service dhcpserver
(NOTE: Originally set startrange wrong, changed later with Set-DHCPServerv4Scope -ScopeID 10.0.17.0 -Name "oliver-scope" -State Active -StartRange 10.0.17.101 -EndRange 10.0.17.150
, also later had to change the "DnsDomain" from ad350-oliver.oliver.local to oliver.local with Set-DHCPServerv4OptionValue -ScopeID 10.0.17.0 -DnsDomain oliver.local -DnsServer 10.0.17.4 -Router 10.0.17.2
. The correct commands are used above.)
Ubuntu Template Setup
Back in vCenter, I went to super10.oliver.local > "Configure" > "System" > "Services" > enabled SSH:
Then I SSH'd into my ESXI host > used wget to get the needed Ubuntu VM with the following:
cd vmfs/volumes/datastore2-super10/ISOs/
wget http://192.168.7.241/isos/ubuntu-22.04-live-server-amd64.iso
Then in vcenter I created a VM named "ubuntu.base.template" with the following settings using the new Ubuntu ISO in the CD/DVD (THIN PROVISIONED):
Once the VM started I used English > continued without updating the installer > "DHCP" in Network connections:
I would continue with default settings until I setup a profile:
Then I installed OpenSSH Server > did not install anything else > waited for Ubuntu to install its system:
Finished installing:
After it finished I rebooted, once rebooted I could login as the user I made:
Then I made sure perl and open-vm-tools were installed using the following:
sudo apt update -y
sudo apt install open-vm-tools -y
sudo apt install perl -y
Then I shutdown the system > removed the ubuntu ISO from the CD/DVD > took a snapshot called "Base":
Then I right clicked the ubuntu VM > "Template" > "Convert to Template":
After that completed I went from the vcenter shortcuts (got to here by clicking "vSphere Client" icon) and accessed "VM Customization Specifications":
Then I selected to create a "NEW..." VM Customization Specification:
Where I set the name and target OS:
Specified that a name be set in the Clone/Deploy wizard and the domain name of "oliver.local":
Then I set the timezone > did not set a customization script > In the Network settings I selected "Manually select custom settings" and selected NIC1 then "EDIT":
Popup showed where I set to have Network IPv4 information be gotten by a user via prompt > pressed OK:
It being set:
Set the DNS settings to "10.0.17.4":
I would finish the customization and have my ubuntu specification:
Then back in "Hosts and Clusters" > right clicked my ubuntu template > "New VM from This Template..."
I would then create a test VM with the following settings:
(NOTE: Selecting "Customize the Operating System" allowed me to set my VM options from the template:)
VM created:
VM tested:
Rocky Template Setup
I then used wget to get a rock linux VM ISO onto my super10 box using the following:
cd vmfs/volumes/datastore2-super10/ISOs/
wget http://192.168.7.241/isos/Rocky-8.6-x86_64-minimal.iso
Then in vcenter I created a VM named "rocky.base.template" with the following settings using the rocky ISO in the CD/DVD (THIN PROVISIONED):
(NOTE: Did go into the settings later and set the CD to start at startup!)
Then I booted > had to select to boot normally (I think because I didn't set the CD setting) > then I selected to start the rocky linux installation:
I then selected English as my language > and set the following on the installation summary sections (below is a reference to an unsent summary):
In "User Creation" I created an admin user:
In "Installation Destination" I clicked into the section, then pressed "Done" so that rocky knew I wanted to use the whole disk:
Set Installation Summary:
With the settings set, I started the installation:
Once the setup completed I would then reboot the VM and remove the ISO from the CD/DVD:
After logging into the rocky VM I would have to set the networking to automatically connect using nmtui
> "Edit a connection" > selected only profile > enable "Automatically connect" with the SPACE bar:
IP being set:
Then I would run the following to install open-vm-tools and perl:
sudo dnf update -y
sudo dnf install perl -y
sudo dnf install open-vm-tools -y
And I would reboot the system once to ensure open-vm-tools would start.
After the reboot, I shutdown the system > created a snapshot called "Base" > followed the same steps as with ubuntu to make it a template/make a customization specification:
Then back in "Hosts and Clusters" > right clicked my rocky template > "New VM from This Template..." I created the following VM (used the "Rocky-8-Specification" customization):
(NOTE: The VM has an IP of "10.0.17.51", subnet mask of "255.255.255.0" and a gateway of "10.0.17.2")
rocky VM created above turned on/tested:
Template reflection
This step was not too bad, but was a nice introduction to templates. I am more used to using linked clones so templates offer a similar but different experience. Biggest problem I faced was not thinking out the DHCP options and that I had the wrong DNS domain option set. In the future, I plan to make a network map or at least a table of network IPs for this class so that I can not run into networking issues in the future!