VMware

Jonathan Marrott's VM Scripting Blog

A swell blog containing some of the scripts I have written for VM management.

3 Posts tagged with the vimsh tag
5

Enable VMotion on VMKernel port

Posted by froboy Jan 18, 2008

This will enable VMotion on a VMKernel port. I am writing this one because it changed between verisons of ESX. This command uses the very useful vimsh.

ESX 3.0.x:
vimsh -n -e "/hostsvc/vmotion/vnic_set portgroup2"
portgroup# - Determined by the order of portgroup creation. The system automatically makes one to begin with.

ESX 3.5:
vimsh -n -e "/hostsvc/vmotion/vnic_set vmk0"
vmk# - Determined by the order of the VMKernel port creation. The first one created is '0'.

5 Comments Permalink
0

DNS - Set Servers (Updated)

Posted by froboy Jan 18, 2008

Simple script to set DNS servers. This sets muplitle DNS servers while kickstart by default only sets one.

Set DNS servers using vimsh:
vimsh -n -e "/hostsvc/net/dns_set --dns-addresses=192.168.0.1,192.168.0.2 --dns-searchdomain=yourdomain.com"

Set DNS servers by manually creating resolv.conf:
cat > /etc/resolv.conf << EOF1

search yourdomain.com
nameserver 192.168.0.4
nameserver 192.168.0.6

EOF1

0 Comments Permalink
4

The service console memory should be increased if you are running apps other than the default install. This includes management agents, backups, etc. Here is a simple command that I ran across to accomplish this. It requires a reboot to take effect. I incorporate this in my kickstart script. Don't forget to set your swap partition to be 2x the Service Console memory.

See Current Setting:
The setting shown is in bytes (MB * 1024 * 1024)
vimsh -n -e "/hostsvc/memoryinfo"
serviceConsoleReserved - Current setting
serviceConsoleReservedCfg - Setting after next reboot

Set to 800MB with vimsh:
vimsh -n -e "/hostsvc/memoryinfo 838860800"

Set by manual edit of files:
mv -f /etc/vmware/esx.conf /tmp/esx.conf.bak
sed -e 's/boot\/memSize = \"272\"/boot\/memSize = \"512\"/g' /tmp/esx.conf.bak >> /etc/vmware/esx.conf

mv -f /boot/grub/grub.conf /tmp/grub.conf.bak
sed -e 's/uppermem 277504/uppermem 523264/g' -e 's/mem=272M/mem=512M/g' /tmp/grub.conf.bak >> /boot/grub/grub.conf

If you feel like setting it to the maximum of 800 MB.

mv -f /etc/vmware/esx.conf /tmp/esx.conf.bak
sed -e 's/boot\/memSize = \"272\"/boot\/memSize = \"800\"/g' /tmp/esx.conf.bak >> /etc/vmware/esx.conf

mv -f /boot/grub/grub.conf /tmp/grub.conf.bak
sed -e 's/uppermem 277504/uppermem 818176/g' -e 's/mem=272M/mem=800M/g' /tmp/grub.conf.bak >> /boot/grub/grub.conf

4 Comments Permalink
Click to view froboy's profile Member since: Jun 26, 2006

A swell blog containing some of the scripts I have written for VM management.

View froboy's profile

Communities