Set up an auto scaling virtual desktop infrastructure (VDI) by using NICE EnginFrame and NICE DCV Session Manager - AWS Prescriptive Guidance

Set up an auto scaling virtual desktop infrastructure (VDI) by using NICE EnginFrame and NICE DCV Session Manager

Created by Dario La Porta and Salvatore Maccarone (AWS)

Code repository: elastic-vdi-infrastructure

Environment: PoC or pilot

Technologies: High-performance computing; Infrastructure

AWS services: AWS CDK; AWS CloudFormation; Amazon EC2 Auto Scaling; Elastic Load Balancing (ELB)

Summary

NICE DCV is a high-performance remote display protocol that helps you stream remote desktops and applications from any cloud or data center to any device, over varying network conditions. With NICE DCV and Amazon Elastic Compute Cloud (Amazon EC2), you can run graphics-intensive applications remotely on EC2 instances and stream their user interfaces to simpler, remote client machines. This eliminates the need for expensive dedicated workstations and the need to transfer large amounts of data between the cloud and client machines.

This pattern sets up a fully functional, auto scaling Linux and Windows virtual desktop infrastructure (VDI) that is accessible through a web-based user interface. The VDI solution provides research and development (R&D) users with an accessible and performant user interface for submitting graphics-intensive analysis requests and reviewing results remotely.

Prerequisites and limitations

Prerequisites

  • An active AWS account.

  • Administrator permissions and a set of access keys.

  • AWS Cloud Development Kit (AWS CDK) Toolkit, installed and configured. For more information, see Install the AWS CDK.

  • AWS Command Line Interface (AWS CLI), installed and configured for your AWS account. For more information, see Installing or updating the latest version of the AWS CLI.

  • Python, installed and configured. For more information, see Source releases (Python website).

  • One or more virtual private clouds (VPCs) available.

  • Two or more Elastic IP address available. For more information about the default limit, see Elastic IP address limit.

  • For the Linux EC2 instances, set up a Secure Shell (SSH) key pair. For more information, see Key pairs and Linux instances.

Product versions

  • AWS CDK version 2.26.0 or later

  • Python version 3.8 or later

Architecture

Target architecture

The following figure shows the different components of this VDI solution. The user interacts with NICE EnginFrame to launch Amazon EC2 instances according to the Amazon EC2 Auto Scaling groups for Windows and Linux NICE DCV instances.

Application Load Balancers and Auto Scaling groups for Windows and Linux VDI in a private subnet.

Automation and scale

The code included with this pattern creates a custom VPC, public and private subnets, an internet gateway, NAT gateway, Application Load Balancer, security groups, and IAM policies. AWS CloudFormation is also used to create the fleet of Linux And Windows NICE DCV servers.

Tools

AWS services

  • AWS Cloud Development Kit (AWS CDK) is a software development framework that helps you define and provision AWS Cloud infrastructure in code.

  • AWS CloudFormation helps you set up AWS resources, provision them quickly and consistently, and manage them throughout their lifecycle across AWS accounts and Regions.

  • NICE DCV is a high-performance remote display protocol that helps you deliver remote desktops and application streaming from any cloud or data center to any device, over varying network conditions. In this pattern, it provides a bandwidth-efficient experience that streams high performance computing (HPC) 3D graphics remotely.

  • NICE DCV Session Manager helps you create and manage the lifecycle of NICE DCV sessions across a fleet of NICE DCV servers.

  • NICE EnginFrame is an advanced frontend web interface for accessing technical and scientific applications in the cloud.

Code repository

The code for this pattern is available in the Auto scaling VDI solution with NICE EnginFrame and NICE DCV Session Manager repository.

Epics

TaskDescriptionSkills required

Clone the repository.

Clone the repository containing the code.

git clone https://github.com/aws-samples/elastic-vdi-infrastructure.git
Cloud architect

Install the required AWS CDK libraries.

Install the AWS CDK libraries.

cd elastic-vdi-infrastructure python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt
Cloud architect

Update the parameters.

  1. Open the app.py file in your text editor of choice.

  2. Replace the CHANGE_ME value for the following required parameters:

    • region – The target AWS Region. For a complete list, see AWS Regions.

    • account – The ID of the target AWS account. For more information, see Finding your AWS account ID.

    • key_name – The key pair used to access the Linux EC2 instances.

  3. (Optional) Modify the values for the following parameters to customize the solution for your environment:

    • ec2_type_enginframe – The EnginFrame instance type

    • ec2_type_broker – The Session Manager Broker instance type

    • ebs_enginframe_size – The size of the Amazon Elastic Block Store (Amazon EBS) volume for the EnginFrame instance

    • ebs_broker_size – The size of the EBS volume for the Session Manager Broker instance

    • TagName and TagValue – The billing tag for the resources

    • efadmin_uid – The unique identifier of the EnginFrame administrator (efadmin) user

    • linux_shared_storage_size – OpenZFS size in gibibytes (GiB)

    • Shared_Storage_Linux – The mount point of the shared storage

    • Enginframe_installer – The download link for EnginFrame

    • Session_Manager_Broker_Installer – The download link for the Session Manager Broker

  4. Save and close the app.py file.

