Unless you have been hiding under an IT rock, you no doubt have heard about the new crop of tiny linux OS releases as of late that are positioned as a “Container Host Runtime” or “Linux Container OS” (here, here, here). They are stripped down to the bare essentials and geared towards running containers efficiently at scale. CoreOS, Atom, Snappy and so on. Today VMware’s Cloud Native team is introducing Project Photon as their flavor of this ecosystem. (Link to GitHub page)
Entirely open source. (Free as in beer.) Built in VMware tools. Optimized for the VMware hypervisors. There are lots of benefits for VMware building their own from the kernel and not forking an existing OS that will become more clear over time, but I will leave it to the official messaging for now.
What is Project Photon?
Project Photon is a tech preview of an open source, Linux container host runtime optimized for vSphere. Photon is extensible, lightweight, and supports the most common container formats including Docker, Rocket (rkt) and Garden.
Project Photon includes a small footprint, yum-compatible, package-based lifecycle management system, and will support an rpm-ostree image-based system versioning.
When used with development tools and environments such as VMware Fusion, VMware Workstation, HashiCorp (Vagrant and Atlas) and production runtime environment (vSphere, vCloud Air), Photon allows seamless migration of container based Apps from development to production.
It may not make sense to some why VMware is releasing a linux OS. This will become more clear over time. But for today, just think about the power of VMware owning the hypervisor underneath, AND the VM operating system as a platform for running containers. You get all the benefit of the vSphere world (HA, DRS, FT, NSX, vSAN, vMotion….) and all the benefits of containers! Plus… remember VMfork that Duncan has blogged about? hmmmmm….
Seriously….. Using the minimal install, 12second install time in Fusion on my MacBook Pro. 303 mb footprint. That. is. awesome. The following are the sizes and average install times I’ve noticed. Booting is literally just a few moments.
The install comes in three flavors from the same .ISO, (or you can custom pick packages)
Full: 1.7GB. 40 to 60 seconds to install
Minimum: 303mb. 10 to 20 seconds to install
Micro: 259mb. 8 to 12 seconds to install
Photon OS (Micro): Photon Micro is a completely stripped down version of Photon that can serve as an application container, but doesn’t have sufficient packages for hosting containers. This version is only suited for running an application as a container. Due to the extremely limited set of packages installed, this might be considered the most secure version.
Photon Container OS (Minimum): Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime.
Photon Full OS (All): Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers.
Photon Custom OS: Photon Custom provides complete flexibility and control for how you want to create a specific container runtime environment. Use Photon Custom to create a specific environment that might add incremental & required functionality between the Micro and Minimum footprints or if there is specific framework that you would like installed.
Using Photon / SystemD
I’ll be the first to admit I have not adopted CentOS7 yet as all my labs are still using CentOS6, so I was not familiar with the new SystemD commands as of yet. There is some good info on it here and here.
TLDR; for services, Project Photon uses systemd:
You no longer are running chkconfig or /etc/init.d/ scripts. Instead you use
systemctl enable service and
systemctl start postfix.
Also networking is different, you edit files in
/etc/systemd/network instead of sysconfig. I’ll show more info on that below.
One more helpful thing to know is there are no logs in your familiar home of
/var/log/, they are managed centrally in
journalctl. Digital Ocean has a great overview of the usage of it here. I won’t rehash all of the functionality that they wrote about but I’ll give a quick example.
TLDR; for logging, Project Photon uses journalctl:
You no longer use /var/log/postfix.log. Instead you use (to continuously tail)
journalctl -f -u postfix
How to Get Started
VMware has posted a bunch of great getting started guides here that walk through deploying on Fusion, vSphere, GCE, AWS, Air, etc… In addition to those guides, here are some tips on configuration to help get those that are not familiar up and running right away.
Here is what I’ve been doing when I deploy a new machine. I’ve found each of these have exact syntax and capitalization that are important, otherwise the IP does not get configured.
- Allow root SSH access in /etc/ssh/sshd_config
- Set the correct hostname in /etc/sysconfig/network
- Configure a static IP by:
mv /etc/systemd/network/10-dhcp-eth0.network /etc/systemd/network/static.network
Edit the contents to be:
- Update the hosts file to be sure you have short and fqdn set on 127.0.0.1
127.0.0.1 lightwave-01 lightwave-01.jaas.local
- Then run the commands to configure the hostname
hostnamectl set-hostname lightwave-01.jaas.local
- I like using keys for SSH to login quicker in my lab
echo "ssh-rsa ***my public key*** root@tools" >> ~/.ssh/authorized_keys
Good to go!