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
-
Connect to the VM by running the following command:
virtctl console vm_name -n namespace
-
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
-
Configure network access
If you need to attach a secondary network interface to the VM, you can configure it using
NetworkManager:
-
List available network connections by running the following command:
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
-
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"
-
Verify the network configuration by running the following command:
-
Update the system by running the following command:
Tip: Consider scheduling system updates during maintenance windows to avoid unexpected
downtime.
-
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.