Skip to content

Scheduled Actions and Send Messages

Deployments often require maintenance activities to be performed on one or more desktops at a scheduled time. HyWorks v3.4-SP2 or later enables administrators to configure such schedules and perform actions at the scheduled time.

The actions can be performed directly in the HyWorks Controller Management Console, but the automation that schedules them makes this possible.

In this section, details of scheduled actions and notifications will be provided.

Architecture and Prerequisites

Refer to the diagram below for the required components and communication flow between HyWorks modules for scheduled actions:

Prerequisites

As per the diagram above, the following components are required for scheduled actions and notifications to work from the HyWorks Controller Management Console:

  1. HyWorks Scheduler: Service to take schedule data and push it to the message queue.

  2. HyWorks Action Processor: To consume data from the message queue and pass it to the action handler on the controller.

  3. Accops Message Queue: For temporarily storing schedule data and notifications.

Terminology

  1. Publisher(s): Modules that send data to message queues are called publishers.

  2. Consumer(s): Modules receiving data from message queues are called consumers.

Port Requirements

The network ports used and required to be opened if any firewall is present between the two components:

From To Port No. Protocol Customizable Purpose Mandatory If the port is not open
Scheduler/Action Processor
Installed on the HyWorks Controller itself
Accops Message Queue
Installed on the HyWorks Controller itself
5672(Non-SSL)
5671(SSL)
TCP No Pushing schedule data to the message queue Yes, for capacity planning, scheduled actions, and sending messages in sessions Mentioned features will not work.
Virtual Desktop VMs Accops Message Queue
Installed on HyWorks Controller
5672(Non-SSL)
5671(SSL)
TCP No Getting messages from the message queue Yes, for sending messages in sessions Mentioned features will not work.

Supported Objects and Actions

Below is the tabular representation of supported objects and actions under the Scheduled Actions feature:

Object Type Supported Actions
Personal Desktops Start
Shutdown
Reboot
Move to version
Shared Hosted Desktops Mark active
Mark inactive
Start
Shutdown
Reboot
Move to version

Note

  • Unmanaged shared hosted desktops are not supported for scheduled actions.

  • Shared Hosted desktops associated with a desktop pool having on-demand provisioning based on the capacity plan are not supported for scheduled actions.

  • Physical desktops are not supported for scheduled actions.

Installation and Configurations

Important

  • Scheduled Actions and Sending Messages in Sessions require Accops HyWorks Scheduler and Action Processor modules.

  • Scheduler and Action Processor must be installed on HyWorks Controller Management Nodes only.

Installation

Accops HyWorks Scheduler and Action Processor

The detailed installation and configuration requirements are provided in the scheduler Installation section.

Message Queue High Availability

With the inclusion of critical actions such as Move to version, the message queue becomes an essential component that must remain highly available at all times.

The high-availability of the message queue can be maintained using two methods:

  1. All modules that interact with message queues must be configured with both message queue addresses, and these components work with the reachable message queue server.

  2. External Load Balancer: With an external load balancer deployed, it ensures the available message queue is used and maintains high availability. Following additional configuration will be needed:

    1. Configure a virtual service on port 5672 (Non-SSL) or port 5671 (SSL).

    2. Backend real servers will use the actual Accops MQ server host address and port: 5672 (Non-SSL) or 5671 (SSL).

HyWorks Configuration

To enable the feature of scheduled actions and sending messages in the sessions, the following configurations will be needed on the HyWorks Controller:

  1. From the HyWorks Controller Management Console, go to Settings > General > Advance Settings.

  2. In Tags Filter, set it to Message Queue and Capacity Plan. Locate and update the following configurations:

Configuration Description
Default Value
Value to set
Publish to MQ Servers Provided host addresses will be used to send queue data. Comma-separated -hostnames/IPs of the MQ servers to send messages to. IP address of load balancer (If load balancer is configured)

