Milestone 3 - zacharylongo/Tech-Journals GitHub Wiki

Milestone 3: Nested Virtualization and Templates

Preliminary Steps

Use AD350 to assign DNS records for the following:

  • nested1: 10.0.17.20

  • nested2: 10.0.17.30

  • nested3: 10.0.17.40

Powershell commands (if you don't use the GUI)

Add-DnsServerResourceRecordA -CreatePtr -Name "nested1" -ZoneName "zachary.longo.local" -AllowUpdateAny -IPv4Address "10.0.17.20"
Add-DnsServerResourceRecordA -CreatePtr -Name "nested2" -ZoneName "zachary.longo.local" -AllowUpdateAny -IPv4Address "10.0.17.30"
Add-DnsServerResourceRecordA -CreatePtr -Name "nested3" -ZoneName "zachary.longo.local" -AllowUpdateAny -IPv4Address "10.0.17.40

Autostart

Enable auto start for your VM's using the following drop-down:

image

Do this (in order) for mgmt1, ad and vcenter. You should see what the boot order next to the machines in Vsphere.

Nested ESXI

  • After selecting your datacenter (In my case it was SYS-350) under actions you should see the following:

image

  • Provide the following address for your OVF Template. http://192.168.7.241/ovas/Nested_ESXI7_Template.ova

image

  • Follow as normal, using datastore2 and making your hard-disk thin provisioned. (We do not want big VM's)

  • Make sure to select 350-WAN as your network.

  • Do the same for the other two VM's making sure to set their corresponding hostnames appropriately.

Templates:

  • First configure DHCP on ad350 using the following commands:
Install-WindowsFeature DHCP -IncludeManagementTools
netsh dhcp add securitygroups
Restart-Service dhcpserver
Add-DHCPServerv4Scope -Name "zach-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 zachary.longo.local -DnsServer 10.0.17.4 -Router 10.0.17.2
Add-DhcpServerInDC -DnsName "ad350-zach.zachary.longo.local" -IpAddress 10.0.17.4
Restart-service dhcpserver
  • Next, go into "Configure" ---> "System" ---> "Services" ---> enable SSH.

image

  • On your ESXI box, use wget to get the Ubuntu ISO. (The following is what I did, making sure to put the ISO in the "ISOs" folder!)

cd vmfs/volumes/datastore2-super10/ISOs/
wget http://192.168.7.241/isos/ubuntu-22.04-live-server-amd64.iso

  • Next, In VCENTER create a new ubuntu VM using the file you just dropped in your datastore. (I named mine ubuntu.base.template as it will be the template for my base versions of Ubuntu. (Please make sure you thin provision this as always)

  • Follow along with the OS's instructions for setup once the machine has booted.

  • After successful boot, use the following to update, install open-vm-tools and perl.

sudo apt update -y
sudo apt install open-vm-tools -y
sudo apt install perl -y

  • After the installs finish, remove the ISO from the machine's cd-drive.

image

  • Then, take a snapshot of your new base Ubuntu box!

image

  • Under the same menu that you right-clicked to access earlier, there should be an option to convert the VM to a template.

image

  • After this, navigate to "VM Customization Specifications". Make a specification for this Ubuntu distribution:

image

  • Make sure to configure time for your local timezone <3

  • Additionally, make sure you specify your network settings:

image

  • For DNS, I used 10.0.17.4 but this won't be the case for everyone.

  • Back in the main menu, right click on your template and use the option "New VM from This Template"

image

  • When making your new VM, make sure to select "Customize the operating system" this will allow you to use your specification from earlier.

image

Rocky

  • The process for the Rocky template is identical to that of ubuntu. (IE moving the ISO to your datastore, creating a template and specification.)

  • The only difference is are the commands to install per and open-vm-tools:

sudo dnf update -y
sudo dnf install perl -y
sudo dnf install open-vm-tools -y