I recently created a SoftLayer Activity Library that allows you to provision new Cloud Computing Instances (CCIs) on SoftLayer within Citrix Workflow Studio workflows. SoftLayer is a cloud provider that allows you to provision virtual machines on their CloudLayer infrastructure. They utilize XenServer as their underlying hypervisor and currently provide three datacenters for provisioning virtual machines – Dallas, Seattle, and Washington DC. They offer a wide variety of operating system templates to choose from and they also provide granular selection over the type of hardware specs you need for running your virtual machines optimally in the most cost effective way.

In this blog, I want to discuss how to get started using the SoftLayer activity library. This is the first blog of a new blog series on how to use this activity library within Citrix Workflow Studio. To view the full list of blogs within this blog series, refer to the bottom of this article.

Why use this library?
Before we get into the technical details, here are some use cases for why you might want to consider using this library:

  1. CloudBursting – Some of the biggest challenges for managing a local datacenter are space and cost. Transforming servers into Type 1 hypervisors has a made a world of difference on better utilizing existing hardware resources and supporting more workloads. Throughout the course of the year, there can be periods where demand exceeds current capacity. This is where cloudbursting really fits in. With CloudBursting, you continually check the current load on the systems against a defined threshold. If that threshold is met, you spawn up new virtual machines in the cloud to meet the additional load demands. If the requests start to die down, you remove the cloud machines and just rely on your existing hardware again. The process of continually checking loads and provisioning new cloud instances on-demand really fits in well with the workflow concept of Citrix Workflow Studio. This activity library allows you to spawn up these new virtual machines on the SoftLayer CloudLayer.
  2. SoftLayer Virtual Machine Management – Some of you may already be a SoftLayer customer and you utilize the SoftLayer portal for managing your virtual machines. If you are looking for a simpler, automated way for managing virtual machines, the SoftLayer activity library can allow you to incorporate several virtual machine management functions (e.g. ordering, cancelling, checking status, restarting, etc.) as part of a workflow within Citrix Workflow Studio.

Before you begin
To use this activity library, you need to first perform the following steps:

  1. Get the API Username and API Key for your SoftLayer account – once you have your SoftLayer account set up, navigate to https://manage.softlayer.com/Administrative/apiKeychain to generate your own API Key. The SoftLayer activity library will require the API username and API key assigned to your account.
  2. Ensure your Workflow Studio environment can reach SoftLayer – the SoftLayer API is a private API. This means that to execute a workflow from the SoftLayer activity library, (1) your Workflow Studio machine needs to have a VPN connection to SoftLayer or (2) place Workflow Studio on a Cloud Computing Instance (CCI) running on SoftLayer. The instructions for creating your own VPN connection to SoftLayer are provided here – https://manage.softlayer.com/PrivateNetwork/vpn.

Create your first workflow to get the SoftLayer pricing codes
Once you have your Workflow Studio environment running and the SoftLayer API Username and Key handy, you are now ready to compose your first workflow. To order instances on SoftLayer, we need to gather the pricing codes for specifying the type of OS we want and the RAM/CPU/DISK to use for the virtual machine. If you have used the SoftLayer Management Portal in the past, their portal manages all of these codes for you and you never need to know they exist. However, since we are now automating the ordering process, we need to gather and supply these codes as part of the ordering process. This probably sounds more difficult than it actually is – and it’s very easy for us since the SoftLayer activity library can gather all of the pricing codes for us. The first workflow we create will allow us to get the SoftLayer pricing codes to use later when ordering instances.

Open the Workflow Studio Console and create a new workflow called GetPricingCodes. Within the Workflow Studio Designer, drag the Connect To SoftLayer, Get Pricing Info, Export To XML, and Disconnect From SoftLayer activities to the designer surface as shown below. The Export To XML activity can be found within the Windows PowerShell activity library section. The other three activities are all part of the SoftLayer activity library section.

Configure the activities as noted in the table below:

Activity Configuration
Connect To SoftLayer
  • API Key – specify the API Key from your SoftLayer account
  • Username – specify your API Username from your SoftLayer account
Get Pricing Info
  • Connection – select the output of the Connect to SoftLayer activity
Export to XML
  • Input – select the output of the Get Pricing Info activity
  • File Name – specify a file name such as Pricing.xml
  • Folder Path – specify a folder location such as C:\Citrix\SoftLayer
  • Overwrite – select True to overwrite any existing files
Disconnect From SoftLayer
  • Connection – select the output of the Connect to SoftLayer activity

Run the workflow within the Designer. Ensure that it succeeds properly.

Locate the XML file that was generated from the workflow – C:\Citrix\SoftLayer\Pricing.xml. This XML file contains the pricing codes for several different SoftLayer ordering categories. We are just interested in the codes for operating system, RAM, CPU, and disk as these are required for ordering instances within the SoftLayer activity library.

Next Steps
In the next blog we will create a workflow to order an instance on SoftLayer using the pricing codes from the XML file. Stay tuned!

Blogs in this series

Ed York – Architect – Worldwide Technical Readiness
Ask-the-Architect Site: http://community.citrix.com/p/product-automation#home
Follow Me on twitter: http://twitter.com/citrixedy