Calm

0

Nutanix Calm – a deeper look from an automation consultant perspective (Part 2)

This post will be the second post on Nutanix Calm and will build up on my first post which can be found here: http://www.vcoportal.de/2018/09/nutanix-calm-a-deeper-look-from-an-automation-consultant-perspective-part-1/ if you missed it.

 

In the last post we only created a virtual machine without any customization. In this post we will install additional packages and add an SSH Key for login to the VM.

Let’s go back to our previously created Blueprint. On the left site we have the tab “Package”. Choose this, give the Package a Name and use “Configure install”

 

What you will see is that beside the LinuxServer Icon a new Icon will open up. Here we choose “+ Task” to create some modifications during the VM build process.

 

On the left site you must configure some values. You provide a name, choose what you want to do (I want to execute a Shell Script), and take the Credentials you need to access the VM. In the script section you past your script (Linux Bash programming in my case) which you want to execute.

My script for example looks like this:


#!/bin/bash

cat <<'EOF' > /etc/resolv.conf

# Generated by NetworkManager

search vcoportal.de

nameserver 192.168.1.10

nameserver 192.168.1.20

EOF

yum -y update

yum -y install net-tools traceroute bind-utils

First, I declare my script as bash script (line 1). Then I change the DNS Server configuration (line 2 to 7) and update everything on my VM and then install some tools like dig, traceroute and so on for my virtual machine.

When you are finished, save the Blueprint and give it a try for a run.

In the Audit Section of the Application you can take a look at your installation and configuration. As you will see the new generated section InstallSoftware will also be there as point. You can see what the Output of the section is. When you click on the Small window in the market red rectangle you can pop up a bigger window with the output.

On the button you can also have a look at the created script.

In the next step we will insert an SSH Key. This key can be insert from the user wo execute the Blueprint. So, let’s go back to our Blueprint. Here we go the the “Service” Section from our Service. There we insert a Name for the Variable (in my case SSHKey) and a default value. It is important that you activate the “Runtime” checkbox. We want the SSHKey auf our user, not the default and so the user can insert “his” key.

 

When we are finished with the variable we add a “Task”. This task we use to insert the SSH Key into the authorized_keys field for a specific account (I am lacy so I use the root account. For security reason I would not recommend this in production….)

 

The script itself is also a Linux Bash script and easy.


#!/bin/bash

mkdir /root/.ssh

touch /root/.ssh/authorized_keys

echo "@@{SSHKey}@@" >> /root/.ssh/authorized_keys


 

In the first line we declare the script as a Linux Bash script. The second line create the necessary directory and the third line creates the file. In the last line we insert something in the create file……

Did you recommend the “@@{SSHKey}@@ in the last line? What’s that for a strange value?
In Calm variables which we use in script are market with “@@{VALUE}@@” so in our case that means we take the value of the before created Variable and replace the “@@{SSHKey}@@” field with the content.

One note why I used a new task and not placed the script in the first task we already did. From my point of view, I would recommend to create a new task for every goal which I want to reach. I personally thing that debugging is much easier in this case because we can see what went wrong (in which script). The next thing for me is, that even on script maybe doesn’t function like expected we still have the chance to access the VM and fix it during life time.

After we are done with our script, save the Blueprint and Launch the VM. When we are on the Blueprint just open the “Configuration” part and insert the SSH Key which you want to access the VM without password.

 

When everything works like expected you can login in your VM via SSH. If not, take a look in the Audit section.

As you can see the start with calm is very easy and there are a lot of things we can be done with calm.

During my “play around” with Calm I found some things which must be improved within Calm or limit Calm at the moment:

  • Calm is limited to Nutanix, vSphere-Cluster and Cloud Solutions. So, some customers still have to use a second solution for their automation need.
  • You cannot export created Blueprint and import them with all needed scripts, variables and images. With our easy Blueprint that is not a big issue but when you create a Blueprint with plenty of variables there is a “room” for mistakes and typos.
  • At the moment Calm has some limitations to work with for example ServiceNow and so on.

Some Ideas for Calm for future functions / extension:

  1. RFE: Blueprint Full Backup with images, scripts, cloudinit etc. à Provide a central repository in PC to make things re-usable: cloudinit, sysprep, scripts, images etc.
  1. RFE: DNS-Update Feature when VXLAN-DHCP from PE assigns IP-address à Autofill connection URL after application deployment (aka openshift) in the app description
  2. RFE: Integration of 3rd-Party config-mgmt tools like git, puppet, chef etc. in the GUI (dropdown menu, not via scripts) à Make existing scripts / tools / 3rd-party development re-useable
  3. RFE: Must-have: Native container integration to push CALM! No customer with an existing automation or configuration solution will switch to CALM without that feature.
  4. RFE: VM customization options with cloudinit for linux and sysprep for windows delivered as one-click/dropdown options in CALM (forgot that in the call)

 

If you can life with this limitations Calm is a good choice to start automation in your Nutanix environment.

0

Nutanix Calm – a deeper look from an automation consultant perspective (Part 1)

The last couple of days I played somewhat around with Nutanix Calm. Calm is the automation Solution from Nutanix based on the Acropolis. The official Calm statement from Nutanix can be found here:

What is Nutanix Calm?

Calm provides application automation and lifecycle management for the Nutanix and public clouds, as part of the Nutanix Enterprise Cloud Platform. Calm orchestrates the provisioning, scaling and management of applications across multiple environments to make the entire IT infrastructure more agile and application centric.

From Organization perspective calm works with Blueprint to organize the layers of the automation.

Also, here an official description:

Nutanix Calm models applications as Blueprints giving you a full end-to-end view of the application, its dependencies, and its requirements. From here you can quickly spin up multiple copies of an application and ensure that each one is done right each time.

Operations can be orchestrated, delegated, and repeated knowing each time that it’s done perfectly no matter who runs it. At the same you gain an impressive amount of visibility into who did what, when, and what the result was because Calm logs all actions and all logs from each action no matter where the application is deployed.

Blueprints can be published to end users based on their group or role, giving them the ability to instantly provision and use applications across clouds while ensuring policy is properly applied and logged. You can attach budgets and quotas to each team to track their unique spend or customize the cost of a particular application to control user behavior based on what applications you want them using.

 

A lot of customers are asking about Nutanix Acropolis and also for an automation solution. So, I decided to play a little bit around with calm to see how easy it is to archive first results with calm.

Bevor you can start with the development of a first Application you have to understand the different between a Blueprint and an Application.

In the Blueprint you declare the Number of virtual Machines, the “Automation” Part of the VMs and all other necessary things.

The Application is the running configuration of a Blueprint.

So, when you start with calm you have to create a Blueprint bevor you can create an Application. Let’s start with our first Blueprint which will be an easy on. The goal for this Blueprint is to create a running virtual Machine (Linux).

 

A Windows Open were you must provide a name for the Blueprint. A description is optional, but I would recommend this as a best practice.

 

After you are done with your Blueprint setup the Main Window of the Blueprint is opened.

 

Make yourself comfortable with the buttons and screen and then let’s create our first service.

The Services “hold” the virtual machine which offers a service for other virtual machines or user. A service could be a Load Balancer for example or a Webserver. When you create more advanced Blueprint (then this one we are doing now) you can build dependency between different services.

For now we only create one service.

On the left site of the screen we configure the necessary configuration. Create a Service Name, a Name for the Sub (Name is not the VM Name!), choose your Cloud (Nutanix or AWS for example) and your Operating System. I use Linux so that’s my choice.

 

On the lower part we provide a Name for the VM in our environment. Calm automatically adds some variables to provide unique names in our environment. And the Images we want to use as base for our deployment. If necessary you can change the Device Type and Device Bus. Note the “running men” nearby some of the fields. Here we are able to provide the user who execute the Workflow to provide his configurations variables for example a special VM Name. It is a good practice to provide default values for all parameter.

 

 

On the bottom of the field you configure CPU, Memory, additional Disks (VDISK) and the Network. If most network configurations are taken from the Nutanix default configuration so in my case I only need to insert an IP or use DHCP.

 

The last things to configure is the “Connection” Section. Here you must provide credentials to login to the base image. These credentials are used to configure the VM.

After that Save the Blueprint at give it a first try with “Lunch”

Now we must enter an Application Name and then let’s build the VM.

The build process starts automatically. Under the “Audit” log you can see what happens within your Blueprint and if it is successful.

Till now no rocket science and easy to go……

That’s it for now, in the next post we start to customize our VM…..