Virtual Machine Infrastructure

Overall Goal

The overall goal of this project is to be able to maintain virtual machines easier and provide a secure and stable environment for docker-compose stacks and other binaries to run. One requirement is virtual machines should be generated on demand to allow for scalability. This could be achieved by netbooting a Linux operating system, configuring the machine with cloud-init and then deploying a docker-compose stack on it.

Note that OPNSense and the WIndows Machine are not discussed in this document. While they do exist, they will not be a part of this infrastructure

Final Solution

Generating VM's on Demand

Using the power of the Debian Live project, we are able to customize a live netboot image to provide a base operating system for all VMs. This will also allow us to generate "live cds" on demand and then push the update to a central boot server where the VMs can then boot the latest copy with the latest kernel and bug fixes. See Gitea repo here

Using Cloud-Init

The Xen Orchestra appliance has built in support for using a cloud-init template. Users will be able to specify whichever packages they want installed and other configuration items. Docker compose will be deployed using cloud-init

Ideal Implementation

The Genesis Machine

Function

This machine will provide all other Virtual Machines with the latest image to boot up via PXE. Additionally, this machine will house its own version of Gitea and Jenkins. This machine will also be home to LDAP and Keycloak for identity management since they have both been identified as critical services.

VM Resources

Networking

Containers Used

Other Configurations

Edge Machine

Function

This machine will serve as the edge for incoming traffic. All incoming traffic to all services must go through here

VM Resources

Networking

Containers Used

Other Configurations

Database Machine

Function

This machine will provide all of the databases for the services machine.

VM Resources

Networking

Containers Used

Other Configurations

Prod Service Machine

Function

This machine will provide all of the services

VM Resources

Networking

Containers Used

Other Configurations

Dev Service Machine

Function

This machine will provide development versions of services

VM Resources

Networking

Containers Used

Other Configurations

Logging and Metrics Machine

Function

This machine will be used for logging and managing the virtual machines

VM Resources

Networking

Containers Used

Other Configurations

Build Machine

Function

This machine will replace Linuxbox and will be used for development activities. It will also host the big Jenkins build cluster.

VM Resources

Networking

Containers Used

Other Configurations

Implementation Notes

Operating System Security

Using a live CD with a readonly file system can be tricky, below are the current security precautions that are being taken:

User and Permission Changes

Due to the above security measures, you MUST provide a SSH key to the Virtual Machine for the user debian (or whatever user you made via the cloud-init process). If you do not, you will not be able to remote into the machine!

File System

The file system for the operating system is not encrypted and will be lost on reboot, it is not recommended you store non-critical information on it. Use your dedicated data disk to store information instead.


Revision #7
Created 2023-03-07 23:57:46 UTC by Kyle Heestand
Updated 2024-01-14 01:58:32 UTC by Kyle Heestand