Corrupted esx.conf file prevents network settings from displaying

来源:互联网 发布:supermicro 知乎 编辑:程序博客网 时间:2024/06/04 22:25

Corrupted esx.conf file prevents network settings from displaying

Symptoms

  • The command esxcfg-vswitch -l does not always produce any output.
  • The file /etc/vmware/esx.conf is corrupted; it is blank or is missing information
  • vMotion fails
  • VMware Infrastructure (VI) Client does not display the network layout on the Configuration tab
  • Network changes (such as add portgroup or vswitch) do not show in the VI Client connection
  • If you refresh network settings, you see the error:

    object or item referred could not be found
     
  • ESX host network settings do not display in VI Client, even though the correct information is displayed by the commands:
    • esxcfg-vswitch -l
    • esxcfg-vswif -l
    • esxcfg-vmknic -l
       
  • SSH Connection to the ESX host is working
  • VMware High Availability (HA) fails
  • The hostd logs contain an entry similar to:

    [2008-08-04 11:50:56.177 'NetworkProvider' 3076445088 error] An error occurred while fetching virtual switch: Unable to find Vswitch configuration for vSwitch0
     
  • The vmkernel logs contain an entry similar to:

    [33555066] for VNIC vswif1
    [2008-08-04 11:41:23.730 'NetworkProvider' 3076424608 error] Cannot find portid
    Aug 4 11:46:06 bct1esx02 vmkernel: 15:01:11:46.798 cpu2:1037)Tcpip_Support: 3367: ether attach complete
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.810 cpu0:1024)Tcpip_Support: 2723: index = 10049264, ip_addr = 0xe73a260a, netmask = 0xfeffff
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.810 cpu0:1024)WARNING: Tcpip_Support: 2756: Failed to set netmask. (error = 0x11)
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.836 cpu0:1024)VMNIX: NetCos: 206: checking fea9,ffff,0
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.836 cpu0:1024)VMNIX: NetCos: 208: dup
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.836 cpu0:1024)Tcpip_Support: 2823: add dstAddr=0xfea9, netMask=0xffff, gwAddr=0x0 ifName=0x0,
     ifNameLen=0
    Aug 4 11:46:08 bct1esx02 vmkernel: 15:01:11:48.836 cpu0:1024)Tcpip: 3172: change route failed
     

Cause

This issue occurs if the esx.conf file is corrupted.

Resolution

To resolve this issue, try to restore the uncorrupted file. If you cannot restore the file, you must rebuild it. 
 
Restoring the esx.conf file for ESX 3.x and 4.x
 
To restore the esx.conf file, copy the file from /var/log/oldconf with the commands:  
  • mv /etc/vmware/esx.conf /etc/vmware/esx.conf-backup
  • cp /var/log/oldconf/esx.conf* /etc/vmware/esx.conf
  • service mgmt-vmware restart
If the backup file does not exist in /var/log/oldconf or if that file is also corrupted, you must rebuild it.

Rebuilding the esx.conf file on ESX 3.x

To rebuild the esx.conf file on ESX 3.x:

  1. Connect to the ESX host with an SSH client or connect directly to the ESX console using KVM.
  2. Back up the corrupted esx.conf file using the command:

    # cp esx.conf /tmp/esx.bad

  3. Copy the image to a temporary directory using a command similar to:

    # cp /boot/initrd-2.4.21-47.0.1.ELvmnix.img /tmp

    Note:
    The initrd version of the image is different than the ESX 3.x version. If the version in the cp /boot/initrd-2.4.21-47.0.1.ELvmnix.img /tmp command is different, cd to the /boot directory and run the ls command to see your version.

  4. Uncompress the image file using the command:

    # cd /tmp
    # gunzip -dc initrd-2.4.21-47.0.1.ELvmnix.img > initrd.unziped

  5. Make a directory and mount the uncompressed image using the commands:

    # mkdir initrd

    # mount -o loop initrd.unziped initrd

  6. Copy the esx.conf file from the mounted directory to /etc/vmware/ using the commands:

    # cd /tmp/initrd/etc/vmware
    # cp esx.conf /etc/vmware/

  7. Unmount the directory mounted in step 5 using the commands:

    # cd /tmp
    # umount /tmp/initrd

  8. Restart the management agents for the changes to take effect. For more information, see Restarting the Management agents on an ESX Server (1003490).
  9. Reconnect to your ESX host using VI Client. The network layout displays on the Configuration tab. If it does not, re-add the host in VI Client and populate the information again.
  10. When the network layout displays correctly, backup the uncorrupted esx.conf file for future use.

Rebuilding the esx.conf file on ESX 4.x:

To rebuild the esx.conf file on ESX 4.x:

  1. Copy the boot image from the /boot folder to the /tmp folder with the command:
     
    # cp /boot/initrd-2.4.21-47.0.1.ELvmnix.img /tmp
      
     
  2. Decompress the .img file and output the file to /tmp/initrd with the command: 
     
    # cd /tmp
    # mkdir initrd
    # cd initrd/
    # gunzip -c ../initrd-2.6.18-128.ESX.img | cpio -id
     
  3. Copy esx.conf to /etc/vmware with the command:
     
    # cd /tmp/initrd/etc/vmware
    # cp esx.conf /etc/vmware
     
  4. Update the boot configuration with the command:
     
    # cd /tmp
    # esxcfg-boot -b
     
  5. Reboot the host with the command:
     
    # reboot

    Note: Network settings may appear before rebooting, but VMware recommends rebooting at your earliest convenience.
原创粉丝点击