Cloud architect

Deploy the solution.

Run the following commands in sequence.

cdk bootstrap cdk deploy Assets-Stack Parameters-Stack cdk deploy Elastic-Vdi-Infrastructure

When the deployment is complete, the following two outputs are returned:

  • Elastic-Vdi-Infrastructure.EnginFrameURL – The HTTPS address of the EnginFrame portal

  • Elastic-Vdi-InfrastruSecretEFadminPassword – The Amazon Resource Name (ARN) of the secret that contains the password for the efadmin user

Make note of these values. You use them later in this pattern.

Cloud architect

Deploy the fleet of Linux servers.

  1. Sign in to the AWS Management Console, and open the CloudFormation console.

  2. Choose Create stack, and then choose With new resources.

  3. In the cloudformation_files folder, select the dcv-linux-fleet.yaml file.

  4. On the Specify stack details page, define the following parameters:

    • Stack name – The name of the stack.

    • DcvFleet – The name of the NICE DCV fleet. Don’t leave this value blank or use spaces.

    • InstanceType – The instance type of the fleet.

    • RootVolumeSize – The root volume size of the Linux EC2 instance.

    • MinSize – The minimum number of nodes that should be available and not running any DCV session. For instance, if you enter 2, the solution starts with 2 nodes. When a user creates a session, the number of available nodes decreases to 1, and the solution creates another node to maintain the minimum.

    • MaxSize – The maximum number of nodes in the fleet. Users cannot start new sessions if the maximum has been reached.

    • BillingTagName – The tag name used for billing. This tag name must be different from the one used for the Windows stack.

    • BillingTagValue – The tag value used for billing.

  5. Complete the stack creation wizard, and then choose Submit to start creating the stack.

Cloud architect

Deploy the fleet of Windows servers.

  1. Sign in to the AWS Management Console, and open the CloudFormation console.

  2. Choose Create stack, and then choose With new resources.

  3. In the cloudformation_files folder, select the dcv-windows-fleet.yaml file.

  4. On the Specify stack details page, define the following parameters:

    • Stack name – The name of the stack.

    • DcvFleet – The name of the NICE DCV fleet. Don’t leave this value blank or use spaces.

    • InstanceType – The instance type of the fleet.

    • RootVolumeSize – The root volume size of the Windows EC2 instance.

    • MinSize – The minimum number of nodes that should be available and not running any DCV session.

    • MaxSize – The maximum number of nodes in the fleet.

    • BillingTagName – The tag name used for billing. This tag name must be different from the one used for the Linux stack.

    • BillingTagValue – The tag value used for billing.

  5. Complete the stack creation wizard, and then choose Submit to start creating the stack.

Cloud architect
TaskDescriptionSkills required

Retrieve the EnginFrame administrator password.

The EnginFrame administration account is named efadmin, and the password is stored in AWS Secrets Manager as a secret. The ARN of the secret is generated dynamically and is visible in the output of the AWS CDK deployment.

  1. In the previous epic, in the Deploy the solution story, under the Elastic-Vdi-Infrastructure.SecretEFadminPassword output, find the ARN of the generated secret.

  2. Do one of the following to retrieve the secret:

Cloud architect

Access the EnginFrame portal.

  1. In the previous epic, in the Deploy the solution story, under the Elastic-Vdi-Infrastructure.EnginFrameURL output, find the HTTPS address of the EnginFrame portal.

  2. In a web browser, enter the HTTPS address of the portal.

  3. Enter the credentials for the efadmin user.

Cloud architect

Start a Windows session.

  1. In the EnginFrame portal, in the menu, choose Windows Desktop.

  2. When you are prompted to sign in as a Windows administrator, enter the same password used for the efadmin user.

  3. Confirm that the Windows session successfully starts.

Cloud architect

Start a Linux session.

  1. In the EnginFrame portal, in the menu, choose Linux Desktop.

  2. When you are prompted to sign in, enter the credentials for the efadmin user.

  3. Confirm that the Linux session successfully starts.

Cloud architect
TaskDescriptionSkills required

Delete the stacks.

In the AWS CloudFormation console, delete the stacks for the Windows and Linux server fleets. For more information, see Deleting a stack.

Cloud architect

Delete the infrastructure.

Delete the deployed infrastructure by using the following AWS CDK command.

cdk destroy --all
Cloud architect

Troubleshooting

IssueSolution

The deployment didn’t complete because it was interrupted.

Follow the instructions in the Clean up epic and then repeat this pattern to deploy the environment again.

Related resources