Host Reboot Stuck at "swapjob loaded sucessfully" for long time and NFS datastore unmounted after reboot
search cancel

Host Reboot Stuck at "swapjob loaded sucessfully" for long time and NFS datastore unmounted after reboot

book

Article ID: 392493

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms : 

  • During host reboot it was stuck at swapjob loaded successfully for more than one hour and after reboot NFS datastores are not visible 
  • esxcli storage nfs list was not returning any output.

Validation Steps :

  • Validate NFS server connectivity as per KB : 323107
  • When mounting the NFS datastore from UI as additional hosts and found below error "An error occurred during host configuration. Operation Failed. Diagnostics report. Failed DNS lookup:hostname -error 3"

Environment

VMware vSphere ESXI 7.x

VMware vSphere ESXI 8.x

 

Cause

  • This issue arises based on how the NFS server is specified during the mount operation to the ESXi host.

  When the NFS server is specified using an IP address:

      DNS resolution is not required. The mount operation is expected to succeed as long as the following conditions are met:

  •   The NFS server is reachable over the network
  •    Necessary network ports (typically TCP/UDP 2049) are open between the ESXi host and the NFS server.
  •   The NFS export is correctly configured to allow access from the ESXi host.

When the NFS server is specified using a hostname or Fully Qualified Domain Name (FQDN):

      DNS resolution is required for the ESXi host to resolve the NFS server name. If DNS resolution fails, the mount operation will not complete successfully. In such cases, errors similar to the following may be     observed

  • Unable to resolve hostname
  • Mount failed: Unable to connect to NFS server

Cause Validation  

Log path : less /var/run/log/hostd.log reports Failed DNS lookup: hostname

  • 2025-03-30T06:15:44.771Z info hostd[2101314] [Originator@6876 sub=Vimsvc.TaskManager opID=esxui-53e-6752 user=root] Task Completed : haTask-ha-host-vim.ho
    st.DatastoreSystem.createNasDatastore-8125 Status error
    2025-03-30T06:15:44.771Z info hostd[2101314] [Originator@6876 sub=Solo.Vmomi opID=esxui-####-####user=root] Activation finished; <<####-71b0-####-5de2
    -########, , >, ha-datastoresystem, vim.host.DatastoreSystem.createNasDatastore>
    2025-03-30T06:15:44.771Z verbose hostd[2101314] [Originator@6876 sub=Solo.Vmomi opID=####-53e-###user=root] Arg spec:
    --> (vim.host.NasVolume.Specification) {
    -->    remoteHost = "#######-esx.ops.#####.net",
    -->    remotePath = "/EsxHkg########",
    -->    localPath = "Esx#######_hkh#####",
    -->    accessMode = "readWrite",
    -->    type = "NFS",
    -->    userName = "",
    -->    password = (not shown),
    -->    remoteHostNames = (string) [
    -->       "########-esx.ops.#####.net"
    -->    ],
    -->    securityType = "AUTH_SYS"
    --> }
    2025-03-30T06:15:44.771Z info hostd[2101314] [Originator@6876 sub=Solo.Vmomi opID=####-53e-####user=root] Throw vim.fault.PlatformConfigFault
    2025-03-30T06:15:44.771Z info hostd[2101314] [Originator@6876 sub=Solo.Vmomi opID=esxui-####-####user=root] Result:
    --> (vim.fault.PlatformConfigFault) {
    -->    faultMessage = (vmodl.LocalizableMessage) [
    -->       (vmodl.LocalizableMessage) {
    -->          key = "com.vmware.esx.hostctl.default",
    -->          arg = (vmodl.KeyAnyValue) [
    -->             (vmodl.KeyAnyValue) {
    -->                key = "reason",
    -->                value = "Failed DNS lookup: hostname: #####-esx.###.#####.###, error: -3"
    -->             }
    -->          ],
    -->       }
    -->    ],
    -->    text = "",


nslookup failed for FQDN of NFS server 

  [root@####:/var/log] nslookup NFS server FQDN (esx01.####.com)
     ;; connection timed out; no servers could be reached     >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Unable to reach NFS server with FQDN 
 [root@######:/var/log]

 

Resolution

Workaround :

Add IP address and FQDN of NFS server details in /etc/hosts file of esxi host. 

Steps:

  1. Enable SSH on the ESXi host (if not already enabled).

  2. SSH into the ESXi host using an SSH client (e.g., PuTTY).

  3. Open the /etc/hosts file with a text editor such as vi:

    vi /etc/hosts 
  4. Add the IP address, FQDN, and short hostname of the NFS server in the following format:

    <IP_ADDRESS> <FQDN> <HOSTNAME>

Example Entry:

192.####.###.50 nfs01.example.local nfs01

This entry allows the ESXi host to resolve nfs01.example.local and nfs01 to the IP address 192.####.####.50 without querying DNS.

  1. Save and exit the file (Esc:wq in vi).

Resolution :

When the NFS server is specified by hostname rather than IP address, successful name resolution is a prerequisite for establishing the NFS connection. Validate and add DNS entries for NFS server to avoid this issues.