One of the biggest reasons for using the SoftLayer Activity Library for Citrix Workflow Studio is to automate the ordering of instances in the SoftLayer CloudLayer. In the previous blog, I discussed how to obtain the pricing codes that you will need to order instances on SoftLayer using the activity library.
In this blog, we will create a workflow for ordering a new instance using the pricing codes. To download the SoftLayer activity library and get started, view the setup instructions listed here. To view the full list of blogs within this blog series, refer to the bottom of this article.
The previous blog has you create a workflow to output the SoftLayer pricing codes within a XML file. Open this file and locate the codes that you need for Operating System, RAM, CPU, and Disk. In my example here, I want to order an instance with the following specs:
- Windows Server 2008 R2 Standard Edition (64-bit)
- 2 GB RAM
- 2 x 2.0 GHz Cores CPU
- 100 GB hard-disk
This corresponds to the following pricing codes:
|Windows Server 2008 R2 Standard Edition (64-bit)||1857|
|2 GB RAM||1645|
|2 x 2.0 GHz Cores CPU||1641|
|100 GB hard-disk||1639|
Open the Workflow Studio Console and create a new workflow called OrderInstance. Within the Workflow Studio Designer, drag the Connect To SoftLayer, Place Order, Message Box, and Disconnect From SoftLayer activities to the designer surface as shown below. The Message Box activity can be found within the Workflow Control 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. The hostname value will become the actual hostname of the virtual machine. The domain value is really just a tag used by SoftLayer for listing this instance within their management portal – this is not the true domain name of the machine. The location is the datacenter for hosting this virtual machine – possible options include DALLAS, SEATTLE, and WASHINGTON_DC. The pricing type specifies the pricing model – HOURLY or MONTHLY.
|Connect To SoftLayer||
|Disconnect From SoftLayer||
The purpose of inserting the Message Box activity into this sample workflow is to allow us to grab the Order ID from the order we are placing on SoftLayer. In a true workflow, I would definitely recommend storing this data into a SQL Server database or persisting it to a file. The SQL Server Activity Library can be used for executing commands on a SQL database for storing this data. The key point is that we need to keep the Order ID for this instance to allow us to grab information about it later on. Once we have the Order ID value, we can pretty much handle it however we like using the other activities within Workflow Studio.
Run the workflow within the Designer. Ensure that it succeeds properly. A message box should be displayed containing the Order ID. Write this ID down as it will be used in our next workflow.
In the next blog we will create a workflow to check on the status of the order to pull back additional details about the instance. Stay tuned!
- SoftLayer Activity Library Download
- Getting Started
- Ordering instances on SoftLayer (this one)
- Checking status of instances on SoftLayer
- Cancelling instances on SoftLayer
- Creating templates on SoftLayer
Ask-the-Architect Site: http://community.citrix.com/p/product-automation#home
Follow Me on twitter: http://twitter.com/citrixedy