Error: NoMethodError: undefined method `-@' for nil:NilClass while running "vsan.whatif_host_failures"
search cancel

Error: NoMethodError: undefined method `-@' for nil:NilClass while running "vsan.whatif_host_failures"

book

Article ID: 445955

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

  • When executing the troubleshooting command vsan.whatif_host_failures from the vCenter Ruby vSphere Console (RVC) to simulate a host failure event, the task fails immediately with a Ruby runtime error.

    /localhost/Datastore_name/computers/Cluster_name> vsan.whatif_host_failures .
    NoMethodError: undefined method `-@' for nil:NilClass
    /opt/vmware/rvc/lib/rvc/modules/vsan.rb:2553:in `block (2 levels) in whatif_host_failures'
    /opt/vmware/rvc/lib/rvc/modules/vsan.rb:2553:in `each'
    /opt/vmware/rvc/lib/rvc/modules/vsan.rb:2553:in `sort_by'
    /opt/vmware/rvc/lib/rvc/modules/vsan.rb:2553:in `block in whatif_host_failures'
    /opt/vmware/rvc/lib/rvc/generic.rb:947:in `_run_with_rev'
    /opt/vmware/rvc/lib/rvc/modules/vsan.rb:2466:in `whatif_host_failures'

Environment

VMware vSAN ESA

Cause

This behavior is by design. The RVC command vsan.whatif_host_failures is incompatible with the vSAN Express Storage Architecture (ESA).

The vsan.whatif_host_failures command was originally developed for vSAN Original Storage Architecture (OSA) clusters. It relies heavily on querying disk-group-specific telemetry counters to assess per-host data distribution and run its failure math. Because vSAN ESA utilizes a unified storage pool and completely eliminates disk groups, these legacy counters do not exist in the ESXi hypervisor layer. As a result, the RVC script receives an empty (nil) payload from the hosts, causing its underlying sorting algorithm to crash.

Resolution

To evaluate the cluster impact of a host failure or maintenance operation:

  • In vCenter UI, Navigate to Cluster > Monitor > vSAN > Data Migration Precheck. Select the specific host and its intended maintenance mode to simulate capacity thresholds safely.

    Or

  • From ESXi host CLI, run the following command.

    esxcli vsan debug evacuation precheck -e <hostname> -v

Additional Information

Check the Data Migration Capabilities of a Host in the vSAN Cluster
Understanding available "esxcli vsan debug" parameters