ESX Commands – esxcfg-nas

esxcfg-nas

Standard use of this command is to add or list your NFS mounts.

List: esxcfg-nas –l

Add: esxcfg-nas –a –o <host> -s <share> <name>

Not much more I can say. A little more detail here:

http://b2v.co.uk/b2vguide2vmware3.htm

A thread in the communities about a problem someone had where the nfsclient wasn’t loaded:
http://communities.vmware.com/message/864559

So go out and add some NFS datastores!

ESX Commands – esxcfg-mpath

It has been almost 1 year since I started looking at the esxcfg-* commands. It initially came as a look at the first part of the Enterprise Administration Exam’s Blueprint very first bullet point. In that post I talked about using esxcfg-mpath to identify which luns are fiber, iSCSI, NFS or local.

Today lets look a little bit deeper at the command and how it can be used to help you day to day.

esxcfg-mpath-picWe can always use esxcfg-mpath -l to list all of the luns and their paths. A good thing to check here is that you have the same number of paths to each datastore that comes from the SAN. You may have a zoning issue if a certain lun can only be seen from 1 path rather than all of them. In general each hba will see the lun through each controller in an active active type fiber channel SAN. So hba A should see the lun from Controller A and B. Likewise, hba B should see Controller A and B for a total of 4 paths. If you are using fixed or MRU as the pathing policy only one will be active but esxcfg-mpath -l will show four paths.

Of course if you have more hbas and controllers you will have more paths.

You can follow the examples given by the esxcfg-mpath -h to get help. One useful tool is to create a crude script using esxcfg-mpath –policy with the –lun tag to change the policy from say MRU to Fixed. I am not a perl scripter and I sure someone already has a real shell or perl script to set the policy but I do like to prepare multiple command in notepad then paste them into the cli.

esxcfg-mpath –policy=fixed –lun=vmhba0:0:1
esxcfg-mpath –policy=fixed –lun=vmhba0:0:2
and so on…

Then try to feel really smart by alternating the paths so every fourth lun will use different paths.

esxcfg-mpath –path=vmhba1:0:1 –lun=vmhba0:0:1 –state=on
esxcfg-mpath –path=vmhba2:0:1 –lun=vmhba0:0:2 –state=on
esxcfg-mpath –preferred –path=vmhba1:0:1 –lun=vmhba0:0:1
esxcfg-mpath –preferred –path=vmhba2:0:1 –lun=vmhba0:0:2

The first two lines set the path for the respective luns to different hbas. The last two lines set the preferred path to that same port on the hba. So when there is failover the path will fail back to your set config when all is well.

Renewing the Push

It isn't time to freak out. Yet.Well I passed the VCP 4 and my CCNA expired (can’t get around to renewing it). At work I did the VTSP as required by the partner program. Since I am in a test taking grove I think I need to push to passing the Enterprise Administration Exam. There was a series I started a while back on command line management of ESX. So like several others I will set my next goal at the Enterprise Administration Exam.

Here are some good sites I have recently seen on studying for the Exam.

VCDX Study Guides
Simon Long’s Site
follow @vcdx001 on twitter he is giving hints about the design defense, great info, but don’t want to get too far ahead of myself.

I think for this first test you just have to know what you are doing with VI 3. My big problem is having worked with vSphere for a couple months now I hope that doesn’t hurt me.

It isn’t time to freak out. Yet.

Time to Study for the VCP 4

Well, before I can get to the VCDX Enterprise Administration Exam it becomes more urgent to get the new VCP for vSphere (aka VCP4).

VCP 4 Blueprint

Simon Long has a practice test on his Slog.

Keep check the practice test site, he has added to it a couple times. I really like practice tests. Helps me know if I know what I am doing. Many times scheduling the exam for me comes down to confidence, I hate to waste $175- $225.

Now to remember how much Memory is required for the vCenter Server…

Rescan All Hba’s Where are you?

So I was updating some of my blog posts on the esxcfg-* commands with any changes in ESX 4. I wrote earlier I did not know much about the esxcfg-advcfg command. Since writing that post at the end of 2008, I found Duncan Epping used esxcfg-advcfg in 3.5 to set the option rescan all the Hba’s. I thought this was a great shortcut and decided to try it out in vSphere but:

[root@esx4 ~]# esxcfg-advcfg -s 1 /Scsi/ScsiRescanAllHbas
Exception occured: Unable to find option ScsiRescanAllHbas

So I looked through vCenter 4 and did not find the option under Scsi I looked around some in the other Advanced Options and it is no where to be found.

Has this been removed or moved somewhere else? If you know hit me up on twitter @2vcps

ESX Commands – esxcfg-module

After the last two entries being somewhat boring and not useful at least in my opinion. I am glad this command has a little more to it.

