VM Creation
Or how I learned to stop worrying and love the machine
Prerequisites
Root permission on a VM Host server.
Read (at least) access to the DNS and DHCP gitlab repos
Steps
Network
Each VM needs to connect to the network. Determine which VLAN the VM should be on based on its purpose. Most should be on 1600, but publicly accessible services go in 1802. L2 VLANs are all associated with exclusive L3 subnets, so be sure to note the IP address range that goes with the VLAN.
For a list of all VLANs see VLANs.
Pick an IP Address that is unused from the correct subnet. Do Not Reuse IP Addresses.
The internet doesn't like it when DNS goes down or you change IPs
-- Mr. Morasca
Be sure that an IP is not a conflict:
This is a good result. Now add this IP to DNS. Make an A
record for IPV4, AAAA
for IPV6, and PTR
record for reverse DNS (one for v4, one for v6).
With this IP, we can now generate a MAC address. Use the create_mac.sh
script, passing the IP as the only argument. It takes the IP, removes all .
to make it one number, then converts that to hex and adds 02:00:
to the beginning.
Add this MAC to DHCP. Make sure it is added in the correct subnet. For example, the IP 198.38.16.150 should go inside this subnet block:
Define VM
Connect to a VM Host server as root.
First we need to create the RBD image
Specify size in megabytes/gigabytes/terabytes with M/G/T suffixes, respectively. A good default size is 50G
XML files are stored in a git repo at /qemuconfig/<HOST NAME>/
. cd
into this directory and dump the config for an existing VM to use as the base for the new VM. virsh dumpxml <EXISTING> > <NEW>.xml
Generate a UUID by running uuidgen
and replace the UUID in the XML file with this new one. Don't change the UUID for Ceph. While editing the file, also make any changes needed to CPU count or RAM for the VM. Also change the RBD image to the one you just made.
Add and commit the changes in git.
Start the VM with vish define <NAME>.xml && virsh start <NAME>
Install OS
Run virsh domdisplay <NAME>
on the host to find what port VNC is using (you will need to add 5900 to the port displayed, so if the result is vnc://localhost:4
that really means :5904)
Now connect to localhost:<PORT>
with your preferred VNC client.
If your network configuration works, it should netboot. Navigate the menu to install the latest Ubuntu release the lab is using. The preseed URL is steeltoe.tjhsst.edu/sp
Postinstall
Edit /etc/ssh/sshd_config
:
systemctl restart sshd
to apply changes.
Once the OS is installed, properly passcard it
Last updated