VMware Cloud Community
Heyram
Contributor
Contributor

VMware - ESX Commands

Hi,

What all the commands that can be used in ESX Server & what purpose?

Thanks,

Heyram

0 Kudos
5 Replies
rriva
Expert
Expert

Some of most used (by me ...).

#Enter into Maintenance Mode

vimsh -n -e /hostsvc/maintenance_mode_enter

#Exit from Maintenance Mode

vimsh -n -e /hostsvc/maintenance_mode_exit

#Checking Maintenance Mode

vimsh -n -e /hostsvc/runtimeinfo | grep inMaintenanceMode | awk ‘{print $3}’

#Temporarily open all ports through the ESX firewall:

esxcfg-firewall -allowIncoming

esxcfg-firewall -allowOutgoing

#Enable services through the ESX firewall:

esxcfg-firewall -e sshClient

esxcfg-firewall -e ntpClient

#Unload the VMFS-2 module to improve LUN and volume scan speed and improve overall performance:

vmkload_mod -u vmfs2

#Ensure the firewall is enabled and running before final build completion:

service firewall start

esxcfg-firewall -blockIncoming

esxcfg-firewall -blockOutgoing

#create portgroup for the Production VLAN and tag with id: 2 because this is configured as the native VLAN

esxcfg-vswitch -A LAN vm_switch0

esxcfg-vswitch -p LAN vm_switch0 -v 2

#Configure time zone and NTP:

cp /etc/ntp.conf /etc/ntp.orig

ln -sf /usr/share/zoneinfo/Europe/Italy /etc/localtime

echo “server 0.vmware.pool.ntp.org” >> /etc/ntp.conf

echo “server 0.vmware.pool.ntp.org” >> /etc/ntp/step-tickers

esxcfg-firewall -e ntpClient

chkconfig –level 345 ntpd on

service ntpd restart

hwclock –systohc

#SAN multipathing best practice:

esxcfg-advcfg -s 1 /Disk/UseLunReset

esxcfg-advcfg -s 0 /Disk/UseDeviceReset

service mgmt-vmware restart

#Set Disk.MaxLUN to 40 to reduce rescan time:

esxcfg-advcfg -s 40 /Disk/MaxLUN

service mgmt-vmware restart

#Inject install completion date/time stamp into Message Of The Day:

dateTime=`date ‘+%c’`

echo “Built on “$dateTime” by Riccardo Riva.” > /etc/motd

Bye

Riccardo Riva

VCP,RHCE,FCNSA

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Thank You!

RRiva | http://about.me/riccardoriva | http://www.riccardoriva.com
0 Kudos
java_cat33
Virtuoso
Virtuoso

Take a look at Mike Lavericks guide - it's based upon an ESX server with a service console.

0 Kudos
Lightbulb
Virtuoso
Virtuoso

0 Kudos
depping
Leadership
Leadership

http://www.vmware.com/support/pubs/vi_pages/vi_pubs_35u2.html

http://www.esxguide.com/esx/content/view/2/25/

Duncan

VMware Communities User Moderator | VCP | VCDX

-


Blogging: http://www.yellow-bricks.com

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
ShanVMLand
Expert
Expert

Among these replies, I herewith attached PDF for quick reference.

Shan

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
0 Kudos