5.5.1 IDIH Deployment on KVM with RAW Images

Perform the following procedure to set up the VMs (Virtual Machine):

  1. Log in to KVM host machine.
  2. Navigate to a directory where enough space is available.
  3. Create empty qcow2 image files for MySQL, Kafka, and services, assigning 120GB of disk space to each file.
    1. qemu-img create -f qcow2 idih-mysql.qcow2 120G
    2. qemu-img create -f qcow2 idih-kafka.qcow2 120G
    3. qemu-img create -f qcow2 idih-service.qcow2 120G
  4. Copy the OracleLinux-R8-U9-x86_64-dvd.iso file to host machine.
  5. Create MySQL VM, Kafka VM, and Service VM by running the following commands on host machine.
    virt-install \
      --name idih-mysql \
      --ram 16384 \
      --vcpus 12 \
      --disk path=idih-mysql.qcow2,size=120,format=qcow2 \
      --os-type linux \
      --os-variant ol8.0 \
      --network network=default \
      --graphics none \
      --location OracleLinux-R8-U9-x86_64-dvd.iso \
      --extra-args 'console=ttyS0'
      
      virt-install \
      --name idih-kafka \
      --ram 16384 \
      --vcpus 12 \
      --disk path=idih-kafka.qcow2,size=120,format=qcow2 \
      --os-type linux \
      --os-variant ol8.0 \
      --network network=default \
      --graphics none \
      --location OracleLinux-R8-U9-x86_64-dvd.iso \
      --extra-args 'console=ttyS0'
      
        virt-install \
      --name idih-service \
      --ram 16384 \
      --vcpus 12 \
      --disk path=idih-service.qcow2,size=120,format=qcow2 \
      --os-type linux \
      --os-variant ol8.0 \
      --network network=default \
      --graphics none \
      --location OracleLinux-R8-U9-x86_64-dvd.iso \
      --extra-args 'console=ttyS0'

    Note:

    The installation process is interactive, and the user must complete all the steps marked with [ ! ] by selecting the options one at a time.

    Figure 5-2 Installation


    Installation

  6. Select a source type from the following installation sources:
    • CD/DVD
    • Local ISO file
    • Network

    Figure 5-3 Installation Source


    Installation Source

  7. Select a device containing the ISO file. After selection of ISO file, the installation process initiates.

    Figure 5-4 ISO File


    ISO File

  8. Wait for the processing to complete. Press "r" to refresh and check if step 3 is completed before proceeding to step 4.

    Figure 5-5 Installation process


    Installation

  9. Select a software from the following base environment.
    1. Server with GUI
    2. Server
    3. Minimal Install
    4. Workstation
    5. Custom Operating System
    6. Virtualization Host

    Figure 5-6 Software Selection


    Software Selection

  10. Select Additional Software for the selected environment:

    Figure 5-7 Additional Software


    Additional Software

  11. Wait a moment for the processing to complete, then press "r" to refresh and confirm that step 4 is marked as complete.

    Figure 5-8 Installation


    Installation

  12. Proceed with the next steps, and once all the steps are marked with [x], press "b" to start the installation.

    Figure 5-9 Installation


    Installation

    Installation Destination is selected during the probing storage.

    Figure 5-10 Probing storage


    Probing storage

  13. For partitioning options, select the space to be used for the install target or manually assign mount points.

    Figure 5-11 Partitioning Options


    Partitioning Options

  14. Select a Partition Scheme Configuration from the following options:
    1. Standard Partition
    2. LVM
    3. LVM Thin Provisioning

    Figure 5-12 Partitioning Scheme Options


    Partitioning Scheme Options

  15. Set a strong password for the root user and confirm.

    Figure 5-13 Set password for root user


    Set password for root user

    After selection of the password, the installation procedure initiates.

    Figure 5-14 Begin Installation


    Begin Installation

    Writing network configuration in progress.

    Figure 5-15 Writing network configuration


    Writing network configuration

  16. Press Enter Key to quit.
  17. User must add 3 network interfaces for each VM, xmi, imi, and xsi. Shut down the VM and follow the following steps if you encounter a "No PCI slots available" error while adding any interface.

    Note:

    This step is optional, user must add controller only if they encounter "No PCI slots available"error while adding an interface.
  18. Run the following command to add the controller:
    virsh edit <vm-name> and add below controller after index=7
    
    <controller type='pci' index='8' model='pcie-root-port'>
          <model name='pcie-root-port'/>
          <target chassis='8' port='0xf'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x7'/>
    </controller>
    
  19. Turn on the VM after controller is added.
  20. Log in to the host machine with a valid username and password.

    Figure 5-16 Login Page


    Login Page

    After signing in, the system will automatically open the Overview page.

    Figure 5-17 Overview


    Overview

  21. Click Virtual machines and search for the idih-mysql VM. Go to Network interfaces section, click Add Network Interface, select value as shown in the following screenshot, and click Add.

    Figure 5-18 Add Virtual Network Interface


    Add Virtual Network Interface

  22. Apply the same process to the IMI and XSI interfaces. The following screenshot displays all the interfaces.

    Figure 5-19 Interfaces


    Interfaces

  23. Log in to the VM through CLI. You can change the hostname of the VM by editing the following command. Provide a name of your preference.
    - vi /etc/hostname
  24. Assign a valid IP address for all the three interfaces for the three VMs created.
  25. Run ifconfig command and take a note of device names -enp1s0, enp7s0, and enp8s0. Here, enp1s0 represents xmi, enp7s0 represents imi, and enp8s0 represents xsi.
  26. Run the following command, it will display the status as "disconnected" for all the interfaces.
    nmcli dev status
  27. To assign an IP addresss to enp1s0, run the following command:
    nmcli con edit enp1s0
    If you get an error, then most likely the device is not up. You can bring it up by running the following command:
    nmcli dev up enp1s0
    .
  28. After the device is up, re-run the following command. Prompt must be visible as shown in the below screenshot:
    nmcli con edit enp1s0. nmcli

    Figure 5-20 Prompt


    Prompt

    1. Perform the following steps to assign the IP address to enp1s0:
      1. Set ipv4.addresses <ip-address>
      2. set ipv4.gateway <gateway-ip>
      3. Save and quit.
    2. You can type print in nmcli prompt to verify the assigned IP.
    3. Apply the same steps for enp7s0 and enp8s0 interfaces.
  29. Ensure that onboot=yes in the following /etc/sysconfig/network-scripts/ifcfg-enp1s0 ile.
  30. Run the following command to check the local time zone.
    timedatectl
    If it's not GMT, change it to GMT by running the following command
    timedatectl set-timezone
  31. Restart the VM and check if IP addresses are assigned with help of ifconfig command. Also, verify that local time zone is now set to GMT by running the following command:
    timedatectl
    .

    Figure 5-21 Local Time Verification


    Local Time Verification

  32. Repeat steps 8 to 13 for IDIH Kafka and IDIH Service VMs.
  33. Ensure that you are able to reach the IMI IPs of Mysql VM and Kafka VM from Service VM.

