How We Saved $4,000 per month
on Our Client's Cloud Bill?

Autoscaling Citrix Workers through python/powershell automation

Introduction
With the rapid digitization of the business world, efficient use of cloud services has become paramount. The evolution of cloud technology has paved the way for companies to optimize their resources, leading to significant cost savings. This case study delves deep into the challenges faced by a Managed Service Provider (MSP) and how BYS played a pivotal role in addressing those challenges using a unique approach.

The Challenge
We collaborated with a Managed Service Provider (MSP) confronted with a significant expense on their Amazon Web Services (AWS) cloud bill. Our analysis pinpointed that Citrix workers were the primary drivers of this elevated cost.

The MSP approached us with a dual objective: to streamline their Citrix worker operations while ensuring top-notch performance. They sought a reduction in the number of active workers during non-working hours. However, given their customers work in different time zones, it was imperative to adjust the system based on the varied working hours of their customers worldwide.

At that time, Citrix's Autoscaling capability was not in place, we had to come up with a custom solution.

BeyondScale Approach
Our strategy was to build a custom program using Citrix Remote PowerShell SDKs, and a python program which is a wrapper to manage the schedule of the customers.

We developed a web portal, facilitating our team to input customer details, associate them with specific Citrix workers, and configure individual settings. The python-based program picks these customer configurations - min workers, max workers, primary worker names, redundant worker names, off-hours start time, off-hours end time, workers on weekends - and communicate the workload requirements to the Powershell scripts. Below are the detailed steps on how the program works:

Identifying Eligible Workers
  • The initial step involved our program identifying a set of workers eligible for maintenance settings.
  • It assessed the user connectivity within the delivery group.
  • If a significant portion of the workers in a delivery group remained unengaged, they were earmarked for potential maintenance interventions.

Activation of Maintenance Mode:

  • The identified workers were transitioned to maintenance mode, ensuring they didn't initiate new user connections.
  • Concurrently, we cataloged the specifics of these workers for subsequent steps.
User Notifications
  • In cases where users were connected to more than 50% of the workers, our script adopted a judicious approach. It selected the workers with the fewest connections for notification.
  • Users were notified at specific intervals (30 minutes, 20 minutes, and 10 minutes) prior to any potential session disruption. This proactive approach ensured a smoother transition for end-users.

Shutdown Sequence
  • After the notification cycle was complete, the selected workers were once again logged for further action.
  • Subsequently, a carefully orchestrated shutdown script was executed on these workers, seamlessly powering them off.

Server Power On Procedure
  • Ensuring a seamless transition into the next business day was equally crucial. To achieve this, we employed a startup script to power on servers that were in an unregistered state.
  • Once these servers were successfully powered on and registered, they were promptly taken out of maintenance mode.

Achievements
  1. Resource Efficiency: The firm witnessed a marked reduction in resource utilization during non-operational hours. This led to a substantial monetary saving, reducing their AWS expenditure by around $4000.
  2. Improved User Interaction: Owing to predetermined communication, users experienced minimal disruptions and were able to smoothly switch over to the active workers.
  3. Dependable Automation: The python-driven program, interfacing with the PowerShell scripts presented a seamless, automated solution, ensuring operational consistency.

Conclusion
Leveraging a combination of Citrix Remote PowerShell SDKs and Python automation, our approach effectively addressed the MSP's need to optimize Citrix worker operations during non-working hours. This solution resulted in tangible cost savings without compromising on user satisfaction, attesting to BYS's adeptness in crafting tailored tech solutions.
Have a project in your mind?