Monday, March 22, 2010

Favourite ESX Commands

man

ls -al

lsof - list open files

esxtop
c = cpu stats
m = memory
n = network
d = disk
u = disk device (new in 3.5)
v = disk VM (new in 3.5)
s = change update interval (min = 2seconds)
f = choose fields (interactive selection)

esxcfg

lspci - list all pci devices

date

View Volume sizes, Used and Available space
vdf -h (h is 'human readable')
This is an ESX version of the linux DF command. The same command options and syntax applies.

command "| more" one page at a time

command "| grep string" = search output for string

vmkping = ping from the kernel nic
(ping command uses service console interface)

change password
pwd

---------------------------
configure ssh to allow the root user to login Update the ssh configuration file:
vi /etc/ssh/sshd_config

PermitRootLogin yes

Restart the sshdaemon:
service sshd restart

[login over SSH (e.g. Putty or SecureCRT) with a non root account and then SU to super user into root mode].
----------------------------

clear = clear the screen

vmware -v = version

df = disk usage

vdf -h = vhdk disk usage

passwd user = change password for user

useradd test10 = add a new user with username test10

last reboot

last = last users

esxcfg-nics -l
show physical nics and speed

esxcfg-vswif -l
show console ports

esxcfg-vswitch -l
show virtual switches

display cpu and memory usage
top
to quit type q enter

kudzu - detects and configures new hardware
-s runs in safe mode - doesnt disturb hardware.
updates the file /etc/sysconfig/hwconf (currently installed hardware)

cat - equivalent to type command in dos - prints a file to the standard output

Linux Permissions (view using ls -l)
TypeReadWriteExecuteReadWriteExecuteReadWriteExecute
drwx
rwx
rwx

Type can be:
d = directory
l = symbolic link
s = socket
p = named pipe
- = regular file
c= character (unbuffered) device file special
b=block (buffered) device file special

1st rwx = permissions for the owner of the file
2nd rwx = permissions for the group owning the file
3rd rwx = permissions for all other users

nano - text editor similar to VI
Ctrl + X to quit.

Nameserver info held in file:
/etc/resolv.conf

Hosts file
/etc/hosts

See iScsi connections:
cat /proc/scsi/iscsi_vmk/5

Clone a vmdk
vmkfstools -i original.vmdk new.vmdk

-d - optionally specify a disk format (e.g vmfs, thin).

No comments: