How to Configure VMware vSphere DPM: Automatically Power ESXi Hosts On/Off to Save Datacenter Energy

VMware tutorial - IT technology blog
VMware tutorial - IT technology blog

The Problem: Power Bills Running, Servers Breathing Air

If you manage a cluster of ESXi hosts in a datacenter environment, you’ve probably seen this before: 3 AM, all 8 servers running at full power, but total CPU load across the entire cluster is only 15%. Power is still running, fans are still spinning, electricity bills keep adding up — while the majority of resources sit completely idle.

Distributed Power Management (DPM) is a vSphere feature designed to solve exactly this problem. It automatically migrates VMs onto fewer servers when load is low, then shuts down the empty servers entirely. When load picks back up, DPM uses Wake-on-LAN or IPMI to power on standby servers before the cluster becomes overloaded.

I once migrated from VMware to Proxmox for my personal lab, and realized that Proxmox doesn’t have an equivalent to DPM built in the same integrated way as vSphere. To do something similar on Proxmox, you’d have to write external scripts using the Proxmox API combined with IPMI tools — quite cumbersome. This shows that DPM is a genuine strength of VMware enterprise, especially when you have 4 or more hosts and power consumption is a significant cost.

How Does DPM Work?

DPM relies on DRS (Distributed Resource Scheduler) — so DRS must be enabled first. The workflow:

  1. DRS continuously monitors CPU and RAM across the entire cluster
  2. When the cluster is idle (below the configured threshold), DRS migrates VMs off certain hosts
  3. DPM shuts down those empty hosts (graceful shutdown via VMware Tools)
  4. When load increases and current hosts are nearly full, DPM powers on standby servers via Wake-on-LAN or IPMI/iLO
  5. Once the host has booted and joined the cluster, DRS migrates VMs onto it to balance the load

Prerequisites

Servers need to support at least one of the following wake-up methods:

  • Wake-on-LAN (WoL): widely supported; requires a NIC that supports WoL and a layer-2 switch on the same subnet as the management network
  • IPMI/BMC: via out-of-band management; more reliable than WoL since it doesn’t depend on the OS
  • iLO (HP), iDRAC (Dell), CIMC (Cisco): vendor-specific IPMI implementations

Additionally, vCenter Server is required (this does not work with standalone ESXi), the cluster must have at least 2 ESXi hosts, and DRS must already be enabled in Automatic or Partially Automated mode.

Setup — Verify Before Enabling DPM

Before configuring, confirm that your hosts support a wake-up protocol. Use PowerCLI for a quick check:

# Connect to vCenter
Connect-VIServer -Server "vcenter.lab.local" -User "[email protected]"

# Check DPM wake capability for each host in the cluster
$cluster = Get-Cluster -Name "Production-Cluster"
foreach ($vmhost in ($cluster | Get-VMHost)) {
    $config = $vmhost.ExtensionData.Config.PowerSystemCapability
    Write-Host "$($vmhost.Name): WakeOnLan=$($config.WakeOnLanCapable)"
}

If WakeOnLanCapable = True, the host supports WoL. Next, check the DRS status:

# Check if DRS is enabled
$cluster = Get-Cluster -Name "Production-Cluster"
Write-Host "DRS Enabled: $($cluster.DrsEnabled)"
Write-Host "DRS Mode: $($cluster.DrsAutomationLevel)"

DRS must be FullyAutomated or PartiallyAutomated. If it’s not enabled, enable DRS first before touching DPM.

Configuring DPM Step by Step

Step 1: Enable DRS (if not already enabled)

In vSphere Client:

  • Go to Cluster → Configure → vSphere DRS
  • Click Edit
  • Enable Turn ON vSphere DRS
  • Select Automation Level: Fully Automated
  • Save

Step 2: Enable DPM and Choose Automation Level

Once DRS is enabled, go to Cluster → Configure → vSphere DPM, click Edit and select your automation level:

  • Off: DPM completely disabled
  • Manual: DPM recommends actions; admins decide whether to execute them
  • Automatic: DPM powers hosts on/off without manual intervention

For production environments, start with Manual and monitor for a few weeks before switching to Automatic. The reason: you need to ensure DPM doesn’t shut down hosts during peak hours or when VMs are running sensitive workloads.

Step 3: Adjust the DPM Threshold

In the DPM settings there is a DPM Threshold slider from 1 to 5:

  • 1 (Conservative): only shuts down hosts when the cluster is truly very idle — safest but saves the least power
  • 3 (Moderate): balanced between power savings and risk
  • 5 (Aggressive): more aggressively shuts down hosts, saves more power but hosts may be woken more frequently