[root@esx1 root]# esxcfg-module -h
Usage: esxcfg-module
-g–get-options Get the options for a given module and whether it is loaded on boot.
-s–set-options Set the options for a given module. WARNING this may be overwritten by per device options.
-e–enable Enable a given module, indicating it should be loaded on boot.
-d–disable Disable a given module, indicating it should not be loaded on boot.
-q–query Query enabled modules options.
-l–list List all modules and whether they are enabled.
-h–help Show this message.
[root@esx1 root]# esxcfg-module -l
Device Driver Modules
Module Enabled Loaded
vmklinux true true
cciss true true
tg3 true true
qla4022 true true
e1000 true true
qla2300_707_vmwtrue truel
vmdriver true true
vmfs3 true true
etherswitch true true
shaper true true
tcpip true true
cosShadow true true
migration true true
nfsclient true true
deltadisk true true
vmfs2 true true
iscsi_mod true true
[root@esx1 root]#

So a common use I have seen with this command is to turn off unused modules. Go ahead and free up some resources turn off vmfs2! You don’t use it.
Another use is to change HBA options.

/usr/sbin/esxcfg-module -s ql2xmaxqdepth=64 qla2300_707_vmw
Remember to follow it with:
/usr/sbin/esxcfg-boot -b

Check out VCDX Master Ninja/Jedi Duncan Epping using this command combo in a scripted install.

ESX Commands – esxcfg-linuxnet

The guide from VMware.com says

esxcfg-linuxnet
Converts vswif to eth when booting ESX Server into service-console-only mode rather than into ESX mode. This command is used for the bootstrap process and is intended for VMware Technical Support use only. You should not issue this command unless instructed to do so by a VMware Technical Support representative.
There is no VI Client equivalent for this command.

Wow I should have saved all these for one post called stuff you don’t use unless someone smart tells you to.

Don’t worry though I checked ahead esxcfg-module has more too it. I actually slightly looked at it when I covered esxcfg-boot.

ESX Commands – esxcfg-init

Wow, this was a good one eh?
check out the help.

[root@esx1 root]# esxcfg-init -h
Usage: esxcfg-init
This program is used to initialize device names and advanced configuration options for the VMkernel on system boot.It is NOT intended for use outside of initialization scripts.
[root@esx1 root]#

I decided to google the command to see if anyone had insight. Not much more than what I give here. The help command then nothing. So for real I might get 2 blog posts in one day since this is so short.

ESX Commands – esxcfg-info

This is a great command to give you a whole bunch of information. Sort of like trying to drink from a fire hose. Go ahead and type esxcfg-info as root from your console. Wasn’t that fun?
You can follow this article and redirect the output to a file to make it a little easier. If there is a specific area that you need information about you can check the help and use a handy switch t print just the info you need. Which in all honesty may still be more than you can handle.

[root@esxlab1 root]# esxcfg-info -h
Usage: esxcfg-info mode
-a, –all Print all information
-w, –hardware Print hardware information
-r, –resource Print resource information
-s, –storage Print storage information
-n, –network Print network information
-y, –system Print system information
-o, –advopt Print advanced options
-u, –hwuuid Print hardware uuid
-b, –bootuuid Print boot partition uuid
-e, –boottype Print boot type
-c, –cmdline Print vmkernel command line
-F, –format Print the information in the given format
Valid values are “xml” and “perl”
-h, –help Print this message.

A sample from doing esxcfg-info -r (this is just a snippet of output)

==+Host Memory Stats :
|—-Managed…………………………………………..707.97 MB
|—-Kernel……………………………………………94.43 MB
|—-Free……………………………………………..612.89 MB
|—-Minimum Free………………………………………42.47 MB
|—-Excess……………………………………………570.43 MB
|—-Reserved………………………………………….47.95 MB
|—-Available…………………………………………565.60 MB
|—-State…………………………………………….High
|—-Total Swap Read……………………………………0 KB
|—-Total Swap Written…………………………………0 KB
|—-Total Overhead…………………………………….0 KB
|—-Total Size………………………………………..1.59 MB
|—-Total COW…………………………………………1.28 MB
|—-Total Zero………………………………………..0 KB
|—-Total Shared………………………………………0 KB
|—-Total Balloon……………………………………..0 KB
|—-Total Swapped……………………………………..0 KB
|—-Total Touched……………………………………..1.59 MB
|—-Total Allocated……………………………………5.48 MB
|—-Total Target………………………………………5.48 MB
|—-Total Swap Target………………………………….0 KB
|—-Total Balloon Target……………………………….0 KB

ESX Commands – esxcfg-hwiscsi

Next in the order of commands is esxcfg-hwiscsi. This command according to the iSCSI SAN configuration guide will let you set certain settings as required by your SAN on your hardware iSCSI HBA.

esxcfg-hwiscsi -h – this is the help. Not a ton there but enough.

esxcfg-hwiscsi -l – lists the current settings.

esxcfg-hwiscsi -a – allow arp redirection on the HW iSCSI HBA. This is used be some sans to move traffic between ports.

esxcfg-hwiscsi -j – Will enable a jumbo frame (MTU 9000 bytes) when it is disabled the frame is 1500 bytes.

I will bet if these settings are required you till be directed to use them be the SAN vendor or HBA vendor. IF something bizarre is happening on your iSCSI SAN with hardware HBA’s one of these might not match the SAN.