VMware ESX cmd-Line reference

Get CDP Neighbor info (http://communities.vmware.com/thread/153320):

esxcfg-info -n | less

NIC Teaming for Cisco Switches:

On ESX set “Route based on ip hash” (http://blog.scottlowe.org/2008/09/05/setting-vmware-esx-vswitch-load-balancing-policy-via-cli/):

vmware-vim-cmd /hostsvc/net/vswitch_setpolicy --nicteaming-policy=loadbalance_ip vSwitch1

Add nic to Team:
esxcfg-vswitch -L vmnic1 vSwitch1

VMware ESX 3.5 and nVidia MCP55 SATA Controller (usbid: 10de:037f)

After installation of VMware ESX 3.5 on a SunFire X2100 the machine always faulted with a root-fs error.

Looking at the VMware forums, I found a post by rpartmann who provides a script to solve this issue[1].

With the help of his script I found the relevant steps to fix this issue for me:

  • Boot into troubleshooting mode (there the SATA controller works).
  • go to /etc/vmware/pciid
  • edit sata_nv.xml
  • As last entry before </vendor> I added:
    <device id=”037f”>
    <vmware label=”scsi”>
    <name>MCP55 SATA Controller</name>
  • then I had to rebuild the PCI-ID Table:
  • regenerate the boot-filesystems:
    esxcfg-boot -r
  • reboot

Then I could start without problem on my nVidia SATA chipset.

You might need to do the same procedure after an update of VMware. Haven’t been there so far.

[1] http://communities.vmware.com/message/1011087#1011087

MySQL: Converting from latin-1 to utf-8

This week I had to switch a MySQL DB from a latin-1 host to a UTF-8 host (Webserver with Forum/CMS). I have never managed to make this work with only setting the codepages right.

I have put together a perl script that takes the databases and their tables from the one host, encodes it to UTF-8 and inserts the data in the new host.

I hope someone finds this useful: sqlcopyconv.txt

PS: You need to have all the Tables in the new DB created already. But without data.