Installation Package Download and Extraction

The installation TAR file can be downloaded on any of the three VMs. After downloaded, extract (untar) the TAR file.

Directory Structure

After extraction, the directory structure will appear as follows:

Figure 5-22 Directory Structure


Directory Structure

Deployment of Components Across VMs

Distribute the extracted directories to their respective VMs as follows:

  • Copy the MySql directory to the MySQL VM at any preferred location.
  • Copy the Kafka directory to the Kafka VM at any preferred location.
  • Copy the Services directory to the Services VM at any preferred location.

MySQL Setup

Perform the following steps to set up MySQL on the MySQL VM:

  1. Access the MySQL VM:
    1. Log in to MySQL VM.
    2. Navigate to the path where MySql directory was copied.
  2. Run the MySQL Setup Script:
    1. Move inside the MySql directory.
    2. Locate the setup-mysql.sh script.

      Note:

      Ensure the line sudo restorecon -v/etc/my.cnf is commented out if it appears in the script.
    3. Run the script using the following command:
      ./setup-mysql.sh
  3. Configuration During Execution:
    1. The script will prompt for an IP address to be configured as the MySQL bind address.
    2. Enter the IMI IP of the MySQL VM when prompted.
  4. Completion: After the script is complete, MySQL will be successfully set up on the VM.
  5. Post installation steps:
    1. Connect to the MySQL through SSH.
    2. Run the following command:
      sudo restorecon -v /etc/my.cnf
    3. To create the swap file run the following commands:
      
      sudo fallocate -l 12G /swapfile
      sudo chmod 600 /swapfile
      sudo mkswap /swapfile
      sudo swapon /swapfile
      echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
      
    4. To edit the mysqld service file run the following command:
      systemctl edit mysqld
    5. paste the below content and save it,
      
      [Service]
      MemoryMax=11G
      [mysqld]
      default_time_zone = 'GMT'
      
  6. To restart the MySQL service, run the following command:
    systemctl restart mysqld

