Information:
Below is a collection of useful VMWare ESX Commands to perform various activities from the command line.
1) Configure Service Console VLAN ID
a. esxcfg-vswitch –p “Service Console” –v # vSwitch0
b. Where # is the VLAN ID; only one VLAN ID is allowed
2) Change Service Console IP Address
a. Delete existing Service Console Switch
i. esxcfg-vswif -d vswif0
ii. will return a message about “nothing to flush” if successful
b. Create the new Service Console Switch and IP Address
i. esxcfg-vswif -a vswif0 -p “Service Console” -i 10.10.10.10 –n 255.255.255.0
1. Change IP address and network mask as needed.
c. Update the Hosts file
i. Cd /etc
ii. vi hosts (edit hosts file)
iii. ESC R (enter replace text mode)
iv. Change the IP address of the host to the one just configured.
v. ESC (to stop editing)
vi. ESC :wq! (to save file)
d. If the new IP Address is on a different network the default gateway will need to be changed
i. Cd /etc/sysconfig
ii. vi network (edit network file)
iii. ESC R (enter replace text mode)
iv. Change the GATEWAY=10.10.10.10 line as needed
v. ESC (to stop editing)
vi. ESC :wq! (to save file)
e. Reboot the ESX Host
i. Type: reboot
3) Rename VMDK files
a. Change to the appropriate folder and issue
i. vmkfstools -E filename.vmdk newfilename.vmdk
b. From any location using absolute paths
i. vmkfstools -E /vmfs/volumes/[datastore]/[folder]/filename.vmdk /vmfs/volumes/[datastore]/[folder]/newfilename.vmdk
ii. [] = user supplied name do not include the brackets in the command
4) Copy VMDK files from one location to another
a. Change to the appropriate folder and issue
i. vmkfstools –i filename.vmdk /vmfs/volumes/[datastore]/[folder]/filename.vmdk
1. Copies the local file to the remote location
ii. vmkfstools –i /vmfs/volumes/[datastore]/[folder]/filename.vmdk ./filename.vmdk
1. Copies the remote file to the local directory
b. From any location to any location using absolute paths
i. vmkfstools –i /vmfs/volumes/[datastore]/[folder]/filename.vmdk /vmfs/volumes/[datastore]/[folder]/filename.vmdk
5) Delete an VMDK file
a. Change to the appropriate folder and issue
i. vmkfstools –U filename.vmdk
b. From any location using absolute paths
i. vmkfstools –U /vmfs/volumes/[datastore]/[folder]/filename.vmdk