VM-based Setup on GCP
  • 26 Oct 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

VM-based Setup on GCP

  • Dark
    Light
  • PDF

Article summary

About this Article
This article provides environment setup steps for deploying VSP on Google Cloud Platform (GCP) VM.


Pre-requisites

Two VM instances are required for VSP – one for VSP CMS and (Optional - Remote AE only) one for VSP AE.

The pre-requisites for VSP installation:

  1. VM instance with:
    1. Docker
    2. Docker Compose
    3. Network Security Group with the list of ports utilized by VSP components. Refer to the VM article for information on the ports


Firewall Creation for VM

  1. Access GCP Dashboard and search for the term “Firewall” and Click the Firewall
  2. Click CREATE FIREWALL RULE
  3. Provide the below information:
    1. Name: SSH-firewall 
    2. Description: SSH-firewall that allows SSH and required ports to the Virtual Machine
    3. Direction Of Traffic: Ingress
    4. Action On Match: Allow
    5. Targets: Choose Specified Target Tags
    6. Target Tags: SSH-firewall
    7. Source Ipv4 ranges: 0.0.0.0/0
    8. Protocols and Ports: Select the the tcp box and provide the value: 22,80,443,55555,9092
  4. Click SAVE to create a new firewall


GCP Machine Creation

  1. On the GCP console, search for “VM”. Click CREATE INSTANCE
  2. Provide the below information:
    1. Name: docker-compose
    2. Region: us-west-1
    3. Zone: us-west-1a
    4. Machine family:Select the below option according to the CMS Deployment Type:
      1. Large: e2-standard-16 (16vcpu, 64Gb Memory)
      2. Small: e2-standard-8 (8vcpu, 32Gb Memory)
    5. Service Accounts: Compute Engine Default service account
    6. Access Scopes: Allow full access to all cloud APIs
  3. Click CHANGE under Boot disk
  4. Provide the required information. Click SELECT
  5. Select Service Account and the option Allow full access to all Cloud APIs. Click CREATE to create a new VM


SSH Keys Creation in MobaXterm

  1. In the MobaXterm Software, navigate to Tools > MobaKeyGen and Click Generate
  2. Private and public SSH keys are generated after some time
  3. Provide a valid name in the key comment. Save both the public and private keys in the local machine These keys are utilized for authentication into the machines
  4. Copy the saved public key. On the Google VM Instances Console, modify the instance as described below:
    1. Select the newly created instance and click EDIT
    2. In the Network Tags, provide the Firewall tag created in Section 0. This ensures that the required ports are accessible to the machines
    3. Click Add Item and provide the copied public key into the two VMs. Save the provided information
    4. Copy the Key value from the SSH-key generator pop-up window. Provide the copied value to SSH-keys. Click SAVE
      NOTE

      To enable custom ports for network security, click Networking and add the inbound port rule so that the VM allows inbound traffic for specified ports.

      On the MobaXterm window navigate to Tools > MobaKeyGen if the SSH Key Generator window is closed. Click Load and browse the local system location of the saved private key. The public key is displayed once the loading is complete.


  5. Open a new session once the information is saved
  6. Provide the public IP Address, username and your private key
    1. For the public IP Address, provide IP Address from VM Instances console
    2. For the private key, browse the local system location of the saved private key
  7. If all the SSH options are configured correctly, log in to the VM is successful


Installation

  1. Log in to the two newly created machines using SSH and install Docker and Docker Compose using the commands below:
    sudo su
    subscription-manager register --username <username> --password <password> --auto-attach  #Register the machine with the Red Hat subscription to download dependencies
    yum update
    subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-optional-rpms
    sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    sudo yum install docker-ce 
    sudo systemctl enable --now docker.service
    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.x/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    mv /usr/local/bin/docker-compose /usr/bin/
    
  2. Verification: Execute the commands below to verify the Docker and Docker Compose versions:
    docker version
    docker-compose version
    


Was this article helpful?