esxcfg-module – Managing Modules – VCDX Prep

Like the last several posts, this one hails from the storage section of the Enterprise Admin Blueprint. The Enterprise Admin exam is one of the several requirements to becoming a VCDX. As I go down this path, I hope to share with you some of my exam prep in the hope that it will help you as well.

Seems this is becoming part of a series. Like the last few posts, this one was also produced from objective 1.1 of the VCDX Blueprint, and is part of my exam prep.

Task:

esxcfg-module – Unload/Load modules & check module status.

The Command:

[root@ProfessionalVMware root]# esxcfg-module
Usage: esxcfg-module <options> <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.

In this case I’ve only included the relevant output.

Checking Module Status:

[root@ProfessionalVMware root]# esxcfg-module -l
Device Driver Modules
Module         Enabled Loaded 
vmklinux       true    true   
mptscsi_2xx    true    true   
e1000          true    true   
lvmdriver      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   

Loading/Unloading:

[root@ProfessionalVMware root]# esxcfg-module –disable vmfs2
[root@ProfessionalVMware root]# esxcfg-module –list
Device Driver Modules
Module         Enabled Loaded 
vmklinux       true    true   
mptscsi_2xx    true    true   
e1000          true    true   
lvmdriver      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          false   true   
[root@ProfessionalVMware root]# esxcfg-module –enable vmfs2
[root@ProfessionalVMware root]# esxcfg-module –list
Device Driver Modules
Module         Enabled Loaded 
vmklinux       true    true   
mptscsi_2xx    true    true   
e1000          true    true   
lvmdriver      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   

Thanks for tuning in.

Manage VMFS File Systems Using the CLI – VCDX Prep

Seems this is becoming part of a series. Like the last few posts, this one was also produced from objective 1.1 of the VCDX Blueprint, and is part of my exam prep.

Task:

Manage VMFS file systems using command line tools.

Solution:

[root@ProfessionalVMware root]# vmkfstools
No valid command specified

OPTIONS FOR FILE SYSTEMS:

vmkfstools -C –createfs vmfs3
               -b –blocksize #[mMkK]
               -S –setfsname fsName
           -Z –extendfs extension-partition
   deviceName

           -P –queryfs -h –humanreadable
           -T –tovmfs3
               -x –upgradetype [zeroedthick|eagerzeroedthick|thin]
           -u –upgradefinish
   vmfsPath

In this case I’ve only included the relevant output.

Creating a VMFS file system:

[root@ProfessionalVMware root]# vmkfstools –create vmfs3 –b 8M –s NewVolume vmhba1:2:0:3

Getting some details on a VMFS file system:

[root@ProfessionalVMware root]# vmkfstools -P /vmfs/volumes/storage1/
VMFS-3.31 file system spanning 1 partitions.
File system label (if any): storage1
Mode: public
Capacity 34628173824 (33024 file blocks * 1048576), 34158411776 (32576 blocks) avail
UUID: 4b6ac385-66ac6b08-056e-000c29a47f2f
Partitions spanned (on "lvm"):
    vmhba0:0:0:3

While the content may seem obvious to some, this post is here to help those that still have their exams to prep for, or find themselves wandering about aimlessly on the CLI trying to configure NFS. Thanks for tuning in.

Configure an NFS Datastore From the CLI – VCDX Prep

Like the last post, this one also hails from objective 1.1 of the VCDX Blueprint, and is part of my exam prep.

Task:

Configure an NFS Datastore using command line tools.

Solution:

[root@ProfessionalVMware root]# esxcfg-nas
esxcfg-nas <options> [<label>]
-a|–add                Add a new NASc filesystem to /vmfs volumes. 
                        Requires –host and –share options.
                        Use –readonly option only for readonly access.
-o|–host <host>        Set the host name or ip address for a NAS mount.
-s|–share <share>      Set the name of the NAS share on the remote system.
-y|–readonly           Add the new NAS filesystem with readonly access.
-d|–delete             Unmount and delete a filesystem.
-l|–list               List the currently mounted NAS file systems.
-r|–restore            Restore all NAS mounts from the configuration file.
                        (FOR INTERNAL USE ONLY).
-h|–help               Show this message.

More specifically:

[root@ProfessionalVMware root]# esxcfg-nas –add –host 192.168.15.252 –share /storage/iso ISO
Connecting to NAS volume: ISO
ISO created and connected.

