Quickly add multiple lines to a vmx file

On a customer site I had to add multiple lines (CPU mask)to more than 30 virtual machines configuration files (vmx).
Of course you can vi to every vmx file and add the lines, but this consumes a lot of time! So I search for a easier (less time consuming) option.
The method I found is maybe not the most complex or nice one, but it works.
I just use the echo command on the prompt. The syntac is:

echo -n ‘line1nline2nline3’ >> vm.vmx

I guess you all now what echo does:-) The -n option witch enables interpretation of backslash escapes(which is off by default). Replace line1, line2 and line3 with your own text line. The n option gives a new line. The >> vm.vmx option tells bash to add the lines produced by echo on the end of the vmx file.

So a command could be:

echo -e ‘cpuid.1.ecx = “——–0–00——————-“ncpuid.80000001.eax = “——————————–“ncpuid.80000001.eax.amd = “——————————–“ncpuid.80000001.ebx = “——————————–“ncpuid.80000001.ebx.amd = “——————————–“ncpuid.80000001.ecx = “——————————–“ncpuid.80000001.ecx.amd = “——————————–“ncpuid.80000001.edx = “—-0——H——————–“ncpuid.80000001.edx.amd = “———–H——————–“‘ >> vm.vmx

Maybe there is a nicer solution, if so let me known!

A specified parameter was not correct. Vim.Host.VirtualSwitch.LinkDiscoveryProtocolConfig

I’m getting this error when I wanted to remove a vmnic from a virtual switch

After some debuging and a search on google I discoverd the there was a option missing in the /etc/vmware/esx.conf file. How come? This server was upgraded from a ESX 3 to vSphere 4.

So how can I get ride of this error? Simple just give the following command:

esxcfg-vswitch -B both vSwitch0

Make sure you replace vSwitch0 with the name of your virtual switch! There is no need to reboot the server.

Also make sure you refresh the view in the vSphere client before make new changes to the network config.