VM-based Setup on IBM Cloud
  • 08 Sep 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

VM-based Setup on IBM Cloud

  • Dark
    Light
  • PDF

Article summary

About this Article
This article provides environment setup steps for deploying VSP on IBM Cloud VM. 


Pre-requisites

The pre-requisites for VSP installation:

  1. Virtual Server 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


IBM Cloud - VM Creation

  1. Access the IBM cloud Dashboard: https://cloud.ibm.com using valid credentials
  2. Navigate to VPC Infrastructure > Virtual Server Instances > Create Instance
  3. Provide Instance Name, select Resource Group and add Tags
  4. Select Operating System as RHEL 7.9 and the Version
  5. Select Profile and choose the required Profile entry. Example: mx2-8x64
  6. Select or create SSH keys
  7. In the section Network Interfaces, click on Security Group
  8. Configure Security Groups to allow ports 22, 80 and 443. The snapshot is intended for reference only, since it allows the ports for any source IP Address
  9. Click Create virtual server to launch the Instance
  10. After a successful instance creation, navigate to Virtual Server Instances and search for the newly created instance


Extending /var filesystem

  1. Create a new Virtual Server with an additional drive or add a new drive after creation
    1. Add a new drive at VM creation
    2. Provide the required values. Click CreateThe newly created drive is now listed
  2. Log in into the VM and execute the command below to find the additional drive:
    fdisk -l
    1. Partition the disk using the command:
      fdisk /dev/vdb
    2. Use option ‘n’ to create the partition
    3. Use ‘w’ command to save
    4. Use the commands depicted in the screenshot below:
    5. Press “Enter” to choose default values on sectors
  3. Execute the command below to check the mounted disk:
    lsblk
  4. Execute the below commands to create new /var directory and mount the created partition with /var
    mkfs -t ext4 /dev/vdb1
    mv /var /var2
    mkdir /var
    mount /dev/vdb1 /var
    df -h #For Verification
    mv /var2/* /var/
  5. Create a fstab entry to make this change permanent. Open the file /etc/fstab
    vi /etc/fstab
    1. Add the entry below and save the file
      /dev1/vdb1       /var    ext4     defaults        0 0
    2. Reboot the VM to verify the changes


Installation

  1. Log in to the two newly created machines using SSH
  2. Install Docker and Docker Compose using the commands below:
    sudo su
    subscription-manager repos --enable=rhel-7-server-rpms 
    subscription-manager repos --enable=rhel-7-server-extras-rpms 
    subscription-manager repos --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.2/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/
    
  3. Verification: Execute the commands below to verify the Docker and Docker Compose versions:
    docker version
    docker-compose version
    


Was this article helpful?