Comma-separated IP addresses of the MQ servers (If load balancer is not available)
Consume from MQ Servers Consumers will use the provided host addresses to retrieve queue data. Comma-separated IP addresses of the MQ servers to get messages from Comma-separate IP addresses of the MQ servers
MQ Port Used for communication with the MQ server. Default value 5672. 5671 - SSL

5672 - Non-SSL
Use MQ SSL To mark as true if the message queue is configured to use SSL. True (If SSL is configured)

False (If SSL is not configured)
MQ Username Username to be used to connect to MQ servers. Default: accopsmqadmin As per the configured username
MQ Password Password to be used to connect to MQ servers. Default value: guest. As per the configured password
Enable notification listener in DVM tools If the send message/notification feature is to be enabled in the sessions. Default value: False True
Manage scheduler service HyWorks Controller to manage the scheduler service on the server. Default value: false True

Scheduled Actions Workflow and Management

Scheduled Actions

The workflow of the Scheduled action feature will be briefly discussed here:

  1. Schedule Creation Phase

    1. An admin creates a Scheduled Action in the Management Console.

    2. The controller service creates an action execution schedule for the schedule service.

    3. Schedule details are stored in the database.

    4. Controller Service informs the Scheduler Service to prepare execution.

  2. Scheduling & Trigger Phase

    1. Scheduler persists the schedule and waits until execution time.

    2. At trigger time, Scheduler publishes metadata to AccopsMQ. Metadata includes:

      • ScheduledActionId

      • MessageActionType = ActionExecution

  3. Action Processing Phase

    1. Action Processor consumes the message from AccopsMQ.

    2. Calls the Controller API to execute the action.

    3. Controller validates and creates a background job.

  4. Execution Phase (Decision Point)

    1. Background Worker picks up the job.

    2. Action handling depends on type:

      Action Type Execution Mode
      Start / Shutdown / Reboot / Move to Version New background job
      Mark Active / Mark Inactive Immediate execution

    !!! note

     Actions may be skipped based on VM / Pool properties.
    
  5. Status & Completion Phase

    1. Per-object execution status collected: Success, Skipped, Failed

    2. Final job status updated as Completed or Failed.

  6. Detailed logs are created and can be viewed from the HyWorks Controller Management Console.

Conditions when Scheduled Actions will be skipped

Scheduled actions will be skipped or will not be allowed in the following conditions:

  1. If the capacity plan is applied to the pool.

  2. "Move to version" schedule action will be skipped, if the pool recompose type is graceful.

  3. If the schedule has been set to "Skip if a session exists", then the action will be skipped if one or more sessions exist on the target desktop VM.

  4. If a power operation job already exists for the VM, the power operation action will be skipped.

  5. If the VM is not in a valid state for power operation, below are the Valid state for respective action:

    • To start: Stopped

    • To shutdown: Running

    • To reboot: Stopped

  6. "Move to version" schedule action will be skipped if the targeted version is the same for recompose

  7. If the pool is already being recomposed, the Move to version action will be skipped.

Scheduled Actions, Dependencies, and Possible Points of Failures

  1. Accops MQ is not reachable at the scheduled time. The scheduler will retry 3 times.

  2. The database is unreachable at the scheduled time.

  3. HyWorks Controller is giving an exception for Action processing.

  4. The Scheduler, Action processor, and Controller are working fine, but the hypervisor is unreachable.

  5. The scheduler is not working, or the service stopped at the scheduled time.

Notifications

For notifications, the following flow of actions will occur:

  1. The scheduler service triggers an event at the notification schedule time and pushes the schedule metadata to AccopsMQ for processing. Schedule metadata contains the following fields:

    1. ScheduledActionId: Scheduled action unique id to identify the scheduled action in HyWorks.

    2. MessageActionType: This value will be included in the payload as a notification.

  2. The action processor consumes the message from AccopsMQ and calls the controller API to process the notification.

  3. The controller accepts the request from the action processor, validates it, and creates a background worker job to process it.

  4. Background worker picks up the job and checks whether AccopsMQ is reachable. Identify the Action and object types for processing. Get the list of VMs for the notification to be published, based on the objects added to the schedule.

  5. Notification will be skipped for VM in the following cases:

    • If VM is part of a capacity planning-enabled pool.

    • In the case of Move to Version, if the pool is not set to recompose type as forceful.

    • In the case of Move to Version, if the VM target version is the same as the current version.

  6. Get the notification template from the database.

