Installing Virtual Machines in OpenShift using KubeVirt - Installation Guide - BlueCat Integrity - 26.1.0

VM Installation Guide

ft:locale
en-US
Product name
BlueCat Integrity
Version
26.1.0

Use the KubeVirt virtual shell virtctl and OpenShift CLI openshift-cli to install your BlueCat virtual machine in OpenShift using the command line.

Before you begin, ensure that you have the following:

Additionally, ensure that you have created a project and the relevant VLANs in OpenShift for your VM to use. and .

To install VMs in OpenShift using the command line:
  1. Copy your downloaded tarball and its associated MD5 file to the OpenShift host machine, and check if the archives are OK.
  2. Run the tar -xzvf <integrity_vm_tarball> command to unpackage your virtual machine. The qcow2 file is used to install the virtual machine.
  3. Switch to the project that you would like to deploy your VM in using the following command:
    oc project <project_name>
  4. Upload the VM disk image to a PersistentVolumeClaim (PVC), which will be used as the VM’s storage, using the following command:
    virtctl image-upload pvc <disk_name> \
    --namespace <project_name> \
    --size <disk_size> \
    --storage-class <storage_class_name> \
    --access-mode ReadWriteOnce \
    --force-bind \
    --insecure \
    --image-path ./<path_to_qcow2_image>

    For example

    virtctl image-upload pvc vmname-disk \
    --namespace bluecat \
    --size 160Gi \
    --storage-class lvms-vg1 \
    --access-mode ReadWriteOnce \
    --force-bind \
    --insecure \
    --image-path ./bdds_kvm_26.1.0-XXX.GA.bcn_amd64.qcow2
  5. Create a vm_manifest.yaml file that will be used to configure the VM. The YAML file must be in the following format:
    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: <vmname>
      namespace: <project_name>
    spec:
      instancetype:
        name: u1.medium
      preference:
        name: debian
      runStrategy: Always
      template:
        spec:
          domain:
            devices:
              interfaces:
                - name: eth0
                  model: virtio
                  bridge: {}
            resources: {}
            firmware:
              bootloader:
                bios: {}
          terminationGracePeriodSeconds: 180
          volumes:
            - name: vmname-disk
              persistentVolumeClaim:
                claimName: vmname-disk
            - name: cloudinitdisk 
              cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  bluecat_license:
                      id: <client_id>
                      key: <license_key>
                  bluecat_netconf:
                      ipaddr: "<vm_ip_address>"
                      cidr: "<subnet_cidr>"
                      gateway: "<default_gateway_ip_address>"
                      hostname: "new1.bcn.com"
          networks:
            - name: eth0
              multus:
                networkName: <project_name>/<vlan_name>
    status: {}
  6. Apply the manifest file to the virtual machine and create it using the following command:
    oc apply -f vm_manifest.yaml
This completes the installation of your virtual machine in an OpenShift environment.