Google Cloud Platform virtualization environments

The Citrix Virtual Apps and Desktops service lets you provision and manage machines on Google Cloud Platform (GCP). This article walks you through using Machine Creation Services (MCS) to provision virtual machines in your Citrix Virtual Apps or Citrix Virtual Desktops service deployment.

Requirements

  • Citrix Cloud account. The feature described in this article is available only in Citrix Cloud.
  • Citrix Virtual Apps and Desktops service subscription. For details, see Get started.
  • A GCP project. The project stores all compute resources associated with the machine catalog. It can be an existing project or a new one.
  • Enable four APIs in your Google Cloud project. For details, see Enable Google Cloud APIs.
  • GCP service account. The service account authenticates to Google Cloud to enable access to the project. For details, see Configure the Google Cloud service account.

Enable Google Cloud APIs

To use the Google Cloud functionality through Citrix Studio, enable these APIs in your Google Cloud project:

  • Compute Engine API
  • Cloud Resource Manager API
  • Identity and Access Management (IAM) API
  • Cloud Build API

From the GCP main screen, complete these steps:

  1. In the upper left menu, select APIs and Services > Dashboard.

    APIs and Services Dashboard select image

  2. On the Dashboard screen, ensure that Compute Engine API is enabled. If not, follow these steps:

    1. Navigate to APIs and Services > Library.

      APIs and Services Library image

    2. In the search box, type Compute Engine.

    3. From the search results, click Compute Engine API.

    4. On the Compute Engine API screen, click Enable.

  3. Enable Cloud Resource Manager API.

    1. Navigate to APIs and Services > Library.

    2. In the search box, type Cloud Resource Manager.

    3. From the search results, click Cloud Resource Manager API.

    4. On the Cloud Resource Manager API screen, click Enable. The API’s status appears.

  4. Similarly, enable Identity and Access Management (IAM) API and Cloud Build API.

Configure the Google Cloud service account

A Google Cloud service account lets you create and manage resources inside GCP projects. A Google Cloud service account is required to provision and manage machines as described in this article. The Google Cloud account authenticates to Citrix Cloud using a key generated by Google Cloud. Each account (personal or service) contains various roles defining the management of the project.

We recommend that you create a new service account. To do so, follow these steps:

  1. In the Google cloud console, navigate to IAM & admin > Service accounts.

  2. On the Service accounts page, click CREATE SERVICEACCOUNT.

  3. On the Create service account page, type the required information and then click CREATE.

    Tip:

    • You can click CANCEL to save and exit the Service account details page without completing the Grant this service account access to project and the Grant users access to this service account pages. We recommend that you complete the remaining two pages later.

When creating a service account, there is an option to create a key for the account. You need this key when creating a connection in Citrix Studio. The key is contained in a credential file (.json). The file is automatically downloaded and saved to the “Downloads” folder after you create the key. When you create the key, make sure to set the key type to JSON. Otherwise, Studio cannot parse it.

Tip:

Create keys using the Service accounts page in the GCP console. We recommend that you change keys regularly for security purposes. You can provide new keys to the Citrix Virtual Apps and Desktops application by editing an existing GCP connection.

Also, you need to grant your service account the necessary permissions to access your GCP project. To do so, follow these steps:

  1. In the Google Cloud console, navigate to IAM & admin > IAM.

  2. On the IAM page, locate the service account you created and then click the pencil icon to edit the service account.

  3. On the Edit permissions page, click ADD ANOTHER ROLE to add the following roles to your service account one by one and then click SAVE.

    • Compute Admin
    • Storage Admin
    • Cloud Build Editor
    • Service Account User
    • Cloud Datastore User
  4. Update the roles assigned to your project’s Cloud Build service account.

    1. In the Google Cloud console, navigate to IAM & admin > IAM.
    2. On the IAM page, locate the Cloud Build service account and then click the pencil icon to edit the service account. You can identify the Cloud Build service account by its user name, which is in this format: <your_gcp_project_ID_number\>\@cloudbuild.gserviceaccount.com.
    3. On the Edit permissions page, click ADD ANOTHER ROLE to add the following roles to your Cloud Build service account one by one and then click SAVE.
      • Cloud Build Service Account
      • Compute Instance Admin
      • Service Account User

Add a connection

In Citrix Studio, follow the guidance in Create a connection and resources. The following description guides you through setting up a hosting connection in Citrix Studio:

  1. On the Manage tab, navigate to Configuration > Hosting in the Studio navigation pane.

  2. In the Actions pane, click Add Connection and Resources.

  3. On the Connection page, select Create a new Connection and Studio tools and then click Next.

    • Connection type. Select Google Cloud Platform from the menu.
    • Service account key. Import the key contained in your Google credential file (.json). To do so, locate your credential file, open the file with Notepad (or any text editor), and then copy the content. After that, return to the Connection page, click Import key, paste the content, and then click OK.
    • Service account ID. The field automatically populates with the information from the imported key.
    • Connection name. Type a name for the connection*.
  4. On the Region page, select a project name from the menu, select a region containing the resources you want to use, and then click Next.

  5. On the Network page, type a name for the resources*, select a virtual network from the menu, select a subset, and then click Next. The resource name helps identify the region and network combination in Studio.

    * Note:

    The resource name can contain 1–64 characters, and cannot contain only blank spaces or the characters \ / ; : # . * ? = < > | [ ] { } " ' ( ) ' ).

  6. On the Summary page, confirm the information and then click Finish to exit the Add Connection and Resources window.

After creating the connection and resources, Studio lists the connection and resources you created. You might want to configure the connection. To do so, select the connection and then click the applicable option in the Actions pane.

Similarly, you can choose to delete, rename, or test the resources created under the connection. To do so, select the resource under the connection and then click the applicable option in the Actions pane.

Prepare a master VM instance and a persistent disk

Tip:

Persistent disk is the GCP term for virtual disk.

To prepare your master VM instance, create and configure a VM instance with properties that match the configuration you want for the cloned VDA instances in your planned machine catalog. The configuration doesn’t apply only to the instance size and type. It also includes instance attributes such as metadata, tags, GPU assignments, network tags, and service account properties.

As part of the mastering process, MCS uses your master VM instance to create the GCP “instance template.” The instance template is then used to create the cloned VDA instances that make up the machine catalog. Cloned instances inherit the properties (except the VPC, subnet, and persistent disk properties) of the master VM instance from which the instance template was created.

After configuring the properties of the master VM instance to your specifics, start the instance and then prepare the persistent disk for the instance.

We recommend that you manually create a snapshot of the disk. Doing so lets you use a meaningful naming convention to track versions, gives you more options to manage earlier versions of your master image, and saves time for machine catalog creation. If you don’t create your own snapshot, MCS creates one for you. You can use it to create the custom image in your GCP image library.

Create a machine catalog

Note:

Create your resources before you create a machine catalog.

In Citrix Studio, follow the guidance in Create machine catalogs. The following description is unique to Google Cloud Platform catalogs.

  1. On the Manage tab, select Machine Catalogs in the Studio navigation pane.

  2. In the Actions pane, click Create Machine Catalog.

  3. On the Operating System page, select Multi-session OS and then click Next.

    • The Citrix Virtual Apps and Desktops service also supports single-session OS.
  4. On the Machine Management page, select the Machines that are power managed and the Citrix Machine Creation Services options and then click Next. If there are multiple resources, you need to select one from the menu.

  5. On the Master Image page, select a VM and the minimum functional level for the catalog and then click Next.

  6. On the Virtual Machines page, specify how many VMs you want to create, view the detailed specification of the VMs, and then click Next.

  7. On the Computer Accounts page, select an Active Directory account and then click Next.

    • If you select Create new Active Directory accounts, select a domain and then type a name for the account naming scheme.
    • If you select Use existing Active Directory accounts, click Browse to navigate to the existing Active Directory computer accounts for the selected machines.
  8. On the Domain Credentials page, click Enter credentials, type the user name and password, click OK, and then click Next.

    • The credential you type must have permissions to perform Active Directory account operations.
  9. On the Scopes page, select scopes for the machine catalog and then click Next.

    • You can select optional scopes or click custom scope to customize scopes as needed.
  10. On the Summary page, confirm the information, specify a name for the catalog, and then click Finish.

    Note:

    The catalog name can contain 1–39 characters, and cannot contain only blank spaces or the characters \ / ; : # . * ? = < > | [ ] { } " ' ( ) ' ).

It might take a long time for the machine catalog creation to complete. After the catalog creation completes, Studio lists the catalog you created.

Add machines to a catalog

To add machines to a catalog, follow these steps:

  1. In the Studio navigation pane, select Machine Catalogs.

  2. Select the machine catalog to which you want to add machines.

  3. In the Actions pane, click Add Machines.

  4. On the Virtual Machines page, specify the number of machines you want to add and then click Next.

  5. On the Computer Accounts page, select an Active Directory account and then click Next.

  6. On the Domain Credentials page, click Enter credentials, type the user name and password, click OK, and then click Next.

  7. On the Summary page, confirm the information and then click Finish.

Update machines

This feature can be useful in cases where you want to update your master image or the minimum functional level.

To update machines, follow these steps:

  1. In the Studio navigation pane, select Machine Catalogs.

  2. Select the machine catalog that contains machines you want to update.

  3. In the Actions pane, click Update Machines.

  4. On the Master Image page, select a VM and the minimum functional level for the catalog and then click Next.

  5. On the Rollout Strategy page, specify when you want to update the machines and then click Next.

  6. On the Summary page, confirm the information and then click Finish.

To roll back a machine update, follow these steps:

Important:

Do not rename, delete, or move master images. Otherwise you cannot roll back the update.

  1. In the Studio navigation pane, select Machine Catalogs.

  2. Select the machine catalog where you want to roll back the machine update.

  3. In the Actions pane, click Rollback Machine Update.

  4. On the Overview page, confirm the information and then click Next.

  5. On the Rollout Strategy page, configure the rollout strategy and then click Next.

  6. On the Summary page, confirm the information and then click Finish.

Power management

The Citrix Virtual Apps and Desktops service lets you power manage GCP machines. Use the Search node in the navigation pane to locate the machine you want to power manage. The following power actions are available:

  • Delete
  • Start
  • Restart
  • Force Restart
  • Shut Down
  • Force Shutdown
  • Add to Delivery Group
  • Manage Tags
  • Turn on Maintenance Mode

You can also power manage the GCP machines by using Autoscale. To do so, add the GCP machines to a Delivery Group and then enable Autoscale for that Delivery Group. For more information about Autoscale, see Autoscale.

Import manually created GCP machines

You can create a connection to GCP and then create a catalog containing GCP machines. Then, you can manually power cycle GCP machines through Citrix Virtual Apps and Desktops service. With this feature, you can:

  • Import manually created GCP multi-session OS machines into a Citrix Virtual Apps and Desktops machine catalog.
  • Remove manually created GCP multi-session OS machines from a Citrix Virtual Apps and Desktops catalog.
  • Use existing Citrix Virtual Apps and Desktops power management capabilities to power manage GCP Windows Server machines. For example, set a restart schedule for those machines.

This functionality does not require changes to an existing Citrix Virtual Apps and Desktops provisioning workflow, nor the removal of any existing feature. We recommend that you use MCS to provision machines in Studio instead of importing manually created GCP machines.

More information