Publish the notification data to AccopsMQ. The queue name will be in the format "DvmAgent-{VMId}". The DVM agent will consume these messages and publish the notification to the logged-in user.

Mark the background job status as completed or failed, and log the status of each object in detail.

Notification templates

  • Skip action if the Session exists.

    • Subject/Header: Planned action on VM

    • Content: Desktop is scheduled for [Action] at [ActionTime]. Save your work and sign out of Desktop.

  • Perform Action even if the session exists

    • Subject/Header: Planned action on VM

    • Content: Desktop is scheduled for [Action] at [ActionTime]. Save your work and sign out of Desktop to prevent data loss.

Important

  • Notification templates are saved in the database. The HyWorks Controller Management Console does not have an option to modify templates. The template uses the following variables, which can be used to create a custom notification (only from the database):

    • [Action]

    • [ActionTime]

    • [Username]

  • Notifications will not be shown in user sessions if the desktop agent service is down or not working for any reason.

Schedule Management

Administrators can create, update, delete, and view schedules on the page.

Add a new schedule

To add a new schedule, follow the steps below:

  1. In the HyWorks Controller Management Console, go to the page.

  2. Click on the Add button.

  3. In the Create a Schedule wizard, Primary Details section:

    1. Schedule Name: Provide a logical name for the schedule.

    2. Description: Description for the schedule.

    3. Date: Set a date for the action to be executed.

    4. At Time: The time of action execution.

    5. Status: To keep the schedule active or inactive.

    6. Skip if session active: Whether to skip the action if there is one or more sessions on the selected objects.

    7. Object Type: Personal or shared hosted desktops.

    8. Action: Choose the action to be performed on the desktop VMs. See section Supported Objects and Actions for details.

    9. Notify User Before: Click the Add Notification button to add notifications that appear in sessions on desktop VMs before executing an action.

    10. Provide time in minutes (Notification will be shown before the execution as per the provided time.)

    11. A maximum of 5 notifications can be configured, and the minimum and maximum time before notifications are shown to users is 5 minutes and 60 minutes, respectively.

  4. Click Continue to navigate to the Select Object(s) section.

    1. Desktop VMs will be displayed according to the selected Object Type in step #7.

    2. An administrator can use Filters to filter out VMs and Show/Hide Columns to customize the displayed details.

  5. Select one or more desktop VMs and click Save.

  6. Scheduled items will be saved and listed on the Schedules page.

Modify Schedule

Administrators can modify an existing schedule by following the steps:

  1. From the Schedules page, select an existing schedule.

  2. Click Edit.

  3. Modify the configurations.

  4. Click Update to save the changes.

  5. The updated schedule will be posted, and actions will be carried out in accordance with the new instructions.

Note

  • Executed and unexecuted, both types of schedules can be modified.
Editable and Non-editable Configurations

While editing a schedule, the following configurations can be modified:

  • Name

  • Description

  • Date

  • Time

  • Status

  • Skip if session active

  • Notifications

  • Selected objects (Desktop VMs)

Once created, the following configurations can not be modified:

  • Object Type

  • Action

Delete Schedules

Administrators can delete an existing schedule by following the below steps:

  1. From the Schedules page, select an existing schedule.

  2. Click Delete.

  3. The Confirm Action dialog will appear, requiring the schedule name.

  4. Enter the Name of the schedule to delete, then click Delete in the Confirm Action dialog.

  5. Schedules will be deleted.