Result:

[root@ProfessionalVMware root]# esxcfg-nas –list
ISO is /storage/iso from 192.168.15.252 mounted

While the content may seem obvious to some, this post is here to help those that still have their exams to prep for, or find themselves wandering about aimlessly on the CLI trying to configure NFS. Thanks for tuning in.

Setting the ESX 3.5 Multi-Pathing Policy From the CLI

This one is taken from the first objective in the VMware Enterprise Admin Exam Blueprint. Specifically from the skills section:

- Perform advanced multi-pathing configuration
– Configure multi-pathing policy
— Configure round-robin behavior using command-line tools

After logging into the host via SSH, and getting to root, this can be done with the “esxcfg-mpath” command. Let’s take a look at this command:

[root@ProfessionalVMware root]# esxcfg-mpath
esxcfg-mpath <options> [--lun=<LUN>] [--path=<path>]
-l|–list                     List all LUNs and their paths.
-p|–policy <type>            Set the policy for a specific LUN.  Requires
                              a –lun flag.  Type must be one of mru, rr, fixed or custom.
-H|–custom-hba-policy        Set the custom HBA policy value.  Must be one of
                              mru, preferred, any, minq.
-T|–custom-target-policy     Set the custom target policy value. Must be one of
                              mru, preferred, any
-C|–custom-max-commands      Set the custom policy value for max commands
-B|–custom-max-blocks        Set the custom policy value for max blocks
-s|–state <on|off>           Set the state for a specific LUN Path.  Requires
                              both –lun and –path flags.
-f|–preferred                Set the given path to be preferred for the
                              given LUN.  Requires both –path and –lun flags.
-q|–query                    Query the information on a specific LUN. 
                              Requires a –lun flag.
-P|–path=vmhbaX:X:X          Used to specify a path for setting the
                              path state or preferred path.  Uses the
                              VMkernel internal path name.
-L|–lun=vmhbaX:X:X           Indicate which LUN to operate on.  This can be
                              either the internal VMkernel vmhba name for
                              this LUN (vmhbaX:X:X) or the vml name as
                              found in /vmfs/devices/disks.
-v|–verbose                  Show all information about the LUNs and
                              paths, otherwise a minimal set of data
                              is displayed to conserve space.
-b|–bulk                     Bulk path listing suitable for parsing.
-a|–hbas                     List HBAs on the system with a unique ID
                              if one is available.
-h|–help                     Show this message.
-r|–restore                  Restore path setting to configured values
                              on system start. (INTERNAL USE ONLY)

Quite the command, isn’t it? And that is but half the output. The particular switches we are interested in are –p or –policy to which we’ll feed the “rr” or round robin switch. We’ll follow that up with the –L or –lun to specify which lun we’re operating on. Here’s an example:

[root@ProfessionalVMware root]# esxcfg-vmhbadevs
vmhba0:0:0     /dev/sda                       
[root@ProfessionalVMware root]# esxcfg-mpath –policy=rr –lun=vmhba0:0:0
Setting vmhba0:0:0 policy to rr

In all practical terms, on my lab box that didn’t accomplish much, as there is only one actual path to the disk, however, we can still see the changes in the VI Client:

Windows7-20100204-182320[1]

Note: esxcfg-mpath is not actually listed in the tools section for this objective, but is indeed the way to accomplish this.

Installing ESX 3.5 in VMware Fusion

While this actually requires no special settings, I figure it’s worth noting, if for nothing more than to state that in VMware Fusion 3, ESX 3.5 requires no additional settings to be operational. Basically it works as follows:

  1. Download the ESX ISO (vmware.com/download/vi)
  2. In VMware Fusion create a new virtual machine, choosing said ISO:
    VMware_Fusion-20100204-133826[1]
  3. The correct OS is installed automatically. The version may be ‘incorrect’ but it works just fine:
    New_Virtual_Machine_Assistant-20100204-134040[1] 
  4. And all installed:
    ProVMware_-_ESX3.5U4-20100204-134410[1]

Also of note: The splash screen seemingly does a lookup against the hostname you have configured to produce the IP address displayed.

VCDX – Enterprise Admin Brown Bag the First – The CLI

