Virtual Machine Configuration
Overview
This section covers virtual machine configuration in OpenShift Virtualization, including network initialization, image management, access methods, and placement control.
What You’ll Learn
Learn how to configure and customize virtual machines in OpenShift Virtualization:
-
Static IP configuration using multiple methods (cloud-init, DHCP reservations, guest agent, Sysprep)
-
Cloud-init initialization and troubleshooting
-
Remote access and DNS resolution for VMs
-
Golden images, cloning, and snapshots
-
Boot order, boot sources, and node placement
Prerequisites
Before working with VM configuration, ensure you have:
-
OpenShift 4.18+ with OpenShift Virtualization operator installed
-
Basic understanding of virtual machines and networking
-
Familiarity with YAML syntax
-
CLI tools installed:
oc,virtctl,kubectl
Topics
- Configuring Static IPs for VMs
-
Configure static IP addresses for virtual machines using cloud-init, DHCP reservations, QEMU guest agent, or Sysprep for Windows VMs.
- Cloud-init IP Configuration Troubleshooting Guide
-
Troubleshooting guide for cloud-init IP configuration issues, including diagnostic commands and common problem solutions.
- Internal DNS Resolution for Virtual Machines
-
Configure internal DNS resolution for VM-to-VM and Pod-to-VM communication using Kubernetes Services within the cluster.
- Remote Access to Linux VMs
-
Multiple methods to access Linux virtual machines including console, VNC, SSH via virtctl, NodePort services, port-forwarding, and direct network access.
- Troubleshooting Remote Access to Linux VMs
-
Troubleshooting guide for all VM remote access methods, including diagnostic commands and solutions for common issues.
- Accessing Your Windows 11 VM on Red Hat OpenShift via Remote Desktop
-
Configure external Remote Desktop Protocol (RDP) access to Windows virtual machines using LoadBalancer or NodePort services.
- Creating a Boot Volume from a Local qcow2 Image
-
Import existing qcow2 disk images from local KVM platforms to create boot volumes in OpenShift Virtualization for easy VM migration.
- Creating Custom OS Images and Golden Images
-
Create reusable golden images with pre-configured software and settings for consistent VM deployments across environments.
- Golden Images Troubleshooting Guide
-
Troubleshooting guide for creating and using custom golden images, including verification commands and common issue resolutions.
- Cloning Virtual Machines for Rapid Deployment
-
Clone existing VMs for rapid deployment of identical or customized instances, including cloning across namespaces and post-clone customization with cloud-init.
- Creating and Managing VM Snapshots
-
Create, manage, and restore VM snapshots for quick rollback, safe testing of changes, and pre-maintenance backup points.
- Configuring VM Boot Order and Boot Sources
-
Configure VM boot order, boot sources (PVC, ContainerDisk, HTTP), and boot options including UEFI vs BIOS modes and Secure Boot for different deployment scenarios.
- OpenShift Virtualization Infrastructure Node Placement
-
Control placement of OpenShift Virtualization infrastructure components (virt-controller, virt-api, virt-handler, CDI) using the HyperConverged custom resource for dedicated infrastructure nodes and high availability.
- VM Node Placement with Selectors and Affinity Rules
-
Control VM placement across cluster nodes using node selectors, node affinity, and pod affinity/anti-affinity rules for performance, availability, and workload isolation.
- Hotplugging Volumes and Network Interfaces to Running VMs
-
Dynamically add and remove storage volumes and network interfaces on running VMs using virtctl, with zero downtime.
Related Topics
-
Getting Started - Initial setup and prerequisites
-
Storage Configuration - Persistent storage for VMs
-
Networking Configuration - Network infrastructure setup