GCP Fleet Deployment: Cloudamize Agent Mass Installation via VM Manager

Overview

This Knowledge Base article provides a step-by-step guide on how to perform mass, non-interactive installations of the Cloudamize Agent across your Google Compute Engine (GCE) fleet using GCP VM Manager (OS Config).

GCP VM Manager allows you to manage software configurations, enforce patch management, and apply desired-state OS policies across large Compute Engine fleets without requiring direct SSH access, external IP addresses, or custom SSH key distribution. By using OS Policy Assignments, administrators can automatically deploy and maintain the Cloudamize inventory agent across Linux and Windows VMs simultaneously.

Note: The GCP VM Manager (OS Config) steps in this article are provided as guidance for using third-party deployment tooling with the Cloudamize Agent. Cloudamize has not validated or tested these GCP deployment workflows end to end. Review and test the process in your own GCP environment before using it for production deployments.

Prerequisites

Before deploying the Cloudamize Agent across your GCP fleet, verify that all target nodes comply with the official Cloudamize Agent Installation Prerequisites and meet the following GCP-specific requirements:

  • Official Cloudamize Prerequisites: Review OS compatibility, system resource requirements, and regional proxy/endpoint settings at the Agent Installation Prerequisites KB.

  • Network & Outbound Access: Target instances must have outbound access on TCP Port 443 directly or via Cloud NAT/Proxy to your assigned Cloudamize regional endpoint:

    • US Region: am.cloudamize.com

    • EU Region: am-de.cloudamize.com

    • UAE Region: am-ae.cloudamize.com

  • OS Config API: The osconfig.googleapis.com API must be enabled in your GCP project.

  • OS Config Agent: Target Compute Engine instances must have the google-osconfig-agent installed and running (pre-installed on most standard GCP public images).

  • Service Account Permissions: Target VMs must use a service account with permissions to communicate with the OS Config service (roles/osconfig.agent or roles/editor).

  • Console Access: Ensure you have access to your Cloudamize Console to copy your environment-specific installation command and Customer Key.

Step-by-Step Installation Instructions

Step 1: Enable VM Manager & OS Config API
  1. Log in to the Google Cloud Console.

  2. Navigate to Compute Engine > VM Manager.

  3. If prompted, click Enable VM Manager (or enable the OS Config API via Cloud Shell):

    #Bash
    gcloud services enable osconfig.googleapis.com
    
Step 2: Create the OS Policy Assignment Manifest

Important Note on Region Endpoints & Customer Keys:

The installer URL domain and custkey / customerkey parameters depend on the specific region where your Cloudamize assessment is provisioned (e.g., US, EU, or UAE) and your unique account credentials. Always copy the exact command and key directly from your Cloudamize Console.


Create an OS Policy manifest file (cloudamize-policy.yaml) on your local machine or Cloud Shell matching your target fleet OS:

For Linux Fleet (cloudamize-linux-policy.yaml):

#YAML
# OS Policy Assignment Manifest for Linux VMs
osPolicies:
  - id: install-cloudamize-agent-linux
    mode: ENFORCE
    resourceGroups:
      - resources:
          - id: cloudamize-agent-script
            exec:
              validate:
                interpreter: SHELL
                script: "systemctl is-active --quiet cloudamize-agent"
              enforce:
                interpreter: SHELL
                script: |
                  #!/bin/bash
                  sh <(curl 'https://am.cloudamize.com/cxf/downloadFileV3?custkey=<YOUR_CUSTOMER_KEY>&filename=installCloudamizeAgentV2.sh' -L)
instanceFilter:
  # Target VMs with matching labels (e.g., env=production)
  inclusionLabels:
    - labels:
        env: production
  # Set allToTrue: true instead of inclusionLabels if you wish to target ALL VMs in the zone
  # allToTrue: true

(Replace am.cloudamize.com with your regional endpoint domain if using EU or UAE, and replace YOUR_CUSTOMER_KEY with your actual Customer Key).

For Windows Fleet (cloudamize-windows-policy.yaml):

#YAM
# OS Policy Assignment Manifest for Windows VMs
osPolicies:
  - id: install-cloudamize-agent-windows
    mode: ENFORCE
    resourceGroups:
      - resources:
          - id: cloudamize-agent-msi
            exec:
              validate:
                interpreter: POWERSHELL
                script: "if (Get-Service 'Cloudamize Agent Service' -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"
              enforce:
                interpreter: POWERSHELL
                script: |
                  $msiPath = "$env:TEMP\cloudamizeAgent.msi"
                  Invoke-WebRequest -Uri "https://am.cloudamize.com/cxf/downloadFileV3?custkey=<YOUR_CUSTOMER_KEY>&filename=cloudamizeAgent.msi" -OutFile $msiPath
                  Start-Process msiexec.exe -ArgumentList "/i `"$msiPath`" customerkey=<YOUR_CUSTOMER_KEY> /qn" -Wait
instanceFilter:
  # Target VMs with matching labels (e.g., env=production)
  inclusionLabels:
    - labels:
        env: production
  # Set allToTrue: true instead of inclusionLabels if you wish to target ALL VMs in the zone
  # allToTrue: true

(Replace am.cloudamize.com with your regional endpoint domain if using EU or UAE, and replace YOUR_CUSTOMER_KEY with your actual Customer Key).

Step 3: Deploy OS Policy Assignment Across Your Fleet

Deploy the assignment manifest using the gcloud CLI. The targeting rules defined under instanceFilter in your YAML file will automatically determine which instances receive the Cloudamize Agent:

#Bash
gcloud compute os-config os-policy-assignments create cloudamize-agent-deployment \
  --location="us-central1-a" \
  --file="cloudamize-linux-policy.yaml" \
  --async


Verification & Monitoring

Once the OS Policy Assignment is applied, GCP automatically monitors and enforces the installation state:

  1. In the GCP Console, navigate to Compute Engine > VM Manager > OS Policies.

  2. Select cloudamize-agent-deployment to view compliance reporting across your instances (Compliant vs. Non-compliant).

  3. You can also generate an assignment compliance report via Cloud Shell:

    Bash
    
    gcloud compute os-config os-policy-assignment-reports list --location="us-central1-a"
    
  4. Verify agent services directly on target nodes:

    • Linux: Run systemctl status cloudamize-agent

    • Windows: Check services for Cloudamize Agent Service

  5. Log in to the Cloudamize Console and confirm that the newly registered instances appear in your node list.

Frequently Asked Questions

Why are some instances showing as Non-Compliant or missing?

Target Compute Engine instances must have the google-osconfig-agent running and possess a service account with the appropriate OS Config roles. Ensure outbound metadata and API access (osconfig.googleapis.com) are not blocked by VPC egress rules.

What is the benefit of using OS Config Policies over one-time scripts?

OS Config Policies enforce desired state (mode: ENFORCE). If a VM is restarted, reimaged, or a new VM with matching labels is launched, VM Manager automatically installs the Cloudamize Agent without manual intervention.

Do I need public IPs on my Compute Engine instances?

No. Instances in private subnets can communicate with the Cloudamize endpoint via Cloud NAT or an outbound proxy server as long as HTTPS (Port 443) outbound is permitted.

If you have any queries, please get in touch with the helpdesk via our Helpdesk Portal or by email at helpdesk@cloudamize.com.