Deploy a virtual machine in Red Hat OpenShift Virtualization by using the bootable
volume that is created from the migrated z/VM disk.
Before you begin
Ensure that you have:
- A bootable volume (PVC) with proper labels and DataSource created
- Access to the OpenShift Virtualization web console or CLI
- Sufficient resources (CPU, memory, storage) available in the cluster
About this task
This phase creates and starts a virtual machine by using the migrated disk as the
boot volume. You can deploy the VM by using either the web console or the CLI.
Procedure
-
Deploy the VM by using the OpenShift Virtualization web console.
-
Navigate to
in the Red Hat OpenShift web console.
-
Click Create VirtualMachine.
-
Select From bootable volume.
-
Choose the bootable volume (DataSource) created in the previous phase.
-
Adjust the VM parameters as needed:
- Name: Provide a name for the VM
- CPU: Set the number of CPU cores
- Memory: Set the amount of memory
- Network: Configure network interfaces
-
Click Create VirtualMachine.
-
Start the VM by clicking Start.
-
Alternatively, deploy the VM by using the CLI.
Create a YAML file for the VirtualMachine resource:
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: vm_name
namespace: namespace
spec:
running: true
template:
metadata:
labels:
kubevirt.io/vm: vm_name
spec:
domain:
cpu:
cores: cpu_cores
devices:
disks:
- disk:
bus: virtio
name: rootdisk
interfaces:
- name: default
masquerade: {}
resources:
requests:
memory: memory_size
networks:
- name: default
pod: {}
volumes:
- name: rootdisk
dataVolume:
name: pvc_name
Apply the YAML file by running the following command:
oc apply -f vm_yaml_file
-
Verify that the VM is running by running the following command:
Example output:
NAME AGE STATUS READY
migrated-zvm-guest 2m Running True
-
Access the VM console to verify successful boot.
Using the web console:
- Navigate to the VM details page
- Click the Console tab
- Verify that the VM boots successfully and displays a login prompt
Using virtctl:
virtctl console vm_name -n namespace
Results
The virtual machine is successfully deployed and running in OpenShift Virtualization, using the disk migrated from z/VM.