Containers

Install KubeVirt on kubeadm with KubeVirtBMC (vSphere Exit)

Leaving vSphere is mostly a budget decision, but the hard part is technical. Your provisioning tools still expect a hypervisor, a disk format they understand and a power button they can press over the network. KubeVirt answers the first two by running KVM virtual machines as Kubernetes objects, and KubeVirtBMC answers the third by giving every VM its own IPMI and Redfish endpoint.

Original content from computingforgeeks.com - post 200538

This guide shows you how to install KubeVirt on a plain kubeadm cluster, add CDI and virtctl, boot a cloud image, wire up KubeVirtBMC, and import a VMware VMDK. We ran through this on Ubuntu 24.04 with kubeadm 1.36 and KubeVirt 1.10.0 in November 2026 and it works end to end, with one install error you will hit on the first try.

Every command and every line of output below comes from that single node lab. Where the lab tripped over something, the error and the fix sit right next to the step that caused it. Why build on kubeadm and not a packaged distribution? Because kubeadm hides nothing, so every fix here carries over to whatever cluster you run later.

What KubeVirt replaces in a vSphere estate

KubeVirt is not a drop-in ESXi. It is a set of controllers that teach Kubernetes to schedule a VM the way it schedules a pod, so the pieces you know from vCenter map onto Kubernetes objects instead of a separate management plane. The table lines them up so you can see which parts carry over and which ones you have to build.

vSphere pieceKubeVirt equivalentNotes
ESXi hostWorker node running virt-handlerNeeds /dev/kvm; nested works for a lab
vCenterkube-apiserver plus virt-controllerVMs are VirtualMachine objects
Datastore and VMDKStorageClass and PVCCDI converts disks to raw on import
VM templatesdataVolumeTemplates, instancetypesCloud images plus cloud-init
vMotionVirtualMachineInstanceMigrationNeeds 2+ workers and RWX storage
OVA import, HCXCDI upload, ForkliftForklift ships as MTV on OpenShift
Host BMC (iDRAC, iLO)KubeVirtBMC per VMIPMI and Redfish for provisioning tools

Live migration is the row that catches people. Our lab is one node with node-local storage, so a VM can only ever run where its disk lives, and a node drain means downtime for every guest on it. To get vMotion behaviour you need at least two schedulable workers and a StorageClass that offers ReadWriteMany volumes, such as Ceph RBD or a shared NFS CSI driver. If you are still weighing hypervisors in general, our ESXi vs Proxmox comparison covers the other common exit path.

How the pieces fit together

The diagram below is the lab as built. Clients talk IPMI or Redfish to a per-VM Service that the KubeVirtBMC controller creates, that Service drives the VM through the KubeVirt API, and CDI turns an exported VMware disk into a PVC that a new VM boots from.

KubeVirt and KubeVirtBMC on kubeadm architecture diagram: ipmitool and curl reach the ubuntu-vm01-virtbmc Service, which powers KubeVirt VMs, while CDI imports a VMware VMDK into a PVC

Everything inside the box runs on a single kubeadm node called homelab-kubevirt. In a real cluster the BMC Service and CDI importer pods land wherever the scheduler puts them, which is why the BMC address is a Service name and never a node IP. That one detail decides how you register machines in Ironic, MAAS or any other provisioning tool, so keep it in mind through Steps 6 to 9. The VM disk follows the same logic, because it is a PVC bound to whatever storage backend the StorageClass names.

Lab and prerequisites

Our lab node was a cloud VM with nested virtualization switched on: 8 vCPUs, 32 GB of RAM and a 100 GB disk, running Ubuntu 24.04. Treat that as a floor for following along. It comfortably held two 2 vCPU guests plus the KubeVirt, CDI, cert-manager and KubeVirtBMC control pods with room to spare. Smaller boxes work for the install itself, but CDI creates a scratch PVC about the size of the target disk during many imports (our 10 GiB import used an 11 GB scratch volume next to the 11 GB disk), so small root disks fill up quickly.

  • Hardware virtualization exposed to the node (/dev/kvm present)
  • A fresh Ubuntu 24.04 host with swap off
  • Outbound HTTPS to GitHub, pkgs.k8s.io and cloud-images.ubuntu.com
  • An SSH key pair on the node for cloud-init (ssh-keygen -t ed25519)

Production sizing is driven by the guests, not by KubeVirt. Add up the vCPU and RAM of the VMs you plan to move, decide on an overcommit ratio, then add roughly 2 vCPUs and 4 GB per node for the virt and CDI daemons. Teams leaving a small vSphere cluster typically land on three control plane nodes plus three or more workers with 32 to 64 cores and 256 to 512 GB each, backed by shared RWX storage so live migration works.

On a lab box, confirm the KVM device exists before you install anything. If you are nesting inside your own KVM host, our nested virtualization guide shows how to expose it.

ls -l /dev/kvm
grep -cw vmx /proc/cpuinfo

A character device owned by the kvm group and a non-zero vmx count mean the hardware side is ready.

crw-rw---- 1 root kvm 10, 232 Nov 30 18:39 /dev/kvm
16

On AMD hosts grep for svm instead. A zero here means virt-handler will never advertise KVM, so every VM sits in Scheduling with no obvious error on the VM object itself. On a cloud VM that usually means nested virtualization was not enabled when the instance was created, and most providers only let you change it while the instance is stopped.

Step 1: Prepare the node and install kubeadm

kubeadm names the node after the host, and later steps query the node by name, so set the hostname first. We used homelab-kubevirt; pick your own and use it wherever that name appears below.

sudo hostnamectl set-hostname homelab-kubevirt
echo "127.0.1.1 homelab-kubevirt" | sudo tee -a /etc/hosts

By default the kubelet refuses to start with swap on, and a stock Ubuntu server install creates /swap.img. Our cloud image had no swap, but if swapon --show prints anything on your host, turn it off now and keep it off across reboots.

sudo swapoff -a
sudo sed -i '/\sswap\s/ s/^/#/' /etc/fstab

Kubernetes needs the overlay and br_netfilter modules plus IP forwarding. Load them now and persist them so a reboot does not quietly break pod networking.

printf "overlay\nbr_netfilter\n" | sudo tee /etc/modules-load.d/k8s.conf
sudo modprobe overlay
sudo modprobe br_netfilter
printf "net.bridge.bridge-nf-call-iptables = 1\nnet.bridge.bridge-nf-call-ip6tables = 1\nnet.ipv4.ip_forward = 1\n" | sudo tee /etc/sysctl.d/k8s.conf
sudo sysctl --system

Next install containerd from the Ubuntu archive along with the tools the Kubernetes repository needs.

sudo apt-get update
sudo apt-get install -y containerd apt-transport-https ca-certificates curl gpg
containerd --version

The noble package shipped containerd 2.2.1 for us.

containerd github.com/containerd/containerd/v2 2.2.1

The kubelet expects the systemd cgroup driver, and the Ubuntu package already writes a config file with it set to false. If the two disagree, the kubelet and containerd fight over cgroups and static pods restart in a loop a few minutes after kubeadm init, so flip it and restart before you go further.

sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
sudo systemctl restart containerd
grep -n SystemdCgroup /etc/containerd/config.toml

One match set to true is what you want to see.

109:            SystemdCgroup = true

If grep prints nothing, the file does not exist yet. Generate it with containerd config default | sudo tee /etc/containerd/config.toml and run the sed again. Now add the Kubernetes package repository. The minor version lives in the repository path, so it goes into a variable. We stay on 1.36 even though a newer minor exists, because KubeVirt 1.10.0 is built on the Kubernetes 1.36 libraries, and 1.36 is the newest version the KubeVirt support matrix lists.

export K8S_MINOR="v1.36" # pin: tested minor #https://kubernetes.io/releases/
curl -fsSL https://pkgs.k8s.io/core:/stable:/${K8S_MINOR}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/${K8S_MINOR}/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list

Install the three packages and hold them, so an unattended upgrade never bumps the kubelet past the control plane.

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
kubeadm version -o short

The repository handed us the latest patch in the 1.36 line.

v1.36.7

Initialise the control plane. The pod CIDR matches Calico’s default, which saves you editing its manifest later. Check that it does not overlap your office or datacenter ranges, because guests on the masquerade network reach the outside through the pod network, and an overlap makes some of your real subnets unreachable from every VM. Changing the pod CIDR after the fact means rebuilding the cluster, so it is worth thirty seconds now.

sudo kubeadm init --pod-network-cidr=192.168.0.0/16

The tail of the output confirms the control plane is up and prints a join command for workers (token redacted here):

[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!
...
kubeadm join 10.0.1.50:6443 --token xxxxxx.xxxxxxxxxxxxxxxx \
	--discovery-token-ca-cert-hash sha256:<hash>

Keep that join line if you plan to add workers for live migration later. The token expires after 24 hours, and kubeadm token create --print-join-command mints a fresh one.

Step 2: Add Calico and a default StorageClass

Copy the admin kubeconfig to your user, apply Calico, and remove the control plane taint so VMs can schedule on this single node.

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export CALICO_VERSION="v3.33.1" # pin: tested release #https://github.com/projectcalico/calico/releases
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/calico.yaml
kubectl taint nodes --all node-role.kubernetes.io/control-plane-

Give Calico a minute or two, then check the node and the system pods.

kubectl get nodes -o wide
kubectl get pods -A

Within two minutes the node turned Ready and every system pod was running.

NAME               STATUS   ROLES           AGE    VERSION   INTERNAL-IP     EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION           CONTAINER-RUNTIME
homelab-kubevirt   Ready    control-plane   101s   v1.36.7   10.0.1.50   <none>        Ubuntu 24.04.5 LTS   7.0.0-1018-gcp (amd64)   containerd://2.2.1

KubeVirt disks are PVCs, so the cluster needs a default StorageClass before the first VM. The Rancher local-path provisioner is the smallest option for one node.

export LP_VERSION="v0.0.37" # pin: tested release #https://github.com/rancher/local-path-provisioner/releases
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/${LP_VERSION}/deploy/local-path-storage.yaml
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
kubectl get storageclass

Note the binding mode in the output, because it matters again in Step 10.

NAME                   PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
local-path (default)   rancher.io/local-path   Delete          WaitForFirstConsumer   false                  1s

Local-path volumes are ReadWriteOnce and pinned to the node, which rules out live migration. WaitForFirstConsumer also means a PVC stays unbound until a pod needs it, so CDI has to be told when to bind a disk that no VM uses yet. That is fine for learning the workflow; swap in a shared CSI driver before you move real workloads.

Step 3: Install the KubeVirt operator and CR

Every older guide, including our own KubeVirt on Minikube walkthrough, installs the operator with a plain kubectl apply. On KubeVirt 1.10 that fails, and this is what the client-side apply did on our node.

deployment.apps/virt-operator created
The CustomResourceDefinition "kubevirts.kubevirt.io" is invalid: metadata.annotations: Too long: may not be more than 262144 bytes

Client-side apply stores the whole object in the last-applied-configuration annotation, and the 1.10 KubeVirt CRD is now bigger than the 256 KiB annotation limit. The nasty part is that the rest of the manifest went in, so you are left with a half-installed operator that looks alive in kubectl get deploy.

kubectl apply of the KubeVirt operator failing with metadata.annotations Too long and virt-operator stuck at 0/2

The CRD is missing and virt-operator sits at 0/2 because it has nothing to watch. The KubeVirt 1.10.0 release notes call this out and switch the documented install to server-side apply, which keeps field ownership on the API server instead of in an annotation. Set the version once.

export KV_VERSION="v1.10.0" # pin: tested release #https://github.com/kubevirt/kubevirt/releases

On a clean cluster, this is the only operator install command you need.

kubectl apply --server-side -f https://github.com/kubevirt/kubevirt/releases/download/${KV_VERSION}/kubevirt-operator.yaml

Because our first attempt had already created the virt-operator Deployment with client-side apply, the server-side run created the CRD but refused to take over the Deployment.

customresourcedefinition.apiextensions.k8s.io/kubevirts.kubevirt.io serverside-applied
error: Apply failed with 1 conflict: conflict with "kubectl-client-side-apply" using apps/v1: .spec.template.spec.containers[name="virt-operator"].env[name="WATCH_NAMESPACE"].valueFrom.fieldRef

Adding --force-conflicts tells the API server to hand field ownership to the server-side manager. It is safe here because both managers are writing the same manifest. On a cluster where someone hand-edited the operator Deployment, read the conflict list first, because forcing it throws those edits away.

kubectl apply --server-side --force-conflicts -f https://github.com/kubevirt/kubevirt/releases/download/${KV_VERSION}/kubevirt-operator.yaml

Now apply the KubeVirt custom resource, which tells the operator to deploy the rest of the stack.

kubectl apply --server-side -f https://github.com/kubevirt/kubevirt/releases/download/${KV_VERSION}/kubevirt-cr.yaml

Wait for the Available condition and time it, because this is the slowest part of the install.

time kubectl -n kubevirt wait kv kubevirt --for condition=Available --timeout=15m
kubectl -n kubevirt get pods

It took 1 minute 41 seconds on our node, most of it pulling images.

KubeVirt operator server-side applied, KubeVirt CR Available after 1m41s and all virt pods Running on kubeadm

Note virt-template-apiserver and virt-template-controller in that list; older KubeVirt tutorials will not show them. The operator runs two replicas of most controllers even on one node, which is why the list looks crowded. Last, check that the node actually advertises KVM to the scheduler.

kubectl get node homelab-kubevirt -o jsonpath='{.status.allocatable.devices\.kubevirt\.io/kvm}{"\n"}'
kubectl get node homelab-kubevirt --show-labels | tr , "\n" | grep -E "kubevirt.io/schedulable|host-model-cpu"

A KVM count of 1k and the schedulable label confirm virt-handler found /dev/kvm.

1k
host-model-cpu.node.kubevirt.io/Cascadelake-Server=true
kubevirt.io/schedulable=true

If the count is 0, KubeVirt can still run VMs with software emulation once you set spec.configuration.developerConfiguration.useEmulation: true in the KubeVirt CR. Expect them to be painfully slow, so use emulation to learn the API and never to judge whether a workload will fit. The CPU model label also matters later, because live migration only targets nodes that offer the same model.

Step 4: Install CDI and virtctl

The Containerized Data Importer handles every disk you bring into the cluster: HTTP downloads, uploads and format conversion. Its own docs still use kubectl create, and the CDI CRDs are small enough that this works.

export CDI_VERSION="v1.66.1" # pin: tested release #https://github.com/kubevirt/containerized-data-importer/releases
kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/${CDI_VERSION}/cdi-operator.yaml
kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/${CDI_VERSION}/cdi-cr.yaml
kubectl wait cdi cdi --for condition=Available --timeout=10m
kubectl -n cdi get pods

All four CDI pods were running within half a minute.

cdi.cdi.kubevirt.io/cdi condition met
NAME                               READY   STATUS    RESTARTS   AGE
cdi-apiserver-79f557d8bd-gt8w5     1/1     Running   0          25s
cdi-deployment-579ffc5c54-c4pc6    1/1     Running   0          24s
cdi-operator-595dd59559-mdz99      1/1     Running   0          32s
cdi-uploadproxy-759bb4f589-tlzsb   1/1     Running   0          25s

Local-path does not tell CDI which access mode to use, and the first VM import will stall with ErrClaimNotValid until you fill that in. We hit exactly that on the first VM, so patch the StorageProfile now and you will never see it.

kubectl patch storageprofile local-path --type=merge -p '{"spec":{"claimPropertySets":[{"accessModes":["ReadWriteOnce"],"volumeMode":"Filesystem"}]}}'
kubectl get storageprofile local-path -o jsonpath='{.status.claimPropertySets}{"\n"}'

The status should echo the property set back.

[{"accessModes":["ReadWriteOnce"],"volumeMode":"Filesystem"}]

Finally grab virtctl at the exact version the cluster runs, read from the KubeVirt CR so the client and server never drift.

VERSION=$(kubectl get kubevirt.kubevirt.io/kubevirt -n kubevirt -o=jsonpath="{.status.observedKubeVirtVersion}")
ARCH=$(uname -s | tr A-Z a-z)-$(uname -m | sed "s/x86_64/amd64/")
curl -sL -o virtctl https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/virtctl-${VERSION}-${ARCH}
sudo install -m 0755 virtctl /usr/local/bin
virtctl version

Client and server both reported v1.10.0.

Client Version: version.Info{GitVersion:"v1.10.0", GitCommit:"b0c8f3da95be1137d2285198b89a1e2323ec9278", GitTreeState:"clean", BuildDate:"2026-11-18T17:15:18Z", GoVersion:"go1.26.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v1.10.0", GitCommit:"b0c8f3da95be1137d2285198b89a1e2323ec9278", GitTreeState:"clean", BuildDate:"2026-11-18T18:36:56Z", GoVersion:"go1.26.10", Compiler:"gc", Platform:"linux/amd64"}

virtctl is what you use for consoles, SSH and disk uploads. kubectl alone can start and stop VMs, but it cannot stream an image into a PVC, so every migration workstation needs a copy. Keep it at the cluster version, because KubeVirt only promises client compatibility within a narrow skew and a mismatched client is the first thing support threads ask about.

Step 5: Create your first VM from a cloud image

A VirtualMachine with a dataVolumeTemplates entry is the KubeVirt version of deploying from a template. CDI downloads the Ubuntu cloud image into a fresh PVC, then the VM boots from it, and deleting the VM deletes the disk with it. Open a manifest file.

vim ubuntu-vm.yaml

Paste the manifest below, replacing the SSH key line with the public key from ~/.ssh/id_ed25519.pub on your node.

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: ubuntu-vm01
spec:
  runStrategy: Always
  dataVolumeTemplates:
    - metadata:
        name: ubuntu-vm01-root
      spec:
        storage:
          resources:
            requests:
              storage: 10Gi
        source:
          http:
            url: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
  template:
    spec:
      domain:
        cpu:
          cores: 2
        memory:
          guest: 2Gi
        devices:
          disks:
            - name: rootdisk
              disk:
                bus: virtio
            - name: cloudinit
              disk:
                bus: virtio
          interfaces:
            - name: default
              masquerade: {}
      networks:
        - name: default
          pod: {}
      volumes:
        - name: rootdisk
          dataVolume:
            name: ubuntu-vm01-root
        - name: cloudinit
          cloudInitNoCloud:
            userData: |
              #cloud-config
              hostname: ubuntu-vm01
              user: kibet
              ssh_authorized_keys:
                - ssh-ed25519 AAAA...your-public-key... kibet@homelab-kubevirt

The masquerade interface puts the guest behind the pod IP with NAT, which is the simplest network that works on any CNI. It also means the guest cannot keep the IP it had on vSphere, so plan for Multus and a bridge if your applications care. Create the VM and watch the DataVolume.

kubectl create -f ubuntu-vm.yaml
kubectl get dv,vm,vmi

The import pulled the image, converted it to raw and resized it to 10 GiB, then the VM started on its own because of runStrategy: Always.

NAME                                          PHASE       PROGRESS   RESTARTS   AGE
datavolume.cdi.kubevirt.io/ubuntu-vm01-root   Succeeded   100.0%                2m37s

NAME                                     AGE     STATUS    READY
virtualmachine.kubevirt.io/ubuntu-vm01   2m37s   Running   True

NAME                                             AGE   PHASE     IP                NODENAME           READY
virtualmachineinstance.kubevirt.io/ubuntu-vm01   86s   Running   192.168.152.150   homelab-kubevirt   True

Log in through virtctl, which tunnels SSH over the API server so you need no Service or node port for the guest.

virtctl ssh kibet@vm/ubuntu-vm01 --local-ssh-opts="-o StrictHostKeyChecking=accept-new" --command "hostnamectl | egrep 'hostname|Operating|Virtualization|Kernel'; lscpu | grep -E 'Model name|Hypervisor'; free -h | head -2; lsblk | grep vd"

The guest sees a KVM hypervisor, the host CPU model and a 10 GiB virtio disk.

DataVolume Succeeded, KubeVirt VM Running and virtctl ssh showing Ubuntu 24.04 guest on KVM

That small vdb disk is the cloud-init NoCloud volume. Did the guest get 2 GiB of RAM as requested? It reports 1.9 GiB total, because the kernel reserves a slice before userspace sees it, so size guests the way you did on ESXi. You now have a working hypervisor, and the next steps give it a management interface your provisioning tools already understand.

Step 6: Install KubeVirtBMC with Helm

KubeVirtBMC is a controller that watches VirtualMachineBMC objects and, for each one, runs a small emulator pod plus a Service that speaks IPMI on 623/UDP and Redfish on 80/TCP. It needs cert-manager for its webhook certificates and Helm to install. If Helm is missing, the official script installs it.

curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 | bash
helm version --short

Install cert-manager with its CRDs in the same release. Skip this if your cluster already runs it, because two cert-manager installs fight over the same webhooks.

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.21.3 --set crds.enabled=true --wait #https://github.com/cert-manager/cert-manager/releases

Older KubeVirtBMC instructions point at a chart repository under charts.zespre.com. That host now answers 404, because the project moved its charts to their own domain. Add the current repository and list what it offers.

helm repo add kubevirtbmc https://charts.kubevirtbmc.io/
helm repo update kubevirtbmc
helm search repo kubevirtbmc/kubevirtbmc --versions | head -6

The chart and app versions do not match, so read both columns.

NAME                   	CHART VERSION	APP VERSION	DESCRIPTION
kubevirtbmc/kubevirtbmc	0.9.0        	v0.12.0    	A Helm chart for KubeVirtBMC
kubevirtbmc/kubevirtbmc	0.8.0        	v0.11.0    	A Helm chart for KubeVirtBMC
kubevirtbmc/kubevirtbmc	0.7.0        	v0.10.0    	A Helm chart for KubeVirtBMC
kubevirtbmc/kubevirtbmc	0.6.0        	v0.9.0     	A Helm chart for KubeVirtBMC
kubevirtbmc/kubevirtbmc	0.5.1        	v0.8.1     	A Helm chart for KubeVirtBMC

Install chart 0.9.0, which carries the 0.12.0 controller. Pinning the chart matters here, because the VirtualMachineBMC spec changed shape between minor releases and an unpinned upgrade can reject manifests that worked yesterday.

helm upgrade --install kubevirtbmc kubevirtbmc/kubevirtbmc --version 0.9.0 --namespace kubevirtbmc-system --create-namespace --wait #https://github.com/kubevirtbmc/kubevirtbmc/releases
kubectl -n kubevirtbmc-system get pods

Store the BMC credentials in a Secret. These are the username and password that ipmitool and Redfish clients will send, so pick something better than our lab value.

kubectl create secret generic ubuntu-vm01-bmc-auth --from-literal=username=admin --from-literal=password=Kv-Bmc-2026

Now describe the BMC itself. IPMI is off by default in the current API, so enable it explicitly, and note that the virtual media storage class sits under redfish.virtualMedia.storage. Leave IPMI off if your tools speak Redfish, because IPMI over LAN has weak authentication and no transport encryption worth trusting.

vim ubuntu-vm01-bmc.yaml

Add this content to the file.

apiVersion: bmc.kubevirt.io/v1beta1
kind: VirtualMachineBMC
metadata:
  name: ubuntu-vm01-bmc
  namespace: default
spec:
  virtualMachineRef:
    name: ubuntu-vm01
  authSecretRef:
    name: ubuntu-vm01-bmc-auth
  ipmi:
    enabled: true
  redfish:
    virtualMedia:
      storage:
        storageClassName: local-path

Apply it and check the Service the controller creates.

kubectl apply -f ubuntu-vm01-bmc.yaml
kubectl get virtualmachinebmc
kubectl get svc ubuntu-vm01-virtbmc

SERVICEREADY True and a Service with both ports means the BMC is answering.

KubeVirtBMC Helm chart versions, controller-manager Running and VirtualMachineBMC Service exposing 80/TCP and 623/UDP

The Service name is always the VM name plus -virtbmc. That predictable name is what you register in your provisioning tool as the BMC address, so a script can enroll a hundred VMs without looking anything up. Each BMC also runs its own emulator pod, which costs a little memory per VM but keeps one broken BMC from taking the others down. For every VirtualMachineBMC the controller creates these objects:

  • An emulator Deployment named after the VM
  • A Service named <vm>-virtbmc with 80/TCP and 623/UDP
  • Virtual media DataVolumes, only when you insert an ISO over Redfish

Your VM itself is only referenced by the BMC, never owned by it, so the BMC objects can be changed or recreated without touching the guest.

Step 7: Power and boot a VM over IPMI

The BMC values repeat in every command from here on, so export them once in your shell.

export BMC_USER="admin"
export BMC_PASS="Kv-Bmc-2026"
export BMC_HOST="ubuntu-vm01-virtbmc.default.svc.cluster.local"

A ClusterIP Service is only reachable from inside the cluster, so run ipmitool from a pod. The project publishes a small image for exactly this. Testing from inside first is deliberate, because it separates BMC problems from Service exposure problems. If ipmitool works here and fails from outside later, you know the fault is the NodePort or LoadBalancer and not the credentials or the controller.

kubectl run ipmitool --image=kubevirtbmc/ipmitool --restart=Never --command -- sleep infinity
kubectl wait pod/ipmitool --for=condition=Ready --timeout=120s

Ask the BMC for the power state using the same lanplus interface you would use against a physical server.

kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" power status

It answers like any other BMC.

Chassis Power is on

Power it off, give it about 15 seconds, then check what KubeVirt thinks happened. Checked too early, the VM still reads Stopping.

kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" power off
kubectl get vm ubuntu-vm01

Provisioning tools usually set a one-time PXE boot before powering on, so try that path too. The boot parameter readback shows the flag applies only to the next boot.

kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" chassis bootdev pxe
kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" chassis bootparam get 5

These are the relevant lines of the readback.

Set Boot Device to pxe
Boot parameter version: 1
Boot parameter 5 is valid/unlocked
Boot parameter data: 8004000000
 Boot Flags :
   - Boot Flag Valid
   - Options apply to only next boot
   - BIOS PC Compatible (legacy) boot
   - Boot Device Selector : Force PXE

Our masquerade network has no PXE server, so we set the boot device back to disk before powering on. With a real provisioning network attached through Multus, you would leave PXE set and let Ironic or MAAS take over from here.

kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" chassis bootdev disk
kubectl exec ipmitool -- ipmitool -I lanplus -U "${BMC_USER}" -P "${BMC_PASS}" -H "${BMC_HOST}" power on
kubectl get vm,vmi ubuntu-vm01

Power off stopped the VM object, and power on brought back a new VMI in about 20 seconds.

ipmitool power off stops the KubeVirt VM and power on starts it again through the KubeVirtBMC IPMI endpoint

IPMI power off maps to stopping the VirtualMachine, not to killing the pod. The VM object reads Stopped, so the runStrategy does not restart it behind your back the way it would after a crash.

Step 8: Drive the same VM through Redfish

Newer tooling such as Ironic and Metal3 also speaks Redfish, and many teams prefer it over IPMI. Start a throwaway curl pod in the same namespace so the short Service name resolves.

kubectl run curl --image=curlimages/curl --restart=Never --command -- sleep infinity
kubectl wait pod/curl --for=condition=Ready --timeout=120s

The service root needs no authentication and tells you which Redfish version the emulator implements.

kubectl exec curl -- curl -s http://ubuntu-vm01-virtbmc/redfish/v1 | python3 -m json.tool

The full document is long, so here are the lines that matter from it.

    "@odata.type": "#ServiceRoot.v1_16_1.ServiceRoot",
    "RedfishVersion": "1.16.1",
    "Systems": {
        "@odata.id": "/redfish/v1/Systems"

Everything below the root needs credentials. Redfish clients normally open a session and reuse the token it returns.

kubectl exec curl -- curl -s -i -X POST http://ubuntu-vm01-virtbmc/redfish/v1/SessionService/Sessions -H "Content-Type: application/json" -d "{\"UserName\":\"${BMC_USER}\",\"Password\":\"${BMC_PASS}\"}"

A 201 with an X-Auth-Token header (ours redacted) means the credentials from the Secret were accepted.

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: /redfish/v1/SessionService/Sessions/fe59ff35-8ec9-4954-8413-162db48445f7
X-Auth-Token: <64-character token>

Capture the token in a variable, then read the ComputerSystem to see which reset types this BMC accepts.

TOKEN=$(kubectl exec curl -- curl -s -D - -o /dev/null -X POST http://ubuntu-vm01-virtbmc/redfish/v1/SessionService/Sessions -H "Content-Type: application/json" -d "{\"UserName\":\"${BMC_USER}\",\"Password\":\"${BMC_PASS}\"}" | awk '/X-Auth-Token/{print $2}' | tr -d "\r")
kubectl exec curl -- curl -s -H "X-Auth-Token: ${TOKEN}" http://ubuntu-vm01-virtbmc/redfish/v1/Systems/1 | python3 -m json.tool | grep -A6 AllowableValues

Five reset types are supported. PushPowerButton and Nmi are absent, which matters if your tooling defaults to either, because the BMC rejects them with a 400 instead of mapping them to the nearest action.

            "[email protected]": [
                "On",
                "ForceOff",
                "GracefulShutdown",
                "GracefulRestart",
                "ForceRestart"
            ],

Send a ForceRestart and compare the VMI UID before and after.

kubectl get vmi ubuntu-vm01 -o jsonpath='{.metadata.uid}{"\n"}'
kubectl exec curl -- curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "X-Auth-Token: ${TOKEN}" -H "Content-Type: application/json" -d '{"ResetType":"ForceRestart"}' http://ubuntu-vm01-virtbmc/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
kubectl get vmi ubuntu-vm01 -o jsonpath='{.metadata.uid}{"\n"}'

The 204 came back immediately, and 25 seconds later the VMI had a new UID.

Redfish ComputerSystem.Reset ForceRestart returns 204 and the KubeVirt VMI comes back with a new UID

A new UID tells you ForceRestart deletes and recreates the VM instance rather than rebooting the guest in place. Anything your guest kept in memory is gone, exactly like pulling the power on a physical box. A one-time PXE override is a PATCH on the same resource, and basic auth works as well as a session token.

kubectl exec curl -- curl -s -w "HTTP %{http_code}\n" -u "${BMC_USER}:${BMC_PASS}" -X PATCH -H "Content-Type: application/json" -d '{"Boot":{"BootSourceOverrideTarget":"Pxe","BootSourceOverrideEnabled":"Once"}}' http://ubuntu-vm01-virtbmc/redfish/v1/Systems/1

On its own, the PATCH returns only the status code. Read the Boot object back to confirm the override was stored.

kubectl exec curl -- curl -s -u "${BMC_USER}:${BMC_PASS}" http://ubuntu-vm01-virtbmc/redfish/v1/Systems/1 | python3 -c "import json,sys; print(json.dumps(json.load(sys.stdin)['Boot'], indent=2))"

Here are the 204 from the PATCH and the stored override, together.

HTTP 204
{
  "BootOptions": {},
  "BootSourceOverrideEnabled": "Once",
  "BootSourceOverrideMode": "Legacy",
  "BootSourceOverrideTarget": "Pxe",
  "Certificates": {}
}

That override is still armed, so the next power cycle tries PXE. Without a PXE server on the network, clear it with the same PATCH and "BootSourceOverrideEnabled":"Disabled" before you restart the VM again.

For virtual media, KubeVirtBMC 0.12 labels the DataVolumes it creates for inserted ISOs and only deletes volumes that carry its label. Media inserted by 0.11 or earlier has no label, so after an upgrade the next insert fails and eject leaves the old DataVolume behind. The KubeVirtBMC virtual media docs include a script that backfills the label on existing volumes.

Step 9: Reach the BMC from outside the cluster

Your provisioning server probably does not run inside the cluster, so it needs a routable address. The VirtualMachineBMC spec takes a Service type; NodePort is the quickest test, and a LoadBalancer from MetalLB is the cleaner production answer.

kubectl patch virtualmachinebmc ubuntu-vm01-bmc --type=merge -p '{"spec":{"service":{"type":"NodePort"}}}'
kubectl get svc ubuntu-vm01-virtbmc

The controller recreated the Service with two node ports, and the UDP one is your IPMI port.

NAME                  TYPE       CLUSTER-IP   EXTERNAL-IP   PORT(S)                      AGE
ubuntu-vm01-virtbmc   NodePort   10.96.6.72   <none>        80:30796/TCP,623:30587/UDP   10s

Your node ports will differ, so read the UDP one from the Service and set your node IP (ours was 10.0.1.50). Then, from the node itself with ipmitool installed from apt, pass the port with -p.

export NODE_IP="10.0.1.50"
export IPMI_PORT=$(kubectl get svc ubuntu-vm01-virtbmc -o jsonpath='{.spec.ports[?(@.protocol=="UDP")].nodePort}')
sudo apt-get install -y ipmitool
ipmitool -I lanplus -H "${NODE_IP}" -p "${IPMI_PORT}" -U "${BMC_USER}" -P "${BMC_PASS}" chassis status | head -4

Chassis status matches what the in-cluster pod saw.

System Power         : on
Power Overload       : false
Power Interlock      : inactive
Main Power Fault     : false

The patch also changed the ClusterIP, from 10.109.61.30 to 10.96.6.72 in our run. Anything that cached the old address breaks, which is one more reason to register the DNS name and not the IP. NodePorts carry their own trap, since a node port is open on every node and ipmitool traffic is easy to sniff. Firewall those ports to the provisioning hosts only, or skip NodePort entirely and give the BMCs a LoadBalancer address on a management VLAN. When you are done testing, remove the two helper pods with kubectl delete pod ipmitool curl.

Step 10: Import a VMware VMDK with CDI

For the VMware side we used an OVA export, the same format vCenter produces with Export OVF Template. Canonical publishes the Ubuntu cloud image as an OVA built for vSphere, which makes it a realistic test disk. An OVA is just a tar archive, so unpack it with tar.

sudo apt-get install -y qemu-utils
mkdir -p ~/vmware-export && cd ~/vmware-export
curl -sLO https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.ova
tar -xf noble-server-cloudimg-amd64.ova
ls -lh

Inspect the disk and the OVF descriptor before you import anything, because the descriptor tells you which virtual hardware the guest was built for.

qemu-img info ubuntu-noble-24.04-cloudimg.vmdk
grep -oE '<rasd:ResourceSubType>[^<]+|vmw:osType="[^"]+"|<vssd:VirtualSystemType>[^<]+' ubuntu-noble-24.04-cloudimg.ovf | sort -u

The result is a compressed streamOptimized VMDK with a 10 GiB virtual size, wired to a VMware paravirtual SCSI controller and a VMXNET3 NIC.

image: ubuntu-noble-24.04-cloudimg.vmdk
file format: vmdk
virtual size: 10 GiB (10737418240 bytes)
disk size: 563 MiB
...
    create type: streamOptimized
...
<rasd:ResourceSubType>VirtualSCSI
<rasd:ResourceSubType>VmxNet3
...
<vssd:VirtualSystemType>vmx-10
vmw:osType="ubuntu64Guest"

KubeVirt will present that disk on virtio, not on a VMware SCSI controller. Linux guests carry virtio drivers in the stock kernel, so they boot fine, although the NIC name changes and any static network config tied to the old name needs a look. Windows guests need the virtio drivers installed before you export them, or they blue screen on the first boot. Before exporting a production VM, work through a short checklist on the source guest:

  • Install virtio drivers on Windows guests
  • Remove VMware Tools or open-vm-tools
  • Switch static network config away from the ens192 style NIC name
  • Consolidate snapshots so the export is a single disk

None of that applied to our cloud image, which uses DHCP and cloud-init, so it booted untouched.

Upload the VMDK through the CDI upload proxy. CDI detects the format and converts it to raw. The --force-bind flag matters on WaitForFirstConsumer storage, because no VM exists yet to trigger the binding.

UPLOAD_IP=$(kubectl -n cdi get svc cdi-uploadproxy -o jsonpath="{.spec.clusterIP}")
time virtctl image-upload dv legacy-web01-disk --size=12Gi --image-path=ubuntu-noble-24.04-cloudimg.vmdk --uploadproxy-url=https://${UPLOAD_IP} --insecure --force-bind

The 563 MiB upload and conversion finished in under a minute.

DataVolume default/legacy-web01-disk created
Waiting for PVC legacy-web01-disk upload pod to be ready...
Pod now ready
Uploading data to https://10.108.247.132

Uploading data completed successfully, waiting for processing to complete, you can hit ctrl-c without interrupting the progress
Processing completed successfully
Uploading ubuntu-noble-24.04-cloudimg.vmdk completed successfully

real	0m56.676s

We used the cluster IP of the upload proxy because we ran virtctl on the node. From a workstation you would expose cdi-uploadproxy through an Ingress or NodePort and drop --insecure once it has a real certificate. Upload speed is bound by the link to the proxy, so a batch of large VMDKs is faster to stage on a web server close to the cluster and pull with an HTTP DataVolume, as shown below.

The imported VM is the Step 5 manifest with two changes: no dataVolumeTemplates block, and the root volume points at the existing DataVolume. Save it as legacy-web01.yaml.

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: legacy-web01
spec:
  runStrategy: Always
  template:
    spec:
      domain:
        cpu:
          cores: 2
        memory:
          guest: 2Gi
        devices:
          disks:
            - name: rootdisk
              disk:
                bus: virtio
            - name: cloudinit
              disk:
                bus: virtio
          interfaces:
            - name: default
              masquerade: {}
      networks:
        - name: default
          pod: {}
      volumes:
        - name: rootdisk
          dataVolume:
            name: legacy-web01-disk
        - name: cloudinit
          cloudInitNoCloud:
            userData: |
              #cloud-config
              hostname: legacy-web01
              user: kibet
              ssh_authorized_keys:
                - ssh-ed25519 AAAA...your-public-key... kibet@homelab-kubevirt

Create it, give the guest about 30 seconds to finish booting, then log in to confirm it found its disk and network.

kubectl create -f legacy-web01.yaml
kubectl wait vm legacy-web01 --for=condition=Ready --timeout=180s
virtctl ssh kibet@vm/legacy-web01 --local-ssh-opts="-o StrictHostKeyChecking=accept-new" --command "hostname; lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep -E 'vda|NAME'; ip -br addr show enp1s0; systemctl is-system-running"

The disk grew to the 12 GiB we asked for, cloud-init extended the root partition, and systemd reports a clean boot.

virtctl image-upload of a VMware streamOptimized VMDK into a CDI DataVolume and the imported legacy-web01 VM running

If your VMDKs sit on a web server or object store, CDI can pull them instead. A standalone DataVolume on WaitForFirstConsumer storage needs the immediate bind annotation, the manifest equivalent of --force-bind. Without it our first attempt sat in WaitForFirstConsumer with no importer pod at all.

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: legacy-app02-disk
  annotations:
    cdi.kubevirt.io/storage.bind.immediate.requested: "true"
spec:
  source:
    http:
      url: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.vmdk
  storage:
    resources:
      requests:
        storage: 12Gi

The importer log shows CDI converting the VMDK to raw with qemu-img.

I1130 18:55:38.876707       1 data-processor.go:260] New phase: Convert
I1130 18:55:38.888868       1 qemu.go:114] Running qemu-img with args: [convert -t writeback -p -O raw /scratch/tmpimage /data/disk.img]

This disk level path suits a handful of VMs or a lift that can tolerate downtime. For a fleet, the Forklift project pulls VMs straight from vCenter, maps networks and storage and supports warm migration. Red Hat ships it as the Migration Toolkit for Virtualization on OpenShift. It needs a reachable vCenter or ESXi endpoint, so this guide sticks to the exported disk that any team can produce. Teams moving to Proxmox instead can follow our ESXi to Proxmox migration guide.

What broke in the lab

Each of these errors showed up on our node in the order below. Each heading quotes the distinctive part of the message so you can match it against your own terminal. Most of them come from documentation that lags the code, so when a copied manifest fails, check the release notes of the version you installed before you assume the cluster is broken.

metadata.annotations: Too long: may not be more than 262144 bytes

A plain kubectl apply of kubevirt-operator.yaml on 1.10 hits the annotation size limit on the KubeVirt CRD (kubevirt/kubevirt issue 19980). Use kubectl apply --server-side, or kubectl create on a fresh cluster. Upgrades from an older release need server-side apply too.

Apply failed with 1 conflict: conflict with “kubectl-client-side-apply”

This follows the error above when you retry with server-side apply on the half-installed operator. Add --force-conflicts to hand field ownership of the virt-operator Deployment to the server-side manager.

ErrClaimNotValid: no accessMode specified in StorageProfile local-path

The DataVolume showed no phase and no importer pod for over a minute, which looks like a slow download until you read the condition. CDI has no built-in profile for local-path, so it cannot guess the access and volume modes. Patch the StorageProfile as in Step 4, and the stuck import starts on its own within seconds without deleting the VM.

DataVolume stuck in WaitForFirstConsumer

A standalone DataVolume with no VM attached sat in WaitForFirstConsumer for 40 seconds and would have waited forever. Add the cdi.kubevirt.io/storage.bind.immediate.requested annotation, or pass --force-bind to virtctl image-upload.

charts.zespre.com is not a valid chart repository: 404 Not Found

The KubeVirtBMC charts moved to https://charts.kubevirtbmc.io/. Add the new one as in Step 6, and if you added the old repository before the move, drop it with helm repo remove zespre.

strict decoding error: unknown field “spec.storageClassName”

A VirtualMachineBMC copied from an older example puts storageClassName at the top of the spec. Since 0.11 it lives at spec.redfish.virtualMedia.storage.storageClassName, as in the Step 6 manifest. IPMI also has to be switched on with spec.ipmi.enabled: true.

Error: Unable to establish IPMI v2 / RMCP+ session

ipmitool prints this for a wrong password, which we confirmed against the NodePort. Check the username and password in the auth Secret, and on a NodePort check that you passed -p with the UDP port, not the TCP one.

ActionParameterValueNotInList for PushPowerButton

Redfish returns HTTP 400 with Base.1.10.ActionParameterValueNotInList for any reset type outside the five listed in Step 8. Map PushPowerButton to GracefulShutdown or On in your tooling.

What we would change for production

The single node lab proves the workflow, but several of its shortcuts would hurt you on a real cluster. These are the changes we would make before moving a single vSphere workload across.

  • Three control plane nodes and at least two workers, so live migration and node drains work
  • RWX block storage (Ceph RBD or a SAN CSI driver) in place of local-path
  • Multus with a bridge network so VMs keep their existing VLANs and IPs
  • BMC Services behind MetalLB on a management VLAN, never on NodePort
  • One credential Secret per BMC, rotated like any other out-of-band password

Certificates are the other quiet risk on a kubeadm cluster that runs VMs for years. Our guide to fixing expired kubeadm certificates is worth bookmarking before the first renewal comes due, and the KubeVirt user guide covers live migration tuning once you have the second worker in place.

Keep reading

Best UI Applications for Managing Docker Containers Containers Best UI Applications for Managing Docker Containers Install Docker and Run Containers on Ubuntu 24.04|22.04 Containers Install Docker and Run Containers on Ubuntu 24.04|22.04 Install UniFi OS Server on Ubuntu 26.04 / 24.04 LTS Containers Install UniFi OS Server on Ubuntu 26.04 / 24.04 LTS Traefik 3.8 Upgrade: Breaking Changes, Yaegi v2 and Helm Test Containers Traefik 3.8 Upgrade: Breaking Changes, Yaegi v2 and Helm Test magpie: One AI Gateway for Claude Code and Codex on Linux AI magpie: One AI Gateway for Claude Code and Codex on Linux The Growing Adoption of Containerized Linux Environments in 2026 Containers The Growing Adoption of Containerized Linux Environments in 2026

Leave a Comment

Press ESC to close