Recommended for production: level 2 during the testing phase, then increase to 3 once you’re familiar with DPM’s behavior. Level 1 barely does anything; levels 4–5 may shut down hosts even when load is at a moderate level.

Step 4: Configure IPMI for Hosts (if using out-of-band)

If your servers use IPMI/iLO instead of WoL, you need to configure BMC credentials for each host:

# Configure IPMI for a host via PowerCLI
$vmhost = Get-VMHost -Name "esxi-03.lab.local"
$spec = New-Object VMware.Vim.HostIpmiInfo
$spec.BmcIpAddress = "192.168.1.203"
$spec.BmcPort = 623
$spec.Login = "admin"
$spec.Password = "your-ipmi-password"

$vmhost.ExtensionData.UpdateIpmi($spec)
Write-Host "IPMI configured for $($vmhost.Name)"

After configuration, vCenter will test the IPMI connection and report the status under Host → Configure → Power Management.

Step 5: Exclude Critical Hosts from DPM

Not every host should be treated the same. Hosts running vCenter, management VMs, or critical infrastructure should be overridden to prevent DPM from automatically powering them down:

# Override DPM for a specific host — recommendations only, no auto power-off
$vmhost = Get-VMHost -Name "esxi-01.lab.local"
$cluster = Get-Cluster -Name "Production-Cluster"

$clusterView = Get-View $cluster
$hostConfig = New-Object VMware.Vim.ClusterDpmHostConfigSpec
$hostConfig.Key = $vmhost.ExtensionData.MoRef
$hostConfig.Info = New-Object VMware.Vim.ClusterDpmConfigInfo
$hostConfig.Info.Behavior = "manual"  # Override cluster-level: suggest only, no automation
$hostConfig.Info.Enabled = $true
$hostConfig.Operation = "edit"

$clusterSpec = New-Object VMware.Vim.ClusterConfigSpecEx
$clusterSpec.DpmHostConfigSpec = @($hostConfig)
$clusterView.ReconfigureComputeResource_Task($clusterSpec, $true)
Write-Host "esxi-01 set to DPM Manual override"

Testing & Monitoring

View DPM Recommendations in vSphere Client

After enabling DPM in Manual mode, go to Cluster → Monitor → vSphere DPM to see the current list of recommendations. Each recommendation shows which host is proposed for shutdown, where VMs will be migrated, and the reasoning behind DPM’s decision.

Check via PowerCLI

# See which hosts are in standby (powered down by DPM)
$cluster = Get-Cluster -Name "Production-Cluster"
Get-VMHost -Location $cluster |
    Select-Object Name, ConnectionState, PowerState |
    Format-Table -AutoSize

# View DPM event history for the past 7 days
$start = (Get-Date).AddDays(-7)
$end = Get-Date

foreach ($vmhost in (Get-VMHost -Location $cluster)) {
    $events = Get-VIEvent -Entity $vmhost -Start $start -Finish $end -Types Info |
        Where-Object { $_.FullFormattedMessage -match "DPM|standby|powered off|powered on" }
    if ($events) {
        Write-Host "`n=== $($vmhost.Name) ==="
        $events | Select-Object CreatedTime, FullFormattedMessage | Format-Table -AutoSize
    }
}

Practical Considerations

  • Boot time: Every time DPM needs to wake a host, it takes 3–10 minutes to fully boot and be ready to accept VMs. Configure the DPM threshold to trigger early enough that the host can finish booting before the cluster becomes overloaded — this is why you shouldn’t use level 5.
  • DPM and HA Admission Control: These two features interact with each other. If HA needs to reserve capacity, DPM will not shut down hosts to the point of violating the HA policy — this behavior is by design, not a bug.
  • Peak hours: Consider configuring DPM scheduled exceptions if your cluster has a clear load pattern (for example: don’t shut down any hosts between 8:00 AM–8:00 PM Monday–Friday).
  • Network requirements for WoL: Magic packets for WoL must travel over layer-2, meaning vCenter and the hosts must be on the same management subnet. If they’re on different subnets, IPMI is required.

After a few weeks running in Manual mode and observing the recommendations — if DPM’s suggestions are sensible (not shutting down hosts during peak hours, not causing VM lag when the cluster is tight) — then switch to Automatic. In an 8-server environment with nighttime load below 20%, DPM typically saves 30–50% on power consumption compared to running all hosts 24/7.

Share: