It’s Time for Automation – Part 1

NOTE: This post comes from Oleg Alter, a Senior Product Manager at ControlUp.

At ControlUp we take IT automation very seriously. The biggest challenge with IT automation is that every environment is unique, complex and ever-changing. Out-of-the-box automation is helpful, but usually covers 70-80% of use cases and often requires expertise to fit the automation scenario to the environment, which is hard to scale and often a recipe for failure.

To address this problem, we combined Open Source and the power of the ControlUp community. The result is Community Scripts with Trigger Configurations, the building blocks for ControlUp’s Open Platform Automation. In this blog, I will share a summary of the Open Source scripts contributed by ControlUp community and how you can leverage those to automate your infrastructure.

To start, I’m assuming that you already know how to download a script from our Community Script Library.

How do you use Community Triggers for Automation? Here are some related blog posts:

You can also watch this video on how to create Automated Actions.

    Now that you are familiar with the basics, let’s start the review of what we’ve delivered for you over the past few months:

Reboot Unregistered VDAs

As Citrix admins, we often come across VDA machines that, for various reasons, become unregistered. In such cases, the first thing we normally do is reboot the VDA, in the hopes that this will solve the problem. Although a reboot often solves the problem, this approach costs you time to complete the reboot plus the indirect secondary cost. What is that secondary cost? VDA machines that are unregistered do not accept users, and this overloads other VDAs in the group, slowing users’ work and undermining the overall UX.

If only you could set up an automation rule to reboot unregistered VDAs when they have no users and are stuck in that state for several minutes!

With ControlUp Automation, you can do just that.

With ControlUp, you can easily create an automation trigger that is activated whenever a VDA becomes unregistered, if it is not in maintenance mode and has not hosted any users for 5 minutes. The trigger would automatically run a script that reboots the computer, either from within the operating system or via vSphere — whichever you prefer. Of course, you can decide what action item would be applied, and you could use your own script if you wanted to do so. But we understand that not everyone knows or likes coding (or maybe you just don’t have time), so we have created a rich, free repository of Script Actions for your use.

Okay, so let’s say you like this idea, and now you want to try out this automation trigger that restarts unregistered VDAs. What should you do next? You can easily create such a trigger in your organization using the following settings:

Trigger Type: Advanced > Computer
Filter: XD User Sessions = 0 AND
XD Registration = Unregistered AND
VM Power State = Powered On AND
XD Maintenance Mode = Off

Minimum duration in new state = 5 min
Follow-up action: Run an action
Script Name: Restart computer with CU Agent
Wait at least 24 hours before repeating

To make this even easier, we have added this automation use case as a community trigger, so all you have to do is enable the Community AAC_Reboot Unregistered VDA automation trigger. And what about the script that would reboot the computer? Don’t worry! The Restart computer with CU Agent script is already linked to the automation trigger. In fact, if it is not already installed in your organization, you will get a pop-up message offering to install it on the spot.

Incidentally, if you want to reboot your computers via vSphere, you’ll need to link the Restart VM script to the trigger instead of the Restart computer with CU Agent script. This script is also available for download from our scripts library.

New Scripts to Enhance Virtual Resource Allocation

Here’s a list of scripts recently added to our script library. The following use cases deal with on-demand computing resource allocation to applications or users (sessions) based on environment needs.

App Responsiveness CPU Priority
This automation will adjust the CPU used to run an application based on the needs of your business. To set it, use our new Community Trigger AAP_App Responsiveness CPU_Priority. This trigger allows admins to define when the user experience with a particular application begins to deteriorate, automatically adjusting the CPU priority accordingly (ie Normal → Above Normal). When you use it, please tell me how you like it in this post’s Comments section!

AAS_Session State – Disconnected
Similar to App Responsiveness CPU Priority, this trigger will automatically reduce the priority and trim the memory of all non-essential applications’ processes when the end-user’s Windows machine session is disconnected. This will free up a significant amount of resources when the end-user no longer needs it, giving the resources back to the hypervisor or to be consumed by applications actively being used by other users.

AAS_Session State – Active
This trigger will automatically increase the priority of all non-essential processes when a Windows session changes from a Disconnected to an Active state, providing the end-user with the default CPU priority for running apps.

AAS_Session State – Active to Idle
This trigger will automatically reduce the priority and trim the memory of all non-essential processes of an Idle Windows session, potentially freeing up a significant amount of resources.

AAS_Session State – Idle to Active
This trigger will automatically increase the priority of all non-essential processes of a Windows session when the session changes from an Idle to an Active state, providing the user the default CPU priority for running apps.

Read more about Automated Actions related to Windows session state that are covered above here.

Learn more how you can dynamically control your consumed resources based on your actual business needs here.

So, as you can see, automation with ControlUp can be fun, easy, and useful. We put in a lot of work so that you can concentrate on what is really important to you and your organization, rather than getting bogged down running routine procedures to fix common, straightforward problems. And this is just the tip of the iceberg!. We are ready and able to handle complex and sophisticated automation use cases, which can save you time, and can also save your organization money and dramatically improve the user experience. I’ll talk more about this and other things, in my next blog post. Stay tuned!