Kafka Setup

Perform the following stepsto set up Kafka on the Kafka VM:

  1. Access the Kafka VM:
    1. Log in to Kafka VM.
    2. Navigate to the path where Kafka directory was copied.
  2. Run the Kafka Setup Script:
    1. Move inside the Kafka directory.
    2. Locate the setup-kafka.sh script.
    3. Run the script using the following command:
      ./setup-kafka.sh
  3. Configuration During Execution
    1. The script will prompt for the Kafka IMI IP.
      1. Enter the IMI IP of the Kafka VM when prompted.
    2. The script will then prompt for the Kafka XSI IP.
      1. Enter the XSI IP of the Kafka VM.
    3. Kafka and Kraft services will be initiated on the specified IPs.
  4. Completion: After the successful health check is completed, Kafka will be fully set up on the VM.
  5. This is an optional step. Follow the instructions in this step only if you need to use Kafka XMI IP instead of the default Kafka IMI IP for communication with DSR.
    1. Uncomment advertised.listeners=INTERNAL_PLAINTEXT://192.168.1.237:9092,INTERNAL_SSL://192.168.1.237:9093,EXTERNAL://[kafka_xmi]:9094 line in broker.properties file(path: /opt/kafka/config) and replace [kafka_xmi] with Kafka XMI IP.
    2. Comment advertised.listeners=INTERNAL_PLAINTEXT://192.168.1.237:9092,INTERNAL_SSL://192.168.1.237:9093, EXTERNAL://10.196.84.46:9094 line.
    3. Run the below commands to restart Kraft and Kafka services:
      
      systemctl restart kraft-controller
      systemctl restart kafka

Service Setup

Perform the following steps to set up the services on the Service VM:

  1. Access the Service VM:
    1. Log in to the Service VM.
    2. Navigate to the directory where setup-service.sh script is located.
  2. Move the store Directory
    1. Before running the setup script, move the store directory to the /opt/ path using the following command:
      mv store /opt/
  3. Run the Service Setup Script:
    1. Run the script using the below command:
      ./setup-service.sh
  4. Perform the following configuration during execution:
    1. The script will prompt for several inputs during execution:
      1. Service IMI IP: Enter the IMI IP of the Service VM.
      2. Service XMI IP: Enter the XMI IP of the Service VM.
      3. Kafka IMI IP: Enter the IMI IP of the Kafka VM (configured in previous steps).
      4. MySQL IMI IP: Enter the IMI IP of the MySQL VM (configured in previous steps).
    2. After these inputs are provided, the script will start the required services and proceed with the health check.

      You can ignore the following error as this will be addressed in next section:

      [ERROR] <timestamp> - Reached retry limit. Aborting
  5. Perform the following procedure post installation and UI access:
    1. Run podman ps -a . You will notice that nfconfig service would have exited.
    2. Log in to service VM and open cnidih_VM.yaml file.
    3. <Replace with SOAM VIP> must be replaced with a valid active SOAM IP. Save and exit.
    4. Navigate to Protrace section and enable the following property NFCONFIG_CLIENT_ENABLED to true.
    5. Run the following commands:
      podman rm -f --all
      docker-compose -f cnidih_VM.yaml up -d
    6. Verify that all services are up and running using the following command podman ps -a.
    7. After all services are running, you can access the UI at: https://<SERVICE XMI IP>.

    Completion

    This completes the setup for MySQL, Kafka, and Services. The deployment is now ready for use.