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

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

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

Note: The latest updated Version-05 is available here.

This is part 2, in Part 1 I described the challenge we try to address as well as the process to configure the network switch, DHCP. Below will continue to configure the source zone as well as all associated SMF services.

For a quick jump you can get all the code on my Github repository available here.

Script options and capability are below.

To clone a zone just run something like the below.

Solaris source zone configuration

Next, lets create a source zone, you do so by running the below.

Now, lets create an install template, you do so by running the below.

Modify the software_data section like the below (add git).

Next, install the source zone by running the below.

Now, lets boot the zone.

Now, lets get in the console to configure the source zone.

Completed the template config by pressing f2, fill with something like the below.
Note: you can also pre-stage a template with sysconfig create-config -o sc_profile.xml, we will be doing so shortly.

  1. IP Address: 10.25.0.2
  2. Netmask: 255.255.254.0
  3. Router: 10.25.0.1
  4. Or Select: Automatically Since we will be using DHCP anyway
  5. DNS: 8.8.8.8
  6. Domain: example.com
  7. Languge: US/Esetren
  8. Login/Password: admin/password (or whatever you like)

Next, we are going to add a few servicess to help in the zone clone process.
Create the below directory and 3 files.

Now, lets create the SMF service by creating the below files.
cat mount_apps1.xml

Next, create the application below. this will populate your IP address and port for latter retrieval.
Note: The file below contains your IP to Port mappings that is latter used in the clone script.
cat getIpPort.sh

cat getIpPort.xml

Create the SMF services by importing.

Switch the zone to use DHCP before creating / running the sysconfig to create the profile, this will be used in all clones, do so by running the below.

Next, create source template on the Global Zone, this template will be used for all zones when the script will do the cloning.

For the template use something like the below configuration.

  1. Or Select: Automatically Since we will be using DHCP in all clones
  2. DNS: 8.8.8.8
  3. Domain: example.com
  4. Language: US/Eastern
  5. Login/Password: admin/password (or whatever you like)

An example of /opt/sc_profile.xml file is below(or use sysconfig to generate one).

Make sure to shutdown the z-source zone, otherwise the clone process wont work.

We are almost ready for the fun part.
Lets verify if the RAD deamon is enabled.

Also make sure you have the RAD modules installed, do so by running the below.
Note: In 11.4 you shuld have twice the amount from below.

Finally, we can now use the script to clone zones, the usage options are below.

Note: Before using the script, make sure to updated the settings like user/password ZFSSA IP address, etc. that reflects your environment.

To clone a zone just run something like the below.

And the log file will look something like the below.

To access the Zone/VM you just ssh to the global-zone port in this example 32078.

Similar you can delete the zone by running the below.

Since the Python script is quite big to post it here, I created a github repository for this.
You can obtain the script as well as all other source files on the Github repository page, available here.

Below is output on some cloned zones.

And below is a screen shout of the ZFS Appliance snap/clone(s).

I have also created a stress / fork bomb test python wrapper application.
The application is also available on my github page here, or you can just copy paste the below code.
cat fork_clones.py

Helpful links
Getting Started with the Remote Administration Daemon on Oracle Solaris 11
Openstack Rad Driver Information
Oracle Official documentation
Python Client in RAD
Python Rad Module List

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

avatar
  Subscribe  
Notify of