1.1. Create a VM

Create your first virtual machine

Creating a virtual machine

In OpenShift’s web console in the menu on the left, navigate to VirtualizationOverview. Make sure your project is active:

Project dropdown

It’s still pretty empty here and a lot of zeroes look at us. However, we are going to change this.

Task 1.1.1: Create your first virtual machine

Open the VirtualMachines menu entry. Click on Create VirtualMachine and choose From template.

On the left of the view that just opened, click on User templates and choose the Cirros VM template.

VirtualMachine creation

Have a quick look at the provided info in the view that just opened.

Change the following details:

  • Set your VM’s name to lab01-firstvm
  • At the bottom, make sure the option to Start this VirtualMachine after creation is disabled

Finally, click on Quick create VirtualMachine.

You just created your first VM on OpenShift (at least during this lab)! You’re now presented with a details view showing different info such as the VM’s name, status or its resource utilization.

Task 1.1.2: Review the VirtualMachine manifest

In your VM’s details view, click on YAML. Have a look at your VM’s definition we got from instantiating the CirrOS template. This is basically the minimum definition you need to create a virtual machine.

Also notice the volumes section under .spec.template.spec:

spec:
  template:
    spec:
      [...]
      volumes:
        - name: containerdisk
          containerDisk:
            image: quay.io/kubevirt/cirros-container-disk-demo

The use of a container disk will become relevant later.