Rebuilding a 2,500-VM Lab on KubeVirt: The KubeVirtBMC Approach
Migrating a large-scale virtual machine environment from vSphere to KubeVirt is not just a technical challenge; it’s a strategic move towards a more flexible and cloud-native infrastructure. KubeVirtBMC plays a crucial role in this transition by allowing you to recreate a virtual BMC for each VM at the destination. This enables a batch-by-batch cutover, integrating BMC creation, auditing, and lifecycle management into the Kubernetes resource model.
The migration process begins with Forklift, which handles the movement of VMs and disks from vSphere to KubeVirt. Once the VMs are in place, KubeVirtBMC takes over, translating IPMI commands into KubeVirt API operations. This ensures that your existing management workflows can continue seamlessly. You'll need Kubernetes v1.32 or later, KubeVirt v1.9.0, and a few other prerequisites like cert-manager and a CSI driver for VM disks. The setup involves creating the necessary operators and resources, which can be done with straightforward bash commands and YAML configurations.
In production, be aware of the limitations of KubeVirtBMC. While it aims to replicate the functionality of traditional BMCs, it may not cover every IPMI command or feature. Validate the exact command set your tooling uses before going live. Additionally, ensure that you have network reachability from Ironic to each BMC NodePort, as this is critical for operation. The KubeVirtBMC Quick Start is tested with specific versions, so keep your environment aligned with those requirements to avoid compatibility issues.
Key takeaways
- →Utilize Forklift for seamless VM and disk migration from vSphere to KubeVirt.
- →Implement KubeVirtBMC to manage BMC creation and lifecycle within Kubernetes.
- →Ensure Kubernetes is version 1.32 or later for compatibility with KubeVirtBMC.
- →Validate the IPMI command set your tooling uses before going live to avoid issues.
- →Maintain network reachability from Ironic to each BMC NodePort for proper operation.
Why it matters
This migration strategy allows organizations to leverage Kubernetes' scalability and flexibility while maintaining existing VM management workflows. It significantly reduces the complexity of managing large VM environments.
Code examples
# KubeVirt
export KUBEVIRT_VERSION=$(curl -s https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml
kubectl -n kubevirt wait kv kubevirt --for condition=Available --timeout=10mhelm upgrade --install cert-manager oci://quay.io/jetstack/charts/cert-manager \
--namespace=cert-manager --create-namespace \
--set=crds.enabled=true1apiVersion: bmc.kubevirt.io/v1beta1
2kind: VirtualMachineBMC
3metadata:
4 name: testvm-bmc
5 namespace: default
6spec:
7 virtualMachineRef:
8 name: testvm
9 authSecretRef:
10 name: testvm-bmc-secret
11 ipmi:
12 enabled: trueWhen NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docsIndustry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.
Get CKA certified →Rebuilding a 2,500-VM Lab with KubeVirtBMC: Keeping IPMI Alive
Migrating a massive test lab to KubeVirt can be daunting, especially when you need to maintain IPMI provisioning. KubeVirtBMC simplifies this by translating IPMI commands into KubeVirt API operations, allowing seamless VM management.
Kubernetes v1.37: Mastering the Unused PVC Condition
Kubernetes v1.37 introduces the PersistentVolumeClaimUnusedSinceTime feature gate, now in Beta. This feature adds an Unused condition to PersistentVolumeClaims (PVCs), helping you manage storage resources more effectively. Learn how this can prevent accidental data loss and optimize your cluster's storage usage.
Hardening Kubernetes Storage: Bind Mount Options and EmptyDir Permissions
Kubernetes v1.37 introduces critical features to enhance storage security in your clusters. By utilizing bind mount options like 'noexec' and 'nosuid', you can significantly reduce the attack surface of your workloads. Dive in to learn how to implement these features effectively.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.