“Hot plug is not supported for this virtual machine” when enabling Fault Tolerance (FT)

The error message “Hot plug is not supported for this virtual machine” when enabling Fault Tolerance (FT) usually indicates that hot-add or hot-plug features are enabled on the VM, which are not compatible with FT. To resolve this issue, you will need to turn off hot-add/hot-plug CPU/memory features for the VM.

Here is a PowerShell script using VMware PowerCLI that will disable hot-add/hot-plug for all VMs where it is enabled, and which are not compatible with Fault Tolerance:

# Import VMware PowerCLI module
Import-Module VMware.PowerCLI

# Connect to vCenter
$vCenterServer = "your_vcenter_server"
$username = "your_username"
$password = "your_password"
Connect-VIServer -Server $vCenterServer -User $username -Password $password

# Get all VMs that have hot-add/hot-plug enabled
$vms = Get-VM | Where-Object {
    ($_.ExtensionData.Config.CpuHotAddEnabled -eq $true) -or
    ($_.ExtensionData.Config.MemoryHotAddEnabled -eq $true)
}

# Loop through the VMs and disable hot-add/hot-plug
foreach ($vm in $vms) {
    # Disable CPU hot-add
    if ($vm.ExtensionData.Config.CpuHotAddEnabled -eq $true) {
        $vm | Get-View | % {
            $_.Config.CpuHotAddEnabled = $false
            $_.ReconfigVM_Task($_.Config)
        }
        Write-Host "Disabled CPU hot-add for VM:" $vm.Name
    }

    # Disable Memory hot-add
    if ($vm.ExtensionData.Config.MemoryHotAddEnabled -eq $true) {
        $vm | Get-View | % {
            $_.Config.MemoryHotAddEnabled = $false
            $_.ReconfigVM_Task($_.Config)
        }
        Write-Host "Disabled Memory hot-add for VM:" $vm.Name
    }
}

# Disconnect from vCenter
Disconnect-VIServer -Server $vCenterServer -Confirm:$false

Important Notes:

  • Replace "your_vcenter_server", "your_username", and "your_password" with your actual vCenter server details.
  • This script will disable hot-add/hot-plug for both CPU and memory for all VMs where it’s enabled. Make sure you want to apply this change to all such VMs.
  • Disabling hot-add/hot-plug features will require the VM to be powered off. Ensure that the VMs are in a powered-off state or have a plan to power them off before running this script.
  • Always test scripts in a non-production environment first to avoid unintended consequences.
  • For production environments, it’s crucial to perform these actions during a maintenance window and with full awareness and approval of the change management team.
  • Consider handling credentials more securely in production scripts, possibly with the help of secure string or credential management systems.

After running this script, you should be able to enable Fault Tolerance on the VMs without encountering the hot plug error.

Leave a comment