action.skip

Installing in Google Cloud Platform

Use this procedure to install the Zenoss Cloud Collector virtual appliance as a Google Compute Engine (GCE) instance in Google Cloud Platform (GCP). This procedure uses the gcloud tool to create a GCE instance.

Prerequisites

To perform this task, you need:

  • A GCP account with permission to create images and virtual machines in GCE.
  • A GCP project enabled for GCE.
  • A workstation with Google Cloud SDK installed.

    The gcloud tool must be installed and initialized.

Installing the collector

Note

This procedure uses Bash shell conventions to set variables. Adjust as needed for different shells.

  1. Log in to a shell that has Google Cloud SDK installed and the gcloud tool initialized.

  2. Create a variable for the name of the instance to create.

    1. List existing instance names.

       gcloud compute instances list
      
    2. Specify a name that is unique in your GCP environment. In the following command, replace INSTANCE-NAME with a new name:

      myName=INSTANCE-NAME
      
  3. Create a variable for the GCE zone for the instance.

    1. List available zones.

       gcloud compute zones list
      
    2. Select the zone that matches the location where the infrastructure and applications to monitor are running. In the following command, replace GCE-ZONE with the zone you select:

      myZone=GCE-ZONE
      
  4. Create a variable for the GCE machine type to use.

    1. List available types.

       gcloud compute machine-types list
      
    2. Select a type that meets your needs and all collector resource requirements. For example, n1-standard-4. In the following command, replace MACHINE-TYPE with the type you select:

      myMachine=MACHINE-TYPE
      
  5. Create a variable for the GCE subnet to use.

    1. List available subnets.

       gcloud compute networks subnets list
      
    2. Select the same address space as the infrastructure and applications to monitor. In the following command, replace SUBNET with the subnet you select:

      mySubnet=SUBNET
      
  6. Create a variable for the GCP project to use.

    1. List available projects.

       gcloud projects list
      
    2. Select a type that meets your needs. In the following command, replace PROJECT with the project you select:

      myProject=PROJECT
      
  7. Create a variable for the location of the image to use.

    Copy the following command and paste it in your shell:

    zenossImage=https://www.googleapis.com/compute/v1/projects/zing-registry-188222/global/images/zenoss-collector-stable
    
  8. Verify the variables you chose in steps 2-6.

    env | grep -E '^my'
    
  9. Create a new instance.

    Copy the following command and paste it into your shell:

    gcloud compute instances create ${myName} \
      --zone=${myZone} \
      --machine-type=${myMachine} \
      --subnet=${mySubnet} \
      --image=${zenossImage} \
      --boot-disk-size=25GB \
      --boot-disk-device-name=collector-1 \
      --project=${myProject}
    

    Here is an example invocation:

    gcloud compute instances create zenoss-collector-1 \
      --zone=us-central1-a \
      --machine-type=n1-standard-4 \
      --subnet=default \
      --image=https://www.googleapis.com/compute/v1/projects/zing-registry-188222/global/images/zenoss-collector-stable \
      --boot-disk-size=25GB \
      --boot-disk-device-name=collector-1 \
      --project=marketing
    

Optional: Set additional DNS search domains

You can customize DNS resolution for your virtual machine and grant access to additional users. The following options are supported:

  • Additional DNS forwarding/DNS search domain entries
  • A default resolver other than the one provided by GCP
  • Additional SSH public keys

Example

For example, you wish to enable the following options for your virtual machine:

  • Forward DNS queries for *.example.com and *.example.org to the 203.0.113.4 and 203.0.113.5 resolvers
  • Forward DNS queries for *.myorg.example.net to the 198.51.100.253 resolver
  • Forward all other queries to the 192.0.2.2 and 192.0.2.3 resolvers
  • Grant access to the private SSH keys associated with public_key1 and public_key2 (through the ccuser account)

To configure the options, create the following JSON object:

{
    "dns-forwarding": [
        {
            "dns-search": ["example.com", "example.org"],
            "dns-servers": ["203.0.113.4", "203.0.113.5"]
        },
        {
            "dns-search": ["myorg.example.net"],
            "dns-servers": ["198.51.100.253"]
        }
    ],
    "dns-default-servers": ["192.0.2.2", "192.0.2.3"],
    "sshkeys": [ "public_key1", "public_key2"]
}

Then, add the object to the metadata section of your virtual machine configuration in the Google Cloud Console with the key collector-userdata.

Procedure

  1. Create a JSON object that includes the options you wish to enable.

    See the previous section for an example JSON object.

  2. In Google Cloud Console, navigate to your virtual machine.

  3. At the bottom of the page, click Edit.

  4. In the Metadata area, click ADD ITEM, and then configure the user data.

    1. In the Key 1 field, add collector-userdata.

    2. In the Value 1 field, paste your JSON object.

  5. At the bottom of the page, click Save.

  6. Reboot the virtual machine.

Next step

Connect to a Collection Zone (Initializing a collector appliance).