Creating A DevOps Like Environment In Oracle Solaris 11.3/11.4 By Using RAD And REST – Part 1

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Creating a DevOps workflow with Solaris zones, ZFS By Using RAD And REST calls

This is part one of this series, you can jump to part two by clicking here.

The other day I was challenged on a Solaris environment to create a DevOps like workflow for a large C-application.
The application has needs that can not be addressed by using Git (we will still be utilizing git for some parts of the project), some of the challenges are outlined below.

Note: Solaris dose not currently have/support a Docker (or alike) application.

The application in question is a C compiled application with thousands of interdependent programs (3000-5000).
Also to note, we are using Jira for application bug tracking.

The need:

  1. We would like to generate a full working copy of the application(s) every time a new jira request / bug is opened.
  2. We would like each developer to work independently on his copy of the code (and DB) with out affecting other developers.

Why not use Git to do all this (we will still use to do a git pull).

  1. With git we would need to keep all source and C compiled code in the master branch which is not something we wont
  2. Every time a developer creates a new breach it would take a very long time 30+ minute’s due to the nature of our interdependent app.
  3. Any change of a DB table column add/extend/remove would require an app re-compile, again taking 30+ minute’s

Since the source plus compiled code are all on a ZFS file system (NFS on a ZFS appliance) running in a Solaris Zone, we came up with the idea below.

Every Jira request/bug will run the below wrokfllow.
Once created/resolved remove/delete the VM plus ZFS file system.

  • Utilize Solaris RAD API calls.
    To create a clone of the original Solaris Zone.
  • Utilize ZFS-SA REST calls.
    To create a snap then clone of the original ZFS file system.
  • Finally
    Boot the Zone and mount the cloned ZFS file system in the new Solaris Zone.

We call this, the poor man’s DevOps workflow.
Note: We will still utilize Git to do a selective pull from each developer to a central coding area (we might choose to pull from more then one Jira bug for testing).
Once ready, will pull the combined code to the master branch, which will trickle down to our prod branch.

An image illustrating the workflow is below.

Script options and capability are below.

To clone a zone just run something like the below.

All the code is available on my Github repository here.

Enough talk let’s get to the real thing.

Preparing the Solaris Global Zone

Let me try to describe the environment.

  1. On the Solaris Global Zone, will be using a private switch (etherstub) for all zones.
  2. To communicate from within the zones to the outside Lan we will be using NAT and routing/forwarding.
  3. To communicate from the out side Lan to one of the zones will be using port forwarding.
    Will be using the Solaris firewalld application to do all that.
  4. All the cloned zones will be receiving there IP address from the global zones DHCP server.
  5. We will also create a static IP to Port mapping list so we know which port forwards to which IP address.
  6. We will be preparing all of this below.
  7. The script will then be utilizing all of this as part of the cloning process described below.

Note: All of the code is available on my Github page here.

To help and better understand I created a network digram below.

Creating a Solaris private switch(etherstub)

Lets create a private switch (etherstub) with a local link, you do so by running the below.

Note: The Ip Address of is your router to the outside world or your local Lan.

Next, Turn on ip routing/forwarding on the new switch/etherstub.

Now, lets create the firewall forwarding and NAT rules, you do so by creating the below.
cat /etc/firewall/pf.conf

Next, We need to enable the firewall service. this is used for nat and port forwarding.

Solaris DHCP configuration.

Create a DHCP configuration file with the content below.
cat /etc/inet/dhcpd4.conf

Next, enable the DHCP service. you do so by running the below.

In part 2 Will continue to configure the source zone and SMF services. you can jump to Part 2 by clicking here.

You might also like – Articles related to Oracle Solaris 11.4/Solaris 12.

Like what you’re reading? please provide feedback, any feedback is appreciated.

Leave a Reply

Notify of