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.

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.

Free Stuff from the Ghost of VMworld’s Past

Why haven’t you looked into all of these free VMworld Sessions?
So greatly collected all in one place at the best one stop shop for all VMware related material on the web Eric Siebert’s vSphere-land.

This will be great distraction from me renewing my CCNA and getting MCITP in Exchange 2007. My best excuse for not studying is there is so many interesting topics out there!

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.

ESX Commands – esxcfg-firewall

I have really forgot to keep up on my VCDX study path. So today a quick tidbit on the esxcfg-firewall command.
Many of us today will use the vCenter Client to change firewall ports on the ESX. One instance where I exclusively mess with the firewall from the command line using esxcfg-firewall is when I install Dell OpenManage. I am already in the console to install the agents so I might as well open the firewall from the console too.
This really applies to any kind of agent or software you add to your ESX installation. So if you find yourself already in the console why not save a step and do it from the cli?

Lets look at the command

# esxcfg-firewall -o 1311,tcp,in,OpenManageRequest

First is the command, esxcfg-firewall, -o is for openport, the 1311 is the port number, tcp is protocol, in is the direction and the final part is the name of the service.

Now if you want to see all of your esxcfg-firewall settings try:
esxcfg-firewall -q

Show if specifig service is enabled.
esxcfg-firewall -q [service name]

Of course typing esxcfg-firewall -h gives lots of good help.

Some links: (You can google and find a ton more)

ESX Guide
VMware Land
Yellow Bricks
Vritualization Admin

The Philosophy of Cloud

With several great posts recently about the cloud and its definitions I decided to jump in from maybe a new perspective.
So check out these links:
The Cloud is Kicking my Butt – Mike DiPetrillo

Is Virtualization Required for the Cloud to Work? – Mike DiPetrillo

Cloud Butt Kicking – Jason Boche

So to relate Cloud Computing to Philosophy. I have to define the previous way of computing would be the Modern way of thought. It fit with the very way most Engineers thought. It is linear. A + B = C computing design made sense. Faster CPU’s means faster programs. More memory meant bigger programs running faster. More Storage means we could store more and more data. Faster Networks let us move that data faster and faster.
Cloud computing redefines our existing way of thought but only does so be erasing our previous definitions. Cloud computing is POST-modern. It is the next step in the philosophy of computing. Postmodern philosophy is defined by being undefinable. The more you try to label and categorize the more it wiggles away. I have read a lot about the Cloud abstracting computing away from our traditional way of defining data center, computing, or information systems. So some thoughts on what this actually means to me.

1. It is ok that Cloud can mean 1000 different things to 1000 different people. That is what makes it “cloud”. What matters is what you experience from the cloud. Virtual Desktops? ok. Distributed Computing or Software as a Service? ok. Online backups? sure. Virtual Firewalls?. You bet! Going on and on…

2. Claiming to be the sole provider of what is really “cloud” will make you seem very “un-cloud”. Cloud computing will be such that when we hold it tighter the more we don’t understand it.

3. As we abstract our data away from the linear thought of the PC in front of me uploads and downloads data to various servers through various network devices sitting in various data centers in certain cities. We will work on relationships and experiences. As a consultant my goal would be to show how your information will “relate” to others and how you interact with the information.

What does all this mean for privacy, security and identity?
Our technical devices will be “connection points” to what is happening in the cloud.

This is getting rambling now so I will stop.