To resolve this issue, restore the uncorrupted file. If you are unable to 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:
-
Connect to the ESX host with an SSH client or connect directly to the ESX console using KVM.
-
Back up the corrupted esx.conf file using the command:
# cp esx.conf /tmp/esx.bad
-
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.
-
Uncompress the image file using the command:
# cd /tmp
# gunzip -dc initrd-2.4.21-47.0.1.ELvmnix.img > initrd.unziped
-
Make a directory and mount the uncompressed image using the commands:
# mkdir initrd
# mount -o loop initrd.unziped initrd
-
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/
-
Unmount the directory mounted in step 5 using the commands:
# cd /tmp
# umount /tmp/initrd
-
-
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.
-
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:
-
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
-
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
-
Copy esx.conf to /etc/vmware with the command:
# cd /tmp/initrd/etc/vmware
# cp esx.conf /etc/vmware
-
Update the boot configuration with the command:
# cd /tmp
# esxcfg-boot -b
-
Reboot the host with the command:
# reboot
Note: Network settings may appear before rebooting, but VMware recommends rebooting at your earliest convenience.