SlideShare a Scribd company logo
ESXi v4.1 Command Line Tricks You Absolutely Must Know Greg Shields Partner and Principal Technologist Concentrated Technology www.ConcentratedTech.com
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site,  www.ConcentratedTech.com .  For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
Three Parts Part 1:  Understanding the ESXi Command Line and Command-based Management Part 2:  The Linux Commands Part 3:  The VMware Commands Part 4:  vMA and Scripting
Part 1: Understanding the ESXi Command Line and Command Line Management
The ESXi Command Line ESXi ’s command line  is  Linux’s command line.
The ESXi Command Line … however, it is not enabled by default.
Part 2: The Linux Commands
The Linux Commands Basic Linux Navigation Alt-F1, Alt-F2 cd & ls find, cat, & grep tail ps kill
Locating Things with Find & Grep find . –name <something> find / -name <something> Useful for locating files on an ESXi disk. find / -name <something> | grep <something> Useful for filtering located files. Bonus points for whomever knows how  “grep” got its name…
Locating Things with Find & Grep find . –name <something> find / -name <something> Useful for locating files on an ESXi disk. find / -name <something> | grep <something> Useful for filtering located files. Bonus points for whomever knows how  “grep” got its name… Originally based on the  “ed” editor, grep is a pseudo-acronym for g/re/p or global regular expression print.
Searching Files with Grep grep <text string> <filename> This usage searches <filename> for a <text string> Useful for digging through logs grep failure /var/log/sysboot.log grep failure|failed|failtastic /var/log/sysboot.log grep -r <text string> <filepath> Recursion enables searching the contents of every file in an entire <filepath> for a <text string> grep -r failure /var/log
Reading Files with Cat and Less cat <filename> Pipe the contents of <filename> to the screen. less <filename> Pipe the contents of <filename> to the screen, but do so in a way that ’s actually usable. Return goes down one line. “ d” goes down one page. “ u” goes up one page. “ q” quits.
Reading Ends of Files with Less tail <filename> Give me the last screenful of lines of <filename> tail -10 <filename> Give me the last ten lines from <filename>
Controlling Services with… Interestingly enough, not  “service”. service is the Linux command for controlling service state Used in ESX ESXi uses a slightly different syntax. Services.sh {start|stop|restart} This command will start|stop|restart all services. cat /etc/chkconfig.db to view the service database. /etc/init.d/<servicename> restart This command restarts a single service.
Manipulating text with vi Ahhh, vi, the text editor everyone loves to hate. Big, bold, complex, oddball, challenging… Two modes:  Command and Input “ i” enters input mode.  (also “a” and “o”) “ ESC” enters command mode. Control-F and Control-B move up and down by screen. / <pattern> searches forward for a pattern. ? <pattern> searches backward for a pattern. “ x” to delete a char, “dd” to delete a line :q! exits without saving, :wq! exits with saving
File System Info with df and vdf The Linux command df displays file system information such as partitions. df cannot see into VMFS volumes. The ESX command vdf digs a bit further to gather VMFS information Both commands support the -h switch -h turns gibberish into human-readable info.
Processes with ps and kill The Linux ps command displays running processes. Most commonly used with the -ef switch, usually with grep as well. ps –ef | grep <something> Once you have a list of processes, you can kill them by Process ID. kill <processID> kill -9 <processID> (kill harder!) kill -HUP <processID> (kill and restart!)
Pinging with…uh…ping and vmkping You ’re already familiar with the ping command (we use it every day in Windows). But are you familiar with the VMware vmkping command? Uses the VMKernel ’s IP stack to another ESX host’s VMKernel port. Useful for troubleshooting vMotion and network storage issues. Similar results as ping, but down a different path.
Part 3: The VMware Commands
Swiss Army Knifing with vmkfstools Used for manipulating virtual disk files. Copying Converting Renaming Cloning Importing Exporting Resizing
Swiss Army Knifing with vmkfstools Creating file systems & virtual disks vmkfstools -C vmfs3 -b 1m -S myLabel vmhba1:3:0:1  vmkfstools -c 2G /vmfs/volumes/…/whatever.vmdk Cloning virtual disks vmkfstools -i {source} {destination} Exporting virtual disks to ext3 vmkfstools -i -d 2gbsparse {source} {destination} Extending virtual disks vmkfstools -X 12G /vmfs/volumes/…/whatever.vmdk
Swiss Army Knifing with vmkfstools New Commands in 4.1! Checking and repairing virtual disks vmkfstools --fix check /vmfs/volumes/…/whatever.vmdk vmkfstools --fix repair /vmfs/volumes/…/whatever.vmdk Getting and resetting disk UUIDs vmkfstools --miscop getuuid {vmdkFile} vmkfstools --miscop setuuid {vmdkFile}
Getting on top with esxtop The Linux top command is excellent for figuring out which process is consuming resources. top The VMware esxtop command goes a step further by digging into VMware-specific resources. esxtop Eight displays: “c” cpu, “i” interrupt, “m” memory, “n” network “d” disk adapter, “u” disk device, “v” disk VM, “p” power management
Exporting esxtop data to PerfMon Perfmon ’s graphing capabilities can be used to visualize esxtop data, with a little effort… esxtop -a -b -d {secondsBetweenCaptures} -n {numberOfCaptures} > {filename}.csv The -a in the command above captures all counters. Creates a very big file… Can impact performance… … but does let you use PerfMon to filter counters (easier).
Exporting esxtop data to PerfMon Ship esxtop data directly to Windows using ESXi ’s SMB client and a mount point… mkdir /mnt mkdir /mnt/perfmon mount -t cifs //{server}/{share} -o username={userName} password={password} /mnt/perfmon esxtop -a -b -d {secondsBetweenCaptures} -n {numberOfCaptures} > /mnt/perfmon/{filename}.csv
The esxcfg- Commands esxcfg-hwiscsi esxcfg-rescan esxcfg-info esxcfg-resgrp esxcfg-dumppart esxcfg-route esxcfg-advcfg esxcfg-scsidevs esxcfg-ipsec esxcfg-init esxcfg-pciid esxcfg-volume esxcfg-module esxcfg-swiscsi esxcfg-nics esxcfg-vmknic esxcfg-nas esxcfg-vswitch esxcfg-mpath esxcfg-secpolicy
Networking with esxcfg- Verify which physical NICs are up esxcfg-nics -l Creating a quick network connection esxcfg-vswitch -a vSwitch2 esxcfg-vswitch -L vmnic2 vSwitch2 esxcfg-vswitch -A PortGroup2 vSwitch2 esxcfg-vswitch -M vmnic2 -p PortGroup2 vSwitch2 esxcfg-vswitch -v 205 -p PortGroup2 vSwitch2 Enabling and verifying Jumbo Frames esxcfg-vswitch -m 9000 vSwitch2 esxcfg-vswitch -l
The vim-cmd Commands vimsh is an interactive shell buffer used for configuration and reporting. Vim-cmd is a wrapper for the vimsh shell. This command has different names in different versions:  vimsh, vmware-vimsh, vmware-vim-cmd Consolidates the command syntax overlap between vmware-cmd (not on ESXi) and esxcfg-*.
VM and Storage info with vim-cmd List vim-cmd commands vim-cmd Report all registered VMs vim-cmd vmsvc/getallvms  (…use this to get vmID!) Register a VM Vim-cmd solo/registervm ./whatever.vmx Gather storage information vim-cmd hostsvc/storage/info | less vim-cmd hostsvc/storage/hba_info | less vim-cmd hostsvc/storage/fs_info | less
More fun with vim-cmd Check and toggle VM power status vim-cmd vmsvc/power.getstat {vmID} vim-cmd vmsvc/power.off {vmID} vim-cmd vmsvc/power.off {vmID} Add a physical USB device to a VM /etc/init.d/usbarbitrator start vim-cmd vmsvc/device.connusbdev {vmID}  “path:1/0/0 autoclean:1” Add a license key vim-cmd vimsvc/license --set {25CharLicenseKey}
The esxcli Commands Another interactive shell framework for configuration and reporting. Modular, ability to add namespaces. Can be executed in ESX/ESXi/vCLI. Three namespaces at present: nmp, corestorage, swiscsi.
iSCSI Multipathing with esxcli Configure the LUN Create VMkernel port groups Create 1:1 vNIC->VMkernel port mappings Enable iSCSI Connect VMkernel ports to iSCSI Initiator esxcli swiscsi nic add -n {VMkPortGroup} -d vmhba33 Adjust path selection to Round Robin Create datastore
iSCSI Multipathing with esxcli
More fun with esxcli List active TCP/IP connections and ARP entries esxcli network connection list esxcli network neighbor list List running VMs & kill those non-responding esxcli vms vm list esxcli vms vm kill --world-id {worldID} --type {soft|hard|force}
Host Updates with esxupdate Installing updates from the command line is a secondary tactic when automation fails. esxupdate update –bundle=<bundlename.zip> Can even assist with (major) 4.0 to 4.1 upgrades Run the pre-upgrade, then the upgrade bundle while in maintenance mode. esxupdate update --bundle=pre-upgrade-from-ESX4.0-to-4.1.0-0.0.260247-release.zip  esxupdate update --bundle=upgrade-from-ESX4.0-to-4.1.0-0.0.260247-release.zip  reboot
Troubleshoot with vm-support Calls with VMware often require sending them a support bundle. Inside that bundle are logs, output from commands, and configuration info. vm-support will create a .tgz archive to send. Can also be used to stop stalled VMs. These VMs show resources are assigned, but don ’t appear to be running. vm-support -x then vm-support –X <worldID>. First command gets the world ID Second command kills processes of that world ID.
Part 4: The vMA and Scripting
VMware Management Assistant All of these commands are handy, but the shell is quite limiting. Needed is a command and scripting environment for managing ESX and ESXi hosts. One such environment is the vMA. Installed as a Virtual Appliance. Client/Server architecture connects to multiple machines, can work with multiple machines at once. Enables use of Perl for scripting.
Installing Because of its Virtual Appliance roots, installing the vMA requires using the vSphere Client. Ensure you connect vMA to ESXi ’s management network.
Installing and Configuring Install vMA Virtual Appliance from OVF Update VMX file to correct error scsi0.virtualDev =  “lsilogic” guestOS =  “rhel5-64″ Configure vMA at first boot Add target servers to vMA vifp addserver {serverName} Target a server to run a command against vifptarget -s {serverName} Use!  Command!  Script!
The vicfg- Commands vicfg-advcfg  vicfg-ntp vicfg-authconfig  vicfg-rescae vicfg-cfgbackup  vicfg-route vicfg-dns  vicfg-scsidevs vicfg-dumppart  vicfg-snmp vicfg-hostops  vicfg-syslog vicfg-ipsec  vicfg-user vicfg-iscsi  vicfg-vmknic vicfg-module  vicfg-volume vicfg-mpath  vicfg-vswitch vicfg-nas
Final Thoughts Linux isn ’t hard. It was just developed by some very weird people over a very long period of time. That group of people didn ’t always agree on which commands to use.  That’s why different distros use different command structures. Silly UNIX admins. Always remember two discovery commands… find / -name <something> <command> --help Those two commands will always help!
ESXi v4.1 Command Line Tricks You Absolutely Must Know Greg Shields Partner and Principal Technologist Concentrated Technology www.ConcentratedTech.com Please fill out evaluations, Do it for  the children ! !!!
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site,  www.ConcentratedTech.com .  For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
Ad

More Related Content

What's hot (18)

PowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint adminsPowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint admins
Concentrated Technology
 
Virtualization today
Virtualization todayVirtualization today
Virtualization today
Concentrated Technology
 
VM201 - IdoSphere
VM201 - IdoSphereVM201 - IdoSphere
VM201 - IdoSphere
Carl Tyler
 
How to protect an Enterprise Email and Collaboration environment using Veeam ...
How to protect an Enterprise Email and Collaboration environment using Veeam ...How to protect an Enterprise Email and Collaboration environment using Veeam ...
How to protect an Enterprise Email and Collaboration environment using Veeam ...
Jorge de la Cruz
 
Learn About Continuous Integration With Hudson Directly From the Source
Learn About Continuous Integration With Hudson Directly From the SourceLearn About Continuous Integration With Hudson Directly From the Source
Learn About Continuous Integration With Hudson Directly From the Source
Marakana Inc.
 
Vmwarepresentation1207005
Vmwarepresentation1207005Vmwarepresentation1207005
Vmwarepresentation1207005
chinitooo
 
K2000 Mac Imaging
K2000 Mac ImagingK2000 Mac Imaging
K2000 Mac Imaging
Dell World
 
Veeam back up and replication presentation
Veeam back up and replication presentation Veeam back up and replication presentation
Veeam back up and replication presentation
BlueChipICT
 
Protecting Exchange with Veeam
Protecting Exchange with VeeamProtecting Exchange with Veeam
Protecting Exchange with Veeam
Veeam Software
 
NMS Media Services Jobshet 1 to 5 Summary
NMS Media Services Jobshet 1 to 5 SummaryNMS Media Services Jobshet 1 to 5 Summary
NMS Media Services Jobshet 1 to 5 Summary
Hock Leng PUAH
 
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh KhươngKiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Lac Viet Computing Corporation
 
Squid 3 for windows blogbudaqdegil.blogspot.com
Squid 3 for windows blogbudaqdegil.blogspot.comSquid 3 for windows blogbudaqdegil.blogspot.com
Squid 3 for windows blogbudaqdegil.blogspot.com
Johan Roesdy
 
Troubleshooting K2000
Troubleshooting K2000Troubleshooting K2000
Troubleshooting K2000
Dell World
 
Modern Data Protection
Modern Data ProtectionModern Data Protection
Modern Data Protection
subtitle
 
Getting Started With Linux Administration
Getting Started With Linux AdministrationGetting Started With Linux Administration
Getting Started With Linux Administration
Edureka!
 
Zumasys Citrix Top 10 Tips and Tricks
Zumasys Citrix Top 10 Tips and TricksZumasys Citrix Top 10 Tips and Tricks
Zumasys Citrix Top 10 Tips and Tricks
Frank A. Petillo, Sr.
 
FROM PHYSICAL TO VIRTUAL, by Veeam Virtualization Professional. Yuri Sobolev.
FROM PHYSICAL TO VIRTUAL, by  Veeam Virtualization Professional. Yuri Sobolev.FROM PHYSICAL TO VIRTUAL, by  Veeam Virtualization Professional. Yuri Sobolev.
FROM PHYSICAL TO VIRTUAL, by Veeam Virtualization Professional. Yuri Sobolev.
IT-Доминанта
 
Vmware thin app architecture
Vmware thin app architectureVmware thin app architecture
Vmware thin app architecture
solarisyougood
 
PowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint adminsPowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint admins
Concentrated Technology
 
VM201 - IdoSphere
VM201 - IdoSphereVM201 - IdoSphere
VM201 - IdoSphere
Carl Tyler
 
How to protect an Enterprise Email and Collaboration environment using Veeam ...
How to protect an Enterprise Email and Collaboration environment using Veeam ...How to protect an Enterprise Email and Collaboration environment using Veeam ...
How to protect an Enterprise Email and Collaboration environment using Veeam ...
Jorge de la Cruz
 
Learn About Continuous Integration With Hudson Directly From the Source
Learn About Continuous Integration With Hudson Directly From the SourceLearn About Continuous Integration With Hudson Directly From the Source
Learn About Continuous Integration With Hudson Directly From the Source
Marakana Inc.
 
Vmwarepresentation1207005
Vmwarepresentation1207005Vmwarepresentation1207005
Vmwarepresentation1207005
chinitooo
 
K2000 Mac Imaging
K2000 Mac ImagingK2000 Mac Imaging
K2000 Mac Imaging
Dell World
 
Veeam back up and replication presentation
Veeam back up and replication presentation Veeam back up and replication presentation
Veeam back up and replication presentation
BlueChipICT
 
Protecting Exchange with Veeam
Protecting Exchange with VeeamProtecting Exchange with Veeam
Protecting Exchange with Veeam
Veeam Software
 
NMS Media Services Jobshet 1 to 5 Summary
NMS Media Services Jobshet 1 to 5 SummaryNMS Media Services Jobshet 1 to 5 Summary
NMS Media Services Jobshet 1 to 5 Summary
Hock Leng PUAH
 
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh KhươngKiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Kiến trúc mạng cho hệ thống VDI - Mr Nguyễn Phạm Vĩnh Khương
Lac Viet Computing Corporation
 
Squid 3 for windows blogbudaqdegil.blogspot.com
Squid 3 for windows blogbudaqdegil.blogspot.comSquid 3 for windows blogbudaqdegil.blogspot.com
Squid 3 for windows blogbudaqdegil.blogspot.com
Johan Roesdy
 
Troubleshooting K2000
Troubleshooting K2000Troubleshooting K2000
Troubleshooting K2000
Dell World
 
Modern Data Protection
Modern Data ProtectionModern Data Protection
Modern Data Protection
subtitle
 
Getting Started With Linux Administration
Getting Started With Linux AdministrationGetting Started With Linux Administration
Getting Started With Linux Administration
Edureka!
 
Zumasys Citrix Top 10 Tips and Tricks
Zumasys Citrix Top 10 Tips and TricksZumasys Citrix Top 10 Tips and Tricks
Zumasys Citrix Top 10 Tips and Tricks
Frank A. Petillo, Sr.
 
FROM PHYSICAL TO VIRTUAL, by Veeam Virtualization Professional. Yuri Sobolev.
FROM PHYSICAL TO VIRTUAL, by  Veeam Virtualization Professional. Yuri Sobolev.FROM PHYSICAL TO VIRTUAL, by  Veeam Virtualization Professional. Yuri Sobolev.
FROM PHYSICAL TO VIRTUAL, by Veeam Virtualization Professional. Yuri Sobolev.
IT-Доминанта
 
Vmware thin app architecture
Vmware thin app architectureVmware thin app architecture
Vmware thin app architecture
solarisyougood
 

Viewers also liked (13)

VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld
 
Linux On V Mware ESXi
Linux On V Mware ESXiLinux On V Mware ESXi
Linux On V Mware ESXi
Masafumi Ohta
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
SiliconExpert Technologies
 
Advancedtroubleshooting 101208145718-phpapp01
Advancedtroubleshooting 101208145718-phpapp01Advancedtroubleshooting 101208145718-phpapp01
Advancedtroubleshooting 101208145718-phpapp01
Suresh Kumar
 
01 t1 s2_linux_lesson1
01 t1 s2_linux_lesson101 t1 s2_linux_lesson1
01 t1 s2_linux_lesson1
Niit Care
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
VMworld 2017 vSAN Network Design
VMworld 2017 vSAN Network Design VMworld 2017 vSAN Network Design
VMworld 2017 vSAN Network Design
Cormac Hogan
 
ESX performance problems 10 steps
ESX performance problems 10 stepsESX performance problems 10 steps
ESX performance problems 10 steps
Concentrated Technology
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Suresh Kumar
 
VMworld 2017 - Top 10 things to know about vSAN
VMworld 2017 - Top 10 things to know about vSANVMworld 2017 - Top 10 things to know about vSAN
VMworld 2017 - Top 10 things to know about vSAN
Duncan Epping
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
VMworld 2017 Core Storage
VMworld 2017 Core StorageVMworld 2017 Core Storage
VMworld 2017 Core Storage
Cormac Hogan
 
Linux ppt
Linux pptLinux ppt
Linux ppt
lincy21
 
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld
 
Linux On V Mware ESXi
Linux On V Mware ESXiLinux On V Mware ESXi
Linux On V Mware ESXi
Masafumi Ohta
 
Advancedtroubleshooting 101208145718-phpapp01
Advancedtroubleshooting 101208145718-phpapp01Advancedtroubleshooting 101208145718-phpapp01
Advancedtroubleshooting 101208145718-phpapp01
Suresh Kumar
 
01 t1 s2_linux_lesson1
01 t1 s2_linux_lesson101 t1 s2_linux_lesson1
01 t1 s2_linux_lesson1
Niit Care
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
VMworld 2017 vSAN Network Design
VMworld 2017 vSAN Network Design VMworld 2017 vSAN Network Design
VMworld 2017 vSAN Network Design
Cormac Hogan
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Suresh Kumar
 
VMworld 2017 - Top 10 things to know about vSAN
VMworld 2017 - Top 10 things to know about vSANVMworld 2017 - Top 10 things to know about vSAN
VMworld 2017 - Top 10 things to know about vSAN
Duncan Epping
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
VMworld 2017 Core Storage
VMworld 2017 Core StorageVMworld 2017 Core Storage
VMworld 2017 Core Storage
Cormac Hogan
 
Linux ppt
Linux pptLinux ppt
Linux ppt
lincy21
 
Ad

Similar to Top ESXi command line v2.0 (20)

Vmware Command Line
Vmware   Command LineVmware   Command Line
Vmware Command Line
lifeit
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
FNian
 
Esx.sc.quickref
Esx.sc.quickrefEsx.sc.quickref
Esx.sc.quickref
hellocn
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
Acácio Oliveira
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
Acácio Oliveira
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - Summary
Nugroho Gito
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012
Joe Arnold
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
Gábor Nyers
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
Nugroho Gito
 
commands v2.3.1
commands v2.3.1commands v2.3.1
commands v2.3.1
Joseph Hoey
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
Jim Birch
 
Linux
LinuxLinux
Linux
Rathan Raj
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http accelerator
no no
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commands
Michael J Geiser
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
Bioinformatics and Computational Biosciences Branch
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
Masami Hiramatsu
 
Ex200
Ex200Ex200
Ex200
teguh imanto
 
Vmware Command Line
Vmware   Command LineVmware   Command Line
Vmware Command Line
lifeit
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
FNian
 
Esx.sc.quickref
Esx.sc.quickrefEsx.sc.quickref
Esx.sc.quickref
hellocn
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
Acácio Oliveira
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
Acácio Oliveira
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - Summary
Nugroho Gito
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012
Joe Arnold
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
Gábor Nyers
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
Nugroho Gito
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
Jim Birch
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http accelerator
no no
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commands
Michael J Geiser
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
Masami Hiramatsu
 
Ad

More from Concentrated Technology (20)

Wsus best practices
Wsus best practicesWsus best practices
Wsus best practices
Concentrated Technology
 
Vdi in-a-box
Vdi in-a-boxVdi in-a-box
Vdi in-a-box
Concentrated Technology
 
From VB Script to PowerShell
From VB Script to PowerShellFrom VB Script to PowerShell
From VB Script to PowerShell
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
Concentrated Technology
 
Rapidly deploying software
Rapidly deploying softwareRapidly deploying software
Rapidly deploying software
Concentrated Technology
 
PS error handling and debugging
PS error handling and debuggingPS error handling and debugging
PS error handling and debugging
Concentrated Technology
 
PowerShell crashcourse
PowerShell crashcoursePowerShell crashcourse
PowerShell crashcourse
Concentrated Technology
 
PowerShell 8tips
PowerShell 8tipsPowerShell 8tips
PowerShell 8tips
Concentrated Technology
 
PowerShell custom properties
PowerShell custom propertiesPowerShell custom properties
PowerShell custom properties
Concentrated Technology
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
Concentrated Technology
 
PowerShell and WMI
PowerShell and WMIPowerShell and WMI
PowerShell and WMI
Concentrated Technology
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
Concentrated Technology
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
Concentrated Technology
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 
Implementing dr w. hyper v clustering
Implementing dr w. hyper v clusteringImplementing dr w. hyper v clustering
Implementing dr w. hyper v clustering
Concentrated Technology
 
Iis implementation
Iis implementationIis implementation
Iis implementation
Concentrated Technology
 
Hyper v r2 deep dive
Hyper v r2 deep diveHyper v r2 deep dive
Hyper v r2 deep dive
Concentrated Technology
 
How to configure esx to pass an audit
How to configure esx to pass an auditHow to configure esx to pass an audit
How to configure esx to pass an audit
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
Concentrated Technology
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 

Top ESXi command line v2.0

  • 1. ESXi v4.1 Command Line Tricks You Absolutely Must Know Greg Shields Partner and Principal Technologist Concentrated Technology www.ConcentratedTech.com
  • 2. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com . For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
  • 3. Three Parts Part 1: Understanding the ESXi Command Line and Command-based Management Part 2: The Linux Commands Part 3: The VMware Commands Part 4: vMA and Scripting
  • 4. Part 1: Understanding the ESXi Command Line and Command Line Management
  • 5. The ESXi Command Line ESXi ’s command line is Linux’s command line.
  • 6. The ESXi Command Line … however, it is not enabled by default.
  • 7. Part 2: The Linux Commands
  • 8. The Linux Commands Basic Linux Navigation Alt-F1, Alt-F2 cd & ls find, cat, & grep tail ps kill
  • 9. Locating Things with Find & Grep find . –name <something> find / -name <something> Useful for locating files on an ESXi disk. find / -name <something> | grep <something> Useful for filtering located files. Bonus points for whomever knows how “grep” got its name…
  • 10. Locating Things with Find & Grep find . –name <something> find / -name <something> Useful for locating files on an ESXi disk. find / -name <something> | grep <something> Useful for filtering located files. Bonus points for whomever knows how “grep” got its name… Originally based on the “ed” editor, grep is a pseudo-acronym for g/re/p or global regular expression print.
  • 11. Searching Files with Grep grep <text string> <filename> This usage searches <filename> for a <text string> Useful for digging through logs grep failure /var/log/sysboot.log grep failure|failed|failtastic /var/log/sysboot.log grep -r <text string> <filepath> Recursion enables searching the contents of every file in an entire <filepath> for a <text string> grep -r failure /var/log
  • 12. Reading Files with Cat and Less cat <filename> Pipe the contents of <filename> to the screen. less <filename> Pipe the contents of <filename> to the screen, but do so in a way that ’s actually usable. Return goes down one line. “ d” goes down one page. “ u” goes up one page. “ q” quits.
  • 13. Reading Ends of Files with Less tail <filename> Give me the last screenful of lines of <filename> tail -10 <filename> Give me the last ten lines from <filename>
  • 14. Controlling Services with… Interestingly enough, not “service”. service is the Linux command for controlling service state Used in ESX ESXi uses a slightly different syntax. Services.sh {start|stop|restart} This command will start|stop|restart all services. cat /etc/chkconfig.db to view the service database. /etc/init.d/<servicename> restart This command restarts a single service.
  • 15. Manipulating text with vi Ahhh, vi, the text editor everyone loves to hate. Big, bold, complex, oddball, challenging… Two modes: Command and Input “ i” enters input mode. (also “a” and “o”) “ ESC” enters command mode. Control-F and Control-B move up and down by screen. / <pattern> searches forward for a pattern. ? <pattern> searches backward for a pattern. “ x” to delete a char, “dd” to delete a line :q! exits without saving, :wq! exits with saving
  • 16. File System Info with df and vdf The Linux command df displays file system information such as partitions. df cannot see into VMFS volumes. The ESX command vdf digs a bit further to gather VMFS information Both commands support the -h switch -h turns gibberish into human-readable info.
  • 17. Processes with ps and kill The Linux ps command displays running processes. Most commonly used with the -ef switch, usually with grep as well. ps –ef | grep <something> Once you have a list of processes, you can kill them by Process ID. kill <processID> kill -9 <processID> (kill harder!) kill -HUP <processID> (kill and restart!)
  • 18. Pinging with…uh…ping and vmkping You ’re already familiar with the ping command (we use it every day in Windows). But are you familiar with the VMware vmkping command? Uses the VMKernel ’s IP stack to another ESX host’s VMKernel port. Useful for troubleshooting vMotion and network storage issues. Similar results as ping, but down a different path.
  • 19. Part 3: The VMware Commands
  • 20. Swiss Army Knifing with vmkfstools Used for manipulating virtual disk files. Copying Converting Renaming Cloning Importing Exporting Resizing
  • 21. Swiss Army Knifing with vmkfstools Creating file systems & virtual disks vmkfstools -C vmfs3 -b 1m -S myLabel vmhba1:3:0:1 vmkfstools -c 2G /vmfs/volumes/…/whatever.vmdk Cloning virtual disks vmkfstools -i {source} {destination} Exporting virtual disks to ext3 vmkfstools -i -d 2gbsparse {source} {destination} Extending virtual disks vmkfstools -X 12G /vmfs/volumes/…/whatever.vmdk
  • 22. Swiss Army Knifing with vmkfstools New Commands in 4.1! Checking and repairing virtual disks vmkfstools --fix check /vmfs/volumes/…/whatever.vmdk vmkfstools --fix repair /vmfs/volumes/…/whatever.vmdk Getting and resetting disk UUIDs vmkfstools --miscop getuuid {vmdkFile} vmkfstools --miscop setuuid {vmdkFile}
  • 23. Getting on top with esxtop The Linux top command is excellent for figuring out which process is consuming resources. top The VMware esxtop command goes a step further by digging into VMware-specific resources. esxtop Eight displays: “c” cpu, “i” interrupt, “m” memory, “n” network “d” disk adapter, “u” disk device, “v” disk VM, “p” power management
  • 24. Exporting esxtop data to PerfMon Perfmon ’s graphing capabilities can be used to visualize esxtop data, with a little effort… esxtop -a -b -d {secondsBetweenCaptures} -n {numberOfCaptures} > {filename}.csv The -a in the command above captures all counters. Creates a very big file… Can impact performance… … but does let you use PerfMon to filter counters (easier).
  • 25. Exporting esxtop data to PerfMon Ship esxtop data directly to Windows using ESXi ’s SMB client and a mount point… mkdir /mnt mkdir /mnt/perfmon mount -t cifs //{server}/{share} -o username={userName} password={password} /mnt/perfmon esxtop -a -b -d {secondsBetweenCaptures} -n {numberOfCaptures} > /mnt/perfmon/{filename}.csv
  • 26. The esxcfg- Commands esxcfg-hwiscsi esxcfg-rescan esxcfg-info esxcfg-resgrp esxcfg-dumppart esxcfg-route esxcfg-advcfg esxcfg-scsidevs esxcfg-ipsec esxcfg-init esxcfg-pciid esxcfg-volume esxcfg-module esxcfg-swiscsi esxcfg-nics esxcfg-vmknic esxcfg-nas esxcfg-vswitch esxcfg-mpath esxcfg-secpolicy
  • 27. Networking with esxcfg- Verify which physical NICs are up esxcfg-nics -l Creating a quick network connection esxcfg-vswitch -a vSwitch2 esxcfg-vswitch -L vmnic2 vSwitch2 esxcfg-vswitch -A PortGroup2 vSwitch2 esxcfg-vswitch -M vmnic2 -p PortGroup2 vSwitch2 esxcfg-vswitch -v 205 -p PortGroup2 vSwitch2 Enabling and verifying Jumbo Frames esxcfg-vswitch -m 9000 vSwitch2 esxcfg-vswitch -l
  • 28. The vim-cmd Commands vimsh is an interactive shell buffer used for configuration and reporting. Vim-cmd is a wrapper for the vimsh shell. This command has different names in different versions: vimsh, vmware-vimsh, vmware-vim-cmd Consolidates the command syntax overlap between vmware-cmd (not on ESXi) and esxcfg-*.
  • 29. VM and Storage info with vim-cmd List vim-cmd commands vim-cmd Report all registered VMs vim-cmd vmsvc/getallvms (…use this to get vmID!) Register a VM Vim-cmd solo/registervm ./whatever.vmx Gather storage information vim-cmd hostsvc/storage/info | less vim-cmd hostsvc/storage/hba_info | less vim-cmd hostsvc/storage/fs_info | less
  • 30. More fun with vim-cmd Check and toggle VM power status vim-cmd vmsvc/power.getstat {vmID} vim-cmd vmsvc/power.off {vmID} vim-cmd vmsvc/power.off {vmID} Add a physical USB device to a VM /etc/init.d/usbarbitrator start vim-cmd vmsvc/device.connusbdev {vmID} “path:1/0/0 autoclean:1” Add a license key vim-cmd vimsvc/license --set {25CharLicenseKey}
  • 31. The esxcli Commands Another interactive shell framework for configuration and reporting. Modular, ability to add namespaces. Can be executed in ESX/ESXi/vCLI. Three namespaces at present: nmp, corestorage, swiscsi.
  • 32. iSCSI Multipathing with esxcli Configure the LUN Create VMkernel port groups Create 1:1 vNIC->VMkernel port mappings Enable iSCSI Connect VMkernel ports to iSCSI Initiator esxcli swiscsi nic add -n {VMkPortGroup} -d vmhba33 Adjust path selection to Round Robin Create datastore
  • 34. More fun with esxcli List active TCP/IP connections and ARP entries esxcli network connection list esxcli network neighbor list List running VMs & kill those non-responding esxcli vms vm list esxcli vms vm kill --world-id {worldID} --type {soft|hard|force}
  • 35. Host Updates with esxupdate Installing updates from the command line is a secondary tactic when automation fails. esxupdate update –bundle=<bundlename.zip> Can even assist with (major) 4.0 to 4.1 upgrades Run the pre-upgrade, then the upgrade bundle while in maintenance mode. esxupdate update --bundle=pre-upgrade-from-ESX4.0-to-4.1.0-0.0.260247-release.zip esxupdate update --bundle=upgrade-from-ESX4.0-to-4.1.0-0.0.260247-release.zip reboot
  • 36. Troubleshoot with vm-support Calls with VMware often require sending them a support bundle. Inside that bundle are logs, output from commands, and configuration info. vm-support will create a .tgz archive to send. Can also be used to stop stalled VMs. These VMs show resources are assigned, but don ’t appear to be running. vm-support -x then vm-support –X <worldID>. First command gets the world ID Second command kills processes of that world ID.
  • 37. Part 4: The vMA and Scripting
  • 38. VMware Management Assistant All of these commands are handy, but the shell is quite limiting. Needed is a command and scripting environment for managing ESX and ESXi hosts. One such environment is the vMA. Installed as a Virtual Appliance. Client/Server architecture connects to multiple machines, can work with multiple machines at once. Enables use of Perl for scripting.
  • 39. Installing Because of its Virtual Appliance roots, installing the vMA requires using the vSphere Client. Ensure you connect vMA to ESXi ’s management network.
  • 40. Installing and Configuring Install vMA Virtual Appliance from OVF Update VMX file to correct error scsi0.virtualDev = “lsilogic” guestOS = “rhel5-64″ Configure vMA at first boot Add target servers to vMA vifp addserver {serverName} Target a server to run a command against vifptarget -s {serverName} Use! Command! Script!
  • 41. The vicfg- Commands vicfg-advcfg vicfg-ntp vicfg-authconfig vicfg-rescae vicfg-cfgbackup vicfg-route vicfg-dns vicfg-scsidevs vicfg-dumppart vicfg-snmp vicfg-hostops vicfg-syslog vicfg-ipsec vicfg-user vicfg-iscsi vicfg-vmknic vicfg-module vicfg-volume vicfg-mpath vicfg-vswitch vicfg-nas
  • 42. Final Thoughts Linux isn ’t hard. It was just developed by some very weird people over a very long period of time. That group of people didn ’t always agree on which commands to use. That’s why different distros use different command structures. Silly UNIX admins. Always remember two discovery commands… find / -name <something> <command> --help Those two commands will always help!
  • 43. ESXi v4.1 Command Line Tricks You Absolutely Must Know Greg Shields Partner and Principal Technologist Concentrated Technology www.ConcentratedTech.com Please fill out evaluations, Do it for the children ! !!!
  • 44. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com . For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC

Editor's Notes

  • #2: MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #44: MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.