One of the most common uses of the SoftLayer Activity Library for Citrix Workflow Studio is to obtain information about the instances that you have running on your SoftLayer account. This information may be composed of the public IP address, private IP address, username, password, transaction state, and power state of the machine.
In the last blog, I discussed how you can create a workflow to order a new Cloud Computing Instance (CCI) on SoftLayer, In this blog, we will create a workflow for retrieving information about the instance. 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.
To get the details about an instance on SoftLayer, we need to know either the Order ID or Instance ID for the instance. The way that the SoftLayer ordering process generally works is that when you order a new instance, SoftLayer returns the Order ID to allow you to keep track of it. You can then use the Order ID to get the Instance ID and other details regarding the instance.
In the previous blog, when we ordered a new instance we outputted the Order ID into a message box for us to use later. We should have written that Order ID down, or better yet, store that Order ID into a database for safe keeping. In the second step below, notice how we are using the Order ID for gathering the instance details, including the Instance ID. Once you have the Instance ID, you can use either the Order ID or Instance ID for gathering instance details from SoftLayer. If you have experience in using the SoftLayer portal, you’ll notice that when they display the list of Cloud Computing Instances (CCIs) for your account on the web page, each link contains the Instance ID for that instance. The Instance ID is required for performing other actions on the instance such as cancelling, so it’s good to keep track of the Instance ID as well.
Open the Workflow Studio Console and create a new workflow called CheckInstanceStatus. Within the Workflow Studio Designer, drag the Connect To SoftLayer, Get Instance Info, 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:
|Connect To SoftLayer||
|Get Instance Info||
|Disconnect From SoftLayer||
The purpose of inserting the Message Box activity into this sample workflow is to allow us to view the details regarding this instance from 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 this data should be retained so that it can used for displaying within your applications or performing additional actions on SoftLayer.
Run the workflow within the Designer. Ensure that it succeeds properly. A message box should be displayed containing the instance information. Note – although we are not doing it in this example, we can also obtain and display the username and password for the instance as well.
In the next blog we will create a workflow to cancel an instance on SoftLayer. Stay tuned!
- SoftLayer Activity Library Download
- Getting Started
- Ordering instances on SoftLayer
- Checking status of instances on SoftLayer (this one)
- 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