Following up on the interest from our last post, Tom Howarth and I will be running the first of what should become a series of VCDX Enterprise Admin Brown Bag sessions. The topic this week will be the CLI.

We’re going to give this a shot with DimDim, and can accept a total of 25 folks. In other words, please sign up only if you have been accepted into the VCDX process, or have already taken and passed your Enterprise Admin Exam. Also note, the time below is in CST.

 

 

Questions? Hit me up on Twitter or in the comments. Look forward to seeing you there!

VMware Enterprise Admin / VCDX Prep Brown Bags

Some folks in the community have expressed an interest in expanding my quazi regular VCP brown bags into some additional brown bags to support those seeking their VCDX, starting with the Enterprise Admin exam. This post then, is to serve two functions:

1) Is there interest? – Basically, If I built it, would y’all come?

2) Content – What specific areas would you like to see covered?

Feel free to drop a line in the comments or on twitter with your answers to the above, and anything else you may want to add. (I’m @cody_bunch) on Twitter. And thanks again for helping!

vSphere Host Died Abandon Ship! – vSphere vCenter Alarms & Actions

This came up recently on the VMware Virtualization group on LinkedIn. The question was essentially: “In the event of a host hardware issue, can I VMotion my VMs off the host and send a notification?” The answer is: “Most Certainly!” This can be done by setting up a vSphere vCenter Alarm and corresponding action. Let’s explore:

Fire up the vCenter client. Select the level you want to be alerted from then select “Alarms”:

Windows7-20100123-145206[1] 
Note, there are quite a few default alarms, one of them may work for you:

Windows7-20100123-145400[1] 

For ours, we want something a bit more generic, so right click somewhere in the empty space, and choose “New Alert”:

Windows7-20100123-145728[1]

Fill in the details with something that makes sense for your environment. I went with “Generic Host Health Alert”. Make sure to select “Hosts” and the second radio button. Done? Then we’re ready to move on to the “Triggers” tab.

Select Add, then “Hardware Health Changed”, then change the “Status”. I went with “Alert”, like this:

Windows7-20100123-150024[1] 

Got that so far? Awesome! Next we move onto the actions:

Windows7-20100123-150514[1]

For this you will configure the “Send a notification email” to an address of your choice. Then you’ll add “Enter maintenance mode”

And with that, select “OK”. You’ve now configured your vSphere vCenter to notify you of a hardware failure, and to migrate your VMs to another host. Note: This will only work if you have clustered hosts, and then only within the capacity of the cluster. Further, depending on the hardware issue, VMotion may not be an option, and you are then dependant on VMware HA. If this was helpful or you have any questions, drop us a line in the comments.

New Blogs You Should be Reading

Perhaps they’re not new, exactly. They are new to me, however. They’re also good enough that you should be reading them as well! With that said, onto the blogs!

  • VMDEV.info – http://www.vmdev.info/
    This is put together by Keshav Attrey, a software dev with VMware. The blog concentrates on the vSphere APIs and automation around virtual desktops. My kinda blog!
  • B3rg.nl – http://www.b3rg.nl/index.php
    This was a more than awesome find that came up during the last VCP4 Brown Bag. Not sure how I missed it in fact. Matthijs van den Berg covers esxtop, VCP prep, VCDX Prep and more. Good stuff.
  • Double Cloud – http://www.doublecloud.org/
    This is put together by Steve Jin. The author of the vSphere Java SDK, and the book: VMware VI and vSphere SDK: http://bit.ly/5I10nn (Affiliate Link). Basically, if you are going to do vSphere API work, this is the place to start.

VMware Tools –default!

When was the last time you found yourself configuring VMware tools on Linux? Did having to incessantly press enter accepting the defaults drive you nuts too? I think I might be the last one to the game on this, but today I was stumbling through configuring VMware tools on a few Linux VMs. Stumbling, over a terminal services session, over VPN, over some rural interwebs carrier.

A less than ideal sort of situation. The solution… other than get better internets, was to execute both “~/vmware-tools-distrib/vmware-install.pl” and “/usr/bin/vmware-config-tools.pl” with the “–default” (two dashes, then default) option. Like this:

Ubuntu-20100120-092923[1]

What this does, is instead of making you hit enter for each of the options (because, ya know… you change them all that often), and accepts the defaults, making the entire install that much easier.

« Older Entries