liveBook · Manning

Anthos VM Runtime

As explained in Google Anthos in Action

Anthos VM Runtime is an Anthos capability for running virtual-machine workloads on Kubernetes clusters.

Anthos VM Runtime runs virtual-machine workloads on Anthos on bare metal, allowing VM-based network functions and other workloads to coexist with containerized workloads. It is based on KubeVirt. section 8.3.2

Configure the runtime and its virtual machines by:

  • Enabling the VMRuntime custom resource and verifying VMRuntime.Status.Ready is true. section 8.3.2
  • Selecting hardware virtualization or useEmulation when hardware support is unavailable or uncertain; hardware virtualization performs better. section 8.3.2
  • Choosing raw or qcow2 images: raw may perform better but can consume more disk. section 8.3.2
  • Preparing cloud-init for console access before creating a VM. section 8.3.2

Enable the runtime and create a VM

Set enabled: true in the VMRuntime resource, optionally configure useEmulation and vmImageFormat, then create a VM with kubectl virt create vm, specifying its image, CPU, memory, boot disk, storage class, and cloud-init file. section 8.3.2

apiVersion: vm.cluster.gke.io/v1
kind: VMRuntime
metadata:
name: vmruntime
Spec:
enabled: true
# useEmulation default to false if not set.
useEmulation: true
# vmImageFormat default to "qcow2" if not set.
vmImageFormat: qcow2

Shows the VMRuntime custom resource with enablement, emulation, and image-format settings. section 8.3.2

kubectl virt create vm VM_NAME \
 --boot-disk-access-mode=MODE \
 --boot-disk-size=DISK_SIZE \
 --boot-disk-storage-class="DISK_CLASS" \
 --cloud-init-file=FILE_PATH \
 --cpu=CPU_NUMBER \
 --image=IMAGE_NAME \
 --memory=MEMORY_SIZE

Shows the kubectl virt create vm command and its VM resource options. section 8.3.2

How Google Anthos in Action covers it

How deep it goes
Explains enablement, readiness verification, virtualization choices, image formats, cloud-init, and VM creation, but not VM lifecycle operations.
Examples
Uses a VMRuntime manifest, cloud-init configuration, readiness inspection, and a kubectl virt create vm command.
What it assumes
Assumes Anthos on bare metal and Kubernetes administration, while recommending cloud-init preparation and checking hardware virtualization support.
What you can do after
Operate VM workloads by configuring VMRuntime, preparing cloud-init, creating VMs, and verifying runtime readiness.
How it connects
Connects virtual machines with Kubernetes, KubeVirt, cloud-init, VNFs, and CNFs.

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.