Had a customer who wanted to remove parameters from multiple VMX files.
The parameters were added in by vShield and we were unable to power on the VM
Wrote the following script to search and remove the parameter for all the VMs registered on each ESXi host:
vmlist=`hostname`.vmlist grep -i vmx /etc/vmware/hostd/vmInventory.xml | sed 's///g' | sed 's/<\/vmxCfgPath>//g' > $vmlist for i in `cat $vmlist` do echo " " echo Filename:$i echo Backing up VMX... cp $i $i.bak echo Backup complete... echo Current Parameter: grep -i vfile $i echo Updating VMX... sed -i '/VFILE/d' $i echo Update done... echo Does the parameter exist still?: grep -i vfile $i done