To deploy an NSP RHEL qcow2 disk image

Purpose

Perform this procedure to deploy a qcow2 disk image on a station that is to host NSP software.

Note: A leading # symbol in a command represents the root user prompt, and is not to be included in the command.

Steps
Check host station OS compatibility
 

Check the NSP Release Notice to ensure that the OS version of the host station supports the creation of VMs at the RHEL version that the NSP requires.


Log in to the VM host station as the root user.


If the host station OS version supports NSP VM creation, enter the following; otherwise, update the host OS version as required:

osinfo-query os | grep rhel | grep -v - ↵

A list of supported RHEL variants is listed, for example:

rhel7.8 | Red Hat Enterprise Linux 7.8 | 7.8 | http://redhat.com/rhel/7.8

rhel7.9 | Red Hat Enterprise Linux 7.9 | 7.9 | http://redhat.com/rhel/7.9

rhel8.0 | Red Hat Enterprise Linux 8.0 | 8.0 | http://redhat.com/rhel/8.0

rhel8.1 | Red Hat Enterprise Linux 8.1 | 8.1 | http://redhat.com/rhel/8.1

rhel8.2 | Red Hat Enterprise Linux 8.2 | 8.2 | http://redhat.com/rhel/8.2


Record the appropriate RHEL version number in the left column, which is one of the following:

  • the version that matches the NSP-supported RHEL version, if listed

  • the version that is less than but closest to the supported NSP RHEL version; in the output example, the version to record is 8.2, as the NSP supports a higher RHEL version that is not listed


Prepare required images
 

Log in to the host station as the root user.


Download one of the following files from the NSP downloads page in the OEM_Images subdirectory on the Nokia Support portal to a local directory on the station:

  • NSP_K8S_PLATFORM_RHEL8_yy_mm.qcow2—for NSP deployer host or NSP cluster VM

  • NSP_RHEL8_yy_mm.qcow2—for components outside the NSP cluster, such as an NSP auxiliary databases, and NFM-P components

where yy_mm represents the year and month of issue


Open a console window.


Enter the following:

dnf -y install virt-install libguestfs-tools ↵


For each VM that you require, enter the following to create a raw VM disk image file:

qemu-img convert -f qcow2 qcow2_file -O raw -S 0 raw_image.img ↵

where

qcow2_file is the name of the downloaded qcow2 file

raw_image is the name that you want to assign to the image; for example, NSP_Server_A


10 

Perform one of the following:

  1. If you want only one disk to contain all OS, product software, and data files on a VM, you must resize the VM disk image in accordance with the response to your Platform Sizing Request.

    For each one-disk VM that you require, enter the following:

    qemu-img resize -f raw "raw_image.img" sizeG ↵

    where

    raw_image is the raw disk image name specified in Step 9

    size is the required disk size, in GBytes

  2. If you want more than one disk in a VM, for example, one for the OS, and one for all NSP component software and data, or separate disks for specific partitions, you must create a separate raw image for each required disk. The disk size must be in accordance with the response to your Platform Sizing Request.

    For each separate disk image that you require, enter the following:

    qemu-img create -f raw "raw_image.img" sizeG ↵

    where

    raw_image is the name that you want to assign to the disk image; for example, NSP_Server_A_Complete, for an image that is to contain all NSP component server partitions, or NSP_Server_A_Software, for an image that is to contain only the /opt/nsp partition

    size is the required disk size, in GBytes


11 

The raw image files that you create in Step 10 are in sparse format; you must convert the image to non-sparse format, which provides optimal disk performance.

Perform the following steps for each raw disk image created in Step 10.

  1. Enter the following:

    cp --sparse=never raw_image.img non-sparse_image.img ↵

    raw_image is the name of a raw disk image created in Step 10

    non-sparse_image is the name to assign to the non-sparse image

    A non-sparse_image.img file is created.

  2. Delete the raw_image.img file, which is no longer required.


Deploy VMs
 
12 

Enter the following once for each VM to deploy the VM:

Note: One “--network bridge=bridge_name” entry is required for each VM interface that you intend to configure.

virt-install --connect qemu:///system --ram RAM --vcpu=vCPUs -n instance --os-type=linux --os-variant=variant --disk path="image_name", device=disk,bus=virtio,format=raw,io=native,cache=none --network bridge=bridge_name --import & ↵

where

RAM is the required amount of VM RAM in the response to your Platform Sizing Request, in MBytes; for example, 64 GBytes is expressed as 65536, which is 64 x 1024 MBytes

vCPUs is the required number of vCPU threads in the response to your Platform Sizing Request

instance is the name to assign to the VM

variant is the OS version recorded in Step 4, for example, 8.2

image_name is the name of the raw or non-sparse disk image created for the VM

bridge_name is the name of the network bridge for a VM interface


13 

Enter the following to open a console session on the VM:

virsh console VM

where VM is the VM name

You are prompted for credentials.


14 

Enter the following credentials:

  • username—root

  • password—available from technical support

A virtual serial console session opens on the VM.


15 

Configure the RHEL OS as required for the NSP component; for example:

  • Plumb the required IPv4 or IPv6 addresses.

  • Set the hostname.

  • Update the /etc/hosts file.

Note: If an NFM-P system integrated with the NSP uses hostnames, the NSP cluster VMs must be able to resolve each NFM-P hostname using DNS.


16 

Perform one of the following; see Disk partitioning for trial deployments or Disk partitioning for live deployments for component-specific partitioning schemes.

Note: If you are using multiple disks in a VM, you must mount a parent partition before you mount any child partition. For example, you cannot mount the /var/log/audit partition before you mount the /var/log partition.

  1. If you are using only one disk per VM, perform the following steps for each such VM.

    1. Enter the following commands:

      mkdir -p /extra ↵

      mkdir -p /opt/nsp ↵

    2. Use the RHEL fdisk utility to create the required sub-disks for the following directories:

      • /extra

      • /opt/nsp

      For each directory, enter the following and then respond to the prompts; use the directory size value from the response to your Platform Sizing Request:

      fdisk /dev/virtual_device

      where virtual_device is the virtual device name, for example, vda in a KVM VM

    3. Enter the following to reboot the VM:

      systemctl reboot ↵

    4. After the reboot, perform one of the following.

      1. If you are using LVM, perform the following steps.

        1. Enter the following sequence of commands for each sub-disk:

        pvcreate /dev/virtual_devicen

        vgcreate vg2 /dev/virtual_devicen

        where

        virtual_device is the virtual device name, for example, vda in a KVM VM

        n is the number associated with the sub-disk

        2. Go to Step 17.

      2. If you are not using LVM, perform the following steps.

        1. Enter the following for each sub-disk:

        mkfs fs_type -L path /dev/devicen

        where

        fs_type is the file system type; see Supported file systems for partition-specific file system support

        path is the directory path associated with the sub-disk, for example, /opt/nsp

        device is the device name, for example, vda in a KVM VM

        n is the device number associated with the sub-disk

        2. Open the /etc/fstab file using a plain-text editor such as vi.

        3. Add one line in the following format for each sub-disk:

        /dev/virtual_devicen  path   fs_type   defaults        0 0

        where

        device is the device name, for example, vda in a KVM VM

        n is the number associated with the sub-disk

        path is the directory path associated with the sub-disk, for example, /opt/nsp

        fs_type is the file system type; see Supported file systems for partition-specific file system support

        4. Save and close the file.

        5. Enter the following:

        mount -a ↵

        6. Go to Step 19.

  2. If you specify multiple disks per VM and are using LVM, enter the following sequence of commands for each disk in each VM:

    pvcreate /dev/device

    vgcreate group /dev/device

    where

    device is the device name for the disk

    group is the name to assign to the volume group, and must be unique in the VM


Configure LVM
 
17 

Create the LVM volumes and partitions.

Perform the following steps for each disk in a VM, beginning with the parent disk partitions.

Note: If you are using multiple disks in a VM, you must mount a parent partition before you mount any child partition. For example, you cannot mount the /opt/nsp/nfmp/nebackup partition before you mount the /opt/nsp partition.

Note: The /extra partition is allocated for use as a temporary storage location for downloaded product software.

  1. Enter the following to create a logical volume:

    lvcreate -n volume -L sizeG group /dev/device

    where

    volume is the name to assign to the logical volume

    size is the required volume size in the response to your Platform Sizing Request

    group is the name to assign to the volume group, and must be unique in the VM

    device is the device name

  2. Enter the following:

    mkdir directory

    where directory is the name of the directory to associate with the volume, for example, /opt/nsp

  3. Enter the following:

    mkfs fs_type -L directory /dev/group/volume

    where

    fs_type is the file system type; see Supported file systems for partition-specific file system support

    directory is the directory associated with the volume

    group is the volume group

    volume is the logical volume name

  4. Open the /etc/fstab file using a plain-text editor such as vi.

  5. Add an entry in the following format:

    /dev/group/partition directory fs_type noatime   0 0

    where

    group is the volume group

    partition is the partition name

    directory is the associated directory path

    fs_type is the file system type; see Supported file systems for partition-specific file system support

  6. Save and close the file.

  7. Enter the following:

    mount -a ↵


Perform optional security hardening
 
18 

Optionally, for greater system security, you can remove the world permissions from RHEL compiler executable files, as described in Resetting GCC-compiler file permissions.


19 

Close the open console windows.

End of steps