Deploying the migrated virtual machine

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

  1. Deploy the VM by using the OpenShift Virtualization web console.
    1. Navigate to Virtualization > VirtualMachines in the Red Hat OpenShift web console.
    2. Click Create VirtualMachine.
    3. Select From bootable volume.
    4. Choose the bootable volume (DataSource) created in the previous phase.
    5. 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
    6. Click Create VirtualMachine.
    7. Start the VM by clicking Start.
  2. 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
  3. Verify that the VM is running by running the following command:
    oc get vm -n namespace

    Example output:

    NAME                  AGE   STATUS    READY
    migrated-zvm-guest    2m    Running   True
  4. Access the VM console to verify successful boot.

    Using the web console:

    1. Navigate to the VM details page
    2. Click the Console tab
    3. 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.