Reading Time: 2 minutes

Like most of us in the virtualisation ecosystem, I run a lab. Actually, I run multiple labs, however, unlike some, my labs are nested environments running on a single ESXi host, specifically, the awesome SuperMicro SuperServer E300-9D-8CN8TP. My labs are just that – testing environments for personal development, study, validation of customer designs, etc. They don’t run any production/home applications, so they’re spun up and down fairly often.

As some of these labs can be resource hungry (multi-site VMware NSX-T Federation environments or VMware Cloud Foundation to name two examples), the workload VMs I deploy for testing within these environments must be small.

Welcome VMware Photon OS.

The VMware Photon OS is an open-source, minimalist Linux operating system developed by VMware, and is tuned and optimised for cloud computing platforms, VMware vSphere deployments, and applications native to the cloud. Photon OS also includes a yum-compatible, package-based lifecycle management system called tdnf. As such, I can quickly deploy several Photon VMs and configure these with a range of applications for testing purposes, i.e. – web and MySQL servers to validate an NSX-T DFW configuration.

The minimal version of Photon OS is also a lightweight container host runtime environment that is suited to managing and hosting containers. The minimal version contains just enough packaging and functionality to manage and modify containers while remaining a fast runtime environment.

Configuring a Photon-based VM is also a simple affair and, in the below example, I configure a VM for static IP assignment, as opposed to the out-of-the-box DHCP configuration.

Static IP Assignment Configuration

After deploying the Photon OS OVA, let’s list our interfaces. From the below screenshot we can see the interface eth0 is trying to obtain a DHCP lease, the configuration for which is defined in /etc/systemd/network/99-dhcp-en.network.

networkctl

Next, we’ll create a new static network configuration file using the vi editor. This will take precedence over the default DHCP profile by ensuring the name has a lower number of our DHCP network configuration.

vi /etc/systemd/network/10-static-en.network

When ready, save the configuration and exit (Esx and :wq).

[Match]
Name=eth0

[Network]
Address=10.0.10.126/24
Gateway=10.0.10.1
DNS=192.168.178.101
Domains=vgarethlewis.com
NTP=ntp.vgarethlewis.com

Change the permissions of the file to 644.

chmod 644 /etc/systemd/network/10-static-en.network

Restart the service systemd-networkd.

systemctl restart systemd-networkd

Check the static IP address assignment.

ip address

Finally, test connectivity. In the below example, IP connectivity and name resolution are successful.

We are now able to connect to the VM via SSH for further build-out and/or installation of yum and applications via the default package manager tdnf.

Further Reading

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.