PowerShell commands are used to deploy Unified Access Gateway 2103 or later to Compute Engine within Google Cloud Platform.
Procedure
- Prepare the client machine
- Prepare the Google Cloud Platform environment
- Upload the Unified Access Gateway Image to Google Cloud Platform
- Prepare an
.inifile for deploying to Google Cloud Platform - Deploy to Compute Engine
Step 1: Prepare the client machine for PowerShell deployment
Install the Google Cloud utilities on Client machine.
-
Install
gsutil. For instructions about installing thegsutiltool on Windows and Ubuntu, see Installing gsutil as part of the Google Cloud CLI on Google Cloud Documentation. -
For Windows machine, run the following PowerShell command with administrative rights.
Install-Package 7Zip4PowerShell
Recommended Operating Systems for running the PowerShell deployment script
The following table lists the operating systems from which PowerShell based Unified Access Gateway deployment to Google Cloud Platform can be executed. This does not refer to the operating system of the Unified Access Gateway appliance itself.
| Operating System | Recommended OS Version | PowerShell Version |
|---|---|---|
| Windows | 10 and 11 | 5 and 7 |
| Ubuntu | 20.04, 22.04, 24.04 | 7 |
Step 2: Prepare the Google Cloud Platform environment
Use a Google Cloud project. This project must be configured with VPC networks, the corresponding subnet networks, and firewall rules. For more information, see Google Cloud Documentation.
Prerequisites
- Ensure that you are aware of the Google Cloud Platform concepts.
- Ensure that you have the necessary permissions to create or modify resources such as images, VPC network, subnet, firewall rules, and so on, in the Google Cloud project.
- Compute Engine API must be enabled.
Procedure
-
Use a Google Cloud project.
Option Action New project - In the Google Cloud Console, navigate to the Project Selector page.
- Create a Google Cloud project.
Existing project If a project is already available and active, you can use the existing project. -
Create a Virtual Private Cloud (VPC) network for each NIC.
Each NIC on the Unified Access Gateway uses a unique VPC network and a subnet within that network.
If you choose not to create a VPC network, only a single NIC Unified Access Gateway can be deployed. The Unified Access Gateway appliance, when deployed in the Compute Engine uses the default VPC network available in the Google Cloud Platform.
For example, in the following image, two VPC networks,
uag-front-vpcanduag-back-vpc, are created in the Google Cloud Console. These VPC networks haveuag-front-networkanduag-back-networkas subnets respectively. A Unified Access Gateway two NIC appliance can be deployed to use these two subnets for front-end Internet facing and a separate subnet network for back-end connections.
Note: You can also configure Unified Access Gateway with shared VPC networks. In such case, Unified Access Gateway instances deployed on the service project are attached to the shared VPC networks created and managed on the host project. Each network interface (NIC) on Unified Access Gateway can be configured independently to use either shared VPC network or local VPC network. For more information, see Configuring Shared VPC on Google Cloud documentation.
-
Make a note of the subnet name created.
The subnet name within a VPC network is used in the
.inifile while deploying Unified Access Gateway by using PowerShell. -
To allow TCP and UDP port access to Unified Access Gateway appliances in the Internet accessible VPC, create the required number of firewall entries.
Important: SSH remote access to Unified Access Gateway on TCP port 22 from the Internet must be carefully restricted on the firewall. If SSH access is needed, the firewall rule must allow this access from a specific source IP address only or from a jump box virtual machine in the cloud from which access can be controlled.
For example, in the following Google Cloud Console image, a firewall rule named
uag-horizon-protocolsis created in the internet facing VPC networkuag-front-vpc. This firewall rule applies to all the instances connected touag-front-vpcnetwork and allows inbound TCP and UDP traffic on specified ports from the public internet.
Step 3: Upload the Unified Access Gateway Image to Google Cloud Platform
To deploy a Unified Access Gateway instance to the Compute Engine, you must upload a Unified Access Gateway appliance disk image to the Google Cloud Platform.
-
From the Omnissa Customer Connect, go to Unified Access Gateway (UAG) for vSphere, AWS and Google Cloud file and click DOWNLOAD NOW.
A zip fileeuc-unified-access-gateway-x.x.x.xxxxxxxxx.ovais downloaded on your local machine. -
Open a PowerShell command window and run the following command to extract the
.vmdkfile from the previously downloaded.ovafile.- ova-filename is the
.ovaimage file, which is downloaded from Customer Connect. - target-location is the location to which the
.vmdkfile is extracted.
Windows Ubuntu
For example,expand-7zip ova-filename target-locationeuc-unified-access-gateway-22.12.0.0-42741890_OVF10.ovais the downloaded file, where22-12is the version number and42741890is the build number. To extract the.vmdkfile toC:\temp, run the following command:expand-7zip C:\temp\euc-unified-access-gateway-22.12.0.0-42741890_OVF10.ova C:\temp\
For example,tar -xvf ova-filenametar -xvf euc-unified-access-gateway-22.12.0.0-42741890_OVF10.ova - ova-filename is the
-
Set the following variables.
- $gcImageFile is the filename of the
.vmdkfile extracted in step 2. - $gcImageFolder is the folder path of the
.vmdkfile. For example:
$gcImageFolder="C:\temp" $gcImageFile="euc-unified-access-gateway-22.12.0.0-42741890-system.vmdk" $gcBucket="uag-appliance-images" $gcImageName=$gcImageFile.Replace("-system.vmdk","").Replace(".", "-") gcloud auth login gcloud config set project "my-project" - $gcImageFile is the filename of the
-
Create a Google Cloud storage bucket.
Note: You can also deploy Unified Access Gateway with compute image hosted on another Google Cloud project. In such case, specify the compute image name ($gcImageName) and the hosting Project ID during Unified Access Gateway deployment.
Run this command to create storage bucket in the same project.
gsutil mb -l us-east1 gs://$gcBucketRun this command to create storage bucket in a differnt project.
gsutil mb -l us-east1 gs://$gcBucket -p my-image-hosting-project -
Upload the
.vmdkimage to the Google Cloud storage bucket by using the following command:gsutil cp $gcImageFolder\$gcImageFile gs://$gcBucket -
Create the appliance image in the Compute Engine from the uploaded
.vmdk.Run this command to import image in the same project.
gcloud compute images import $gcImageName --source-file gs://$gcBucket/$gcImageFile --data-diskRun this command to import image in a different project.
gcloud compute images import $gcImageName --source-file gs://$gcBucket/$gcImageFile --data-disk --project my-image-hosting-projectNote: When you import a compute image, you can specify the subnet to be used for the temporary VMs created by the import tool. Use the flag
--subnetas shown in the following example.gcloud compute images import $gcImageName --source-file gs://$gcBucket/$gcImageFile --data-disk --subnet defaultFor more information about these commands, see Google Cloud SDK documentation.
Considering the example mentioned in the previous steps, the appliance image created in the Compute Engine is
euc-unified-access-gateway-22-12-0-0-42741890where22-12is the version number and42741890is the build number.
Step 4: Prepare an .ini file for deploying to Google Cloud Platform
The Compute Engine PowerShell deployment script for Unified Access Gateway reads all configuration settings from a .ini configuration file. This section describes the .ini file format and shows examples of the settings that can be used for the deployment.
Most sections of the .ini file are identical to the standard .ini settings for Unified Access Gateway as supported for all the other hypervisor deployments. For more information about the .ini file, see the Using PowerShell to Deploy the Unified Access Gateway Appliance section.
-
Configure the required settings in the [General] section. See PowerShell deployment parameters.
Note: For Google Cloud Platform deployments, the following settings in the [General] section are not used:
diskModedsfoldernetInternetnetManagementNetworknetmask0,netmask1,netmask2netBackendNetworksourcetargetip0,defaultGateway,netmask0,ipmode0v6ip0,v6ipprefix0,v6DefaultGateway
-
In the
.inifile, add a new group, [GoogleCloud] and the necessary settings specific to Google Cloud Platform.
The following table lists the settings (Value Name) that are required for the Google Cloud Platform deployment.
| Group | Value Name | Example | Description | Mandatory/Optional |
|---|---|---|---|---|
| [GoogleCloud] | projectId | projectId=my-project | The Google Cloud Platform project ID used for creating a new Unified Access Gateway instance. If the project ID is not provided, the project from active configuration in the Cloud SDK is used. | Optional |
| imageName | imageName=euc-unified-access-gateway-22-12-0-0-42741890 | Name of the imported appliance image in the Compute Engine from which a new instance must be created. | Mandatory | |
| imageProjectId | imageProjectId= (image-host-project) | The Project that hosts the compute image imageName. If not specified, default projectId is used for looking up the compute image. | Optional | |
| machineType | machineType=e2-standard-4 | Indicates the Compute Engine machine type.
Default value of machineType is e2-standard-4.
Note: Ensure that the machineType specified is appropriate for the number of Unified Access Gateway NICs required.
For example: e2-standard-2 supports one NIC or two NIC deployments but not three NIC. For more information, see Maximum number of network interfaces on Google Cloud documentation. | Optional | |
| zone | zone=us-central1-a | Compute Engine zone where new a Unified Access Gateway instance is created. If the zone value is not provided, the zone from active configuration in the Cloud SDK is used. | Optional | |
| subnet0 subnet1 subnet2 | subnet0=custom-subnet | Subnet on which eth0, eth1, and eth2 NICs of the Unified Access Gateway must be created.
Following are the values of the deploymentOption and the corresponding subnets used:
| In a two NIC or three NIC deployment, only one of the subnet values can be optional. | |
| vpcHostProjectId | vpcHostProjectId= (shared-vpc-host-project) | The project that acts as host project when any of the Unified Access Gateway NICs is configured from shared VPC. To configure a given subnet on shared VPC, set the sharedVpcForSubnet<n> flag to true, where, n is the NIC number. | Optional | |
| sharedVpcForSubnet0 sharedVpcForSubnet1 sharedVpcForSubnet2 | | If vpcHostProjectId is specified, this flag indicates whether a given subnet is created in shared VPC. If vpcHostProjectIdis not specified, this field is ignored. The default value is false. | Optional | |
| privateIPAddress0 privateIPAddress1 privateIPAddress2 | privateIPAddress0=10.30.11.213 | Internal IP address for the NIC.
This setting can be used to attach eth0, eth1, and eth2 of the Unified Access Gateway with static internal IP addresses from Google Cloud's VPC network.
If the value of privateIPAddress is not provided, Compute Engine attaches the corresponding NIC with a dynamic internal IP address.
For example: consider a two NIC deployment
| Optional | |
| publicIPAddress0 publicIPAddress1 publicIPAddress2 |
publicIPAddress0=eipalloc-027afa45f34984c87
publicIPAddress1=no-address | External IP address for the NIC
This setting can be used to attach eth0, eth1, and eth2 of the Unified Access Gateway with reserved external IP addresses from Google Cloud's VPC network.
If the value of publicIPAddress is not provided, Compute Engine attaches the corresponding NIC with a dynamic external IP address.
To prevent a NIC from attaching with an external IP address, use no-address as the value.
In the example, consider a three NIC deployment:
| Optional | |
| labels | labels=label0=value0,label1=value1 | Labels associated with a Unified Access Gateway instance.
By default, name=$uagName label is associated with a Unified Access Gateway instance by the PowerShell script. | Optional | |
| tags | tags=tag0,tag1 | Tags associated with a Unified Access Gateway instance.
By default, https-server tag is associated with the Unified Access Gateway instance by the PowerShell script. | Optional | |
| serviceAccount | serviceAccount=51841023978-compute@prod.gserviceaccount.com | A service account is an identity attached to the Unified Access Gateway instance. The service account's access tokens can be accessed through the Unified Access Gateway instance metadata server and are used to authenticate applications on the instance. The account can be set using an email address corresponding to the required service account. If the service account is not provided, the Unified Access Gateway instance uses the project's default service account. | Optional |
Example 1: INI File Definition for deploying Unified Access Gateway to Google Cloud Platform
[General]
name=uag1
deploymentOption=onenic
sshEnabled=true
[GoogleCloud]
projectId=my-project
imageName=euc-unified-access-gateway-22-12-0-0-42741890
zone=us-central1-a
subnet0=uag-front-network
[Horizon]
proxyDestinationUrl=https://myhorizon.example.com
Example 2: INI File Definition for deploying Unified Access Gateway to Google Cloud Platform
[General]
name=uag2
deploymentOption=twonic
sshEnabled=true
routes1=10.20.0.0/16 10.2.0.1
[GoogleCloud]
projectId=my-project
imageName=euc-unified-access-gateway-22-12-0-0-42741890
imageProjectId=my-image-hosting-project
zone=us-central1-a
vpcHostProjectId=my-sharedvpc-host-project
subnet0=uag-front-network
sharedVpcForSubnet0=true
subnet1=uag-back-network
sharedVpcForSubnet1=false
[Horizon]
proxyDestinationUrl=https://myhorizon.example.com
Step 5: Deploy to Compute Engine
You can deploy Unified Access Gateway to Compute Engine by using the uagdeploygce.ps1 PowerShell command. This command takes all configuration settings from an .ini file and deploys an instance of Unified Access Gateway.
If any existing instance in the Compute Engine has the same name as specified in the General section of the .ini file, the PowerShell script removes the existing instance during deployment and creates a new Unified Access Gateway instance with the same name. This replacement helps while upgrading a Unified Access Gateway appliance or to redeploy the appliance with updated settings.
-
From the Omnissa Customer Connect, go to Unified Access Gateway (UAG) PowerShell Scripts file and click DOWNLOAD NOW.
A zip fileuagdeploy-xx.xx.x.x-xxxxxxxxis downloaded on your local machine. -
Extract the files from the zip file. Ensure that the following PowerShell scripts are available on your machine.
uagdeploygce.ps1anduagdeploy.psm1on your Windows machine. -
Start a PowerShell command window and change the directory to the folder that contains the downloaded scripts.
-
To deploy Unified Access Gateway to the Compute Engine, perform the following:
-
If you are upgrading to a later version of Unified Access Gateway, edit the
.inifile to update theimageNamesetting to the new image name which is uploaded to the Compute Engine in one of the previous tasks.All other configuration parameters in the
.inifile must remain the same. -
Run the following command depending on whether you choose the interactive or non-interactive mode:
For more information about the root user and admin password requirements, see Password requirements.
Mode Command Interactive
<ini-filename> is the name of the.\uagdeploygce.ps1 <ini-filename>.ini.inifile prepared in the earlier tasks. For example:.\uagdeploygce.ps1 uag1.iniuag1.iniis the filename used in the earlier tasks.Non-Interactive .\uagdeploygce.ps1 <ini-filename> <root-pwd> <admin-pwd> <ceip-yes-no>
.\uagdeploygce.ps1 <ini-filename> <secret> <admin-pwd> yes- <ini-filename> is the name of the
.inifile prepared in the earlier tasks. - If passwords are specified on the command line as shown in the command, use the
Clear-HistoryPowerShell command after deploying the Unified Access Gateway.
If you run the
uagdeploygce.ps1command again, the previous Unified Access Gateway instance and associated resources are deleted and replaced with a new instance having the same name. The new.inifile must have all the required configuration parameters so that the Unified Access Gateway appliance is ready for production on first boot. - <ini-filename> is the name of the
-
What to do next
After Unified Access Gateway is deployed to Compute Engine and all settings are applied, the metadata used to apply the Unified Access Gateway appliance's configuration settings in Google Cloud must be removed. To remove the metadata, use the following commands as shown in the example:
$uagName=uag1
$zone=us-central1-a
$projectId=my-project
gcloud compute instances remove-metadata $uagName --zone=$zone --project $projectId --keys "user-data"
Was this page helpful?