Powering on VMs on a vSAN 2-node ROBO cluster fails with error "Failed to create swap file".
search cancel

Powering on VMs on a vSAN 2-node ROBO cluster fails with error "Failed to create swap file".

book

Article ID: 438251

calendar_today

Updated On:

Products

VMware vSAN VMware vSphere ESXi

Issue/Introduction

Symptoms : 

  • Powering on virtual machines on a vSAN 2-node ROBO cluster fails with the following error:

    Module VM on power on failed. Failed to start the virtual machine. Failed to power on VM. Could not power on virtual machine: Failure. Failed to create swap file "/vmfs/volumes/vsan:################-################/########-####-####-####-############/#######-#####.vswp'

  • vSAN Skyline Health reports the following errors:
    • vSAN: Basic (unicast) connectivity check 
    • vSAN : MTU check (ping with large packet size)
    • vSAN cluster partition
    • vSAN object health
    • Stats DB object

  • Under vSAN Skyline Health, selecting the Troubleshoot option for the "vSAN: Basic (unicast) connectivity check" confirms that the witness cannot communicate with one specific host in the cluster, though communication between the witness and the other host remains functional.


    In this example: Witness is failing to communicate to Host-1.

Environment

VMware vSAN

Cause

  • To successfully power on a virtual machine, a healthy virtual machine swap file must be created. For this creation to succeed, all hosts required to satisfy the assigned storage RAID policy must have proper communication.

    In this scenario

    The witness host fails to communicate with one of the data nodes. This network partition prevents the virtual machine swap file creation, causing the VM power-on to fail. The witness communication failure occurs because vSAN witness traffic is not enabled on the affected data node's VMkernel adapter.

Cause Validation:

  • Log in to the witness host via SSH and run the following command to identify data node IPs configured for communication:

    esxcli vsan cluster unicastagent list
    NodeUuid                              IsWitness  Supports Unicast  IP Address     Port  Iface Name  Cert Thumbprint                                                                                  SubClusterUuid
    ------------------------------------  ---------  ----------------  ------------  -----  ----------  -----------------------------------------------------------------------------------------------  --------------
    Host-1 UUID                                   0              true  ###.##.#.AA   #####              ##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##  ########-####-####-####-############
    Host-2 UUID                                   0              true  ###.##.#.BB   #####              ##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##  ########-####-####-####-############

  • Log in to the affected data node via SSH and run the following command to identify the VMkernel adapter configured for the IP mentioned above:

    esxcfg-vmknic -l |grep -i "###.##.#.AA"
    Interface  Port Group/DVPort/Opaque Network        IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type                NetStack
    vmk0       ####                                    IPv4      ###.##.#.AA                             ###.###.###.### ###.##.#.###    ##:##:##:##:##:## ####    #####     true    STATIC              defaultTcpipStack

    In this example: The IP "###.##.##.AA" is configured on VMK0 on Host-1. 

  • Run the following command on the non working host to confirm that vSAN witness traffic is not enabled on the correct VMkernel adapter (e.g., vmk0), and only vSAN traffic is enabled (e.g., vmk2):

    esxcli vsan network list
    Interface
       VmkNic Name: vmk2
       IP Protocol: IP
       Interface UUID: ########-####-####-####-############
       Agent Group Multicast Address: ###.#.#.#
       Agent Group IPv6 Multicast Address: ####::#:#:#
       Agent Group Multicast Port: #####
       Master Group Multicast Address: ###.#.#.#
       Master Group IPv6 Multicast Address: ####::#:#:#
       Master Group Multicast Port: #####
       Host Unicast Channel Bound Port: #####
       Data-in-Transit Encryption Key Exchange Port: 0
       Multicast TTL: 5
       Traffic Type: vsan

  • Running the same command on the working host confirms that both vSAN and witness traffics are enabled (witness traffic is enabled on vmk0 and vSAN traffic is enabled on vmk2).

    esxcli vsan network list
    Interface
       VmkNic Name: vmk2
       IP Protocol: IP
       Interface UUID: ########-####-####-####-############
       Agent Group Multicast Address: ###.#.#.#
       Agent Group IPv6 Multicast Address: ####::#:#:#
       Agent Group Multicast Port: #####
       Master Group Multicast Address: ###.#.#.#
       Master Group IPv6 Multicast Address: ####::#:#:#
       Master Group Multicast Port: #####
       Host Unicast Channel Bound Port: #####
       Data-in-Transit Encryption Key Exchange Port: 0
       Multicast TTL: 5
       Traffic Type: vsan

    Interface
       VmkNic Name: vmk0
       IP Protocol: IP
       Interface UUID: ########-####-####-####-############
       Agent Group Multicast Address: ###.#.#.#
       Agent Group IPv6 Multicast Address: ####::#:#:#
       Agent Group Multicast Port: #####
       Master Group Multicast Address: ###.#.#.#
       Master Group IPv6 Multicast Address: ####::#:#:#
       Master Group Multicast Port: #####
       Host Unicast Channel Bound Port: #####
       Data-in-Transit Encryption Key Exchange Port: 0
       Multicast TTL: 5
      Traffic Type: witness

Resolution

To resolve this issue, enable vSAN witness traffic on the appropriate VMkernel adapter for the affected host:

  1. Log into the vCenter UI with administrator credentials.
  2. Navigate to the affected host and select Configure > Networking > VMkernel adapters.
  3. Select the relevant VMkernel adapter.
  4. Click the ellipsis (...) for the selected adapter and click Edit.
  5. Select the checkbox for vSAN witness traffic.
  6. Click OK to save the changes.