vSphere Hardware Version Management¶
This document describes how to configure and upgrade VM hardware compatibility versions in VMware vSphere environments using virtrigaud.
Overview¶
VMware vSphere virtual machines have a hardware compatibility version (also called virtual hardware version) that determines which features and capabilities are available to the VM. Higher hardware versions provide access to newer features but require compatible ESXi hosts.
Note: Hardware version management is specific to VMware vSphere and is not available for other providers (LibVirt, Proxmox, etc.).
Hardware Version Numbers¶
Common hardware versions and their corresponding VMware products:
| Hardware Version | vSphere/ESXi Version | Key Features |
|---|---|---|
| 10 | ESXi 5.5 | Legacy baseline |
| 11 | ESXi 6.0 | Enhanced graphics, larger VM memory |
| 13 | ESXi 6.5 | Enhanced security, more CPU/memory |
| 14 | ESXi 6.7 | Persistent memory, enhanced security |
| 15 | ESXi 6.7 U2 | Enhanced graphics, more vCPU |
| 17 | ESXi 7.0 | TPM 2.0, enhanced security |
| 18 | ESXi 7.0 U1 | Enhanced networking |
| 19 | ESXi 7.0 U2 | Precision time protocol |
| 20 | ESXi 7.0 U3 | Enhanced graphics, more memory |
| 21 | ESXi 8.0 | Latest features, DPU support |
Setting Hardware Version During VM Creation¶
Configure the hardware version in the VMClass using the extraConfig field:
apiVersion: infra.virtrigaud.io/v1beta1
kind: VMClass
metadata:
name: modern-vm-class
namespace: virtrigaud-system
spec:
cpu: 4
memory: 8Gi
firmware: UEFI
# vSphere-specific hardware version configuration
extraConfig:
vsphere.hardwareVersion: "21" # Use latest hardware version
diskDefaults:
type: thin
sizeGiB: 50
---
apiVersion: infra.virtrigaud.io/v1beta1
kind: VirtualMachine
metadata:
name: modern-vm
namespace: default
spec:
providerRef:
name: vsphere-provider
namespace: virtrigaud-system
classRef:
name: modern-vm-class # Uses hardware version 21
namespace: virtrigaud-system
imageRef:
name: ubuntu-22-04
namespace: virtrigaud-system
Upgrading Hardware Version for Existing VMs¶
You can upgrade the hardware version of existing VMs using the dedicated hardware upgrade API:
Using kubectl with Raw gRPC¶
# First, ensure the VM is powered off
kubectl patch vm my-vm --type='merge' -p='{"spec":{"powerState":"Off"}}'
# Wait for VM to be powered off, then upgrade hardware version
# Note: This requires direct access to the provider gRPC endpoint
# A kubectl plugin or controller extension would be needed for this operation
Programmatic Upgrade (Example Go Code)¶
package main
import (
"context"
"fmt"
"log"
providerv1 "github.com/projectbeskar/virtrigaud/proto/rpc/provider/v1"
"google.golang.org/grpc"
)
func upgradeVMHardwareVersion(vmID string, targetVersion int32) error {
// Connect to vSphere provider
conn, err := grpc.Dial("vsphere-provider:9090", grpc.WithInsecure())
if err != nil {
return fmt.Errorf("failed to connect: %w", err)
}
defer conn.Close()
client := providerv1.NewProviderClient(conn)
// Upgrade hardware version
req := &providerv1.HardwareUpgradeRequest{
Id: vmID,
TargetVersion: targetVersion,
}
resp, err := client.HardwareUpgrade(context.Background(), req)
if err != nil {
return fmt.Errorf("hardware upgrade failed: %w", err)
}
log.Printf("Hardware upgrade completed: %+v", resp)
return nil
}
Requirements and Limitations¶
Prerequisites¶
- VM Must Be Powered Off: Hardware version upgrades require the VM to be completely powered off
- ESXi Host Compatibility: Target hardware version must be supported by the ESXi host
- VMware Tools: For best results, ensure VMware Tools is installed and up-to-date
- Backup Recommended: Take a snapshot before upgrading hardware version
Limitations¶
- One-Way Operation: Hardware version upgrades cannot be downgraded
- vSphere Only: This feature is not available for LibVirt, Proxmox, or other providers
- Host Requirements: Upgrading to newer versions may prevent VM from running on older ESXi hosts
- Compatibility: Some older guest operating systems may not support newer hardware versions
Best Practices¶
Choosing Hardware Version¶
- Match ESXi Version: Use the hardware version that matches your ESXi environment
- Conservative Approach: Don't always use the latest version unless you need specific features
- Test First: Test hardware version upgrades in development before production
Upgrade Process¶
- Plan Maintenance Window: VMs must be powered off during upgrade
- Backup First: Always take a snapshot before upgrading
- Batch Operations: Group VMs by hardware requirements for efficient upgrades
- Verify Compatibility: Ensure all ESXi hosts in your cluster support the target version
Example VMClass Configurations¶
Legacy Environment (ESXi 6.5)¶
Modern Environment (ESXi 7.0)¶
Latest Features (ESXi 8.0)¶
Troubleshooting¶
Common Issues¶
-
VM Not Powered Off
Solution: Power off the VM first usingpowerState: Off -
Unsupported Hardware Version
Solution: Check ESXi host compatibility and use a supported version -
Version Not Newer
Solution: Hardware versions can only be upgraded, not downgraded
Validation¶
After upgrading, verify the hardware version:
Integration Examples¶
Complete VM Lifecycle with Hardware Version¶
# 1. Create VMClass with specific hardware version
apiVersion: infra.virtrigaud.io/v1beta1
kind: VMClass
metadata:
name: production-vm-class
spec:
cpu: 8
memory: 16Gi
firmware: UEFI
extraConfig:
vsphere.hardwareVersion: "19" # ESXi 7.0 U2 compatible
---
# 2. Create VM using the class
apiVersion: infra.virtrigaud.io/v1beta1
kind: VirtualMachine
metadata:
name: production-vm
spec:
powerState: On
providerRef:
name: vsphere-provider
namespace: virtrigaud-system
classRef:
name: production-vm-class
namespace: virtrigaud-system
imageRef:
name: ubuntu-22-04
namespace: virtrigaud-system
---
# 3. Update to newer hardware version (requires separate upgrade operation)
# This would typically be done through a controller or manual gRPC call
# after powering off the VM
This vSphere-specific feature provides fine-grained control over VM hardware capabilities while maintaining compatibility with your ESXi infrastructure.