Post-migration tasks

Optional tasks to optimize and configure the migrated virtual machine for production use in Red Hat OpenShift Virtualization.

Before you begin

Ensure that you have:

  • A running virtual machine in OpenShift Virtualization
  • Access to the VM console or SSH connectivity
  • Root access to the VM

About this task

These post-migration tasks are optional and depend on your environment and requirements. They help optimize the VM for OpenShift Virtualization and enable additional features.

Procedure

  1. Connect to the VM by running the following command:
    virtctl console vm_name -n namespace
  2. Install the QEMU guest agent by running the following commands:
    yum install -y qemu-guest-agent
    systemctl enable --now qemu-guest-agent

    The guest agent provides the following benefits:

    • Accurate reporting of VM IP addresses
    • Graceful shutdown and restart capabilities
    • File system freeze/thaw for consistent snapshots
    • Time synchronization
  3. Configure network access

    If you need to attach a secondary network interface to the VM, you can configure it using NetworkManager:

    1. List available network connections by running the following command:
      nmcli con show

      Example output:

      NAME                UUID                                  TYPE      DEVICE
      Wired connection 1  67152114-3467-3bf2-ad1a-1338eca23a02  ethernet  enc2
      Wired connection 2  8d7d2c21-a9d3-377a-9cea-137072341381  ethernet  enc3
      lo                  350d280d-13b6-4ed2-a0d1-ff683cf45b40  loopback  lo
    2. Configure the secondary network interface with a static IP address by running the following commands:
      nmcli con mod "connection_name" ipv4.method manual
      nmcli con mod "connection_name" ipv4.addresses ip_address/prefix
      nmcli con mod "connection_name" ipv4.gateway gateway_address
      nmcli con up "connection_name"
    3. Verify the network configuration by running the following command:
      ip addr show
  4. Update the system by running the following command:
    yum update -y
    Tip: Consider scheduling system updates during maintenance windows to avoid unexpected downtime.
  5. Configure additional services

    Depending on your requirements, you might need to:

    • Configure firewall rules
    • Set up monitoring agents
    • Configure backup solutions
    • Install application-specific software

Results

The migrated virtual machine is now optimized for production use in OpenShift Virtualization with enhanced monitoring, network connectivity, and system updates applied.