What NICs Do I Have? – esxcfg-nics – VCDX Prep

As a plethora of my last posts suggest, I am spinning up study towards my VCDX. My first stop on that journey will be with the Enterprise Admin exam. Along the way I hope to share bits that I learn, review, and otherwise enjoy about the process. Today that is figuring out all manner of information about the NICs or network cards installed in the ESX host, and how to manipulate them. Let’s get started:

Question: What NICs?

Answer: esxcfg-nics –l

Example:

[root@ProfessionalVMware root]# esxcfg-nics -l
Name    PCI      Driver      Link Speed    Duplex MTU    Description                  
vmnic0  02:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1  02:02.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2  02:03.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

If you excuse the wrapped console output for a moment, you will see that there are three interfaces, vmnic0 –2. You’ll also notice how the PCI ordering is done, and that these particular NICs use the Intel e1000 driver (it is in a VM after all).

Question: How do I change the duplex/speed?

Answer: Using esxcfg-nics –s 10/100/1000 –d “full/half” vmnic#

Example:

[root@ProfessionalVMware root]# esxcfg-nics -d half -s 10 vmnic1
[root@ProfessionalVMware root]# esxcfg-nics -l
Name    PCI      Driver      Link Speed    Duplex MTU    Description                  
vmnic0  02:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1  02:02.00 e1000       Up   10Mbps   Half   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2  02:03.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

What you see above is that I changed the speed and duplex of vmnic1 to 10 half. I also made it bold! These settings are rather cruel, but every now and again a good BOFH has to do what a good BOFH has to do.

Question: I preformed the above speed and duplex changes on the accounting groups box… now how do I fix it?

Answer: A good, pleasantly worded apology, and the following: esxcfg-nics –a vmnic#

Example:

[root@ProfessionalVMware root]# esxcfg-nics -a vmnic1
[root@ProfessionalVMware root]# esxcfg-nics -l
Name    PCI      Driver      Link Speed    Duplex MTU    Description                  
vmnic0  02:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1  02:02.00 e1000       Up   10Mbps   Half   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2  02:03.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
[root@ProfessionalVMware root]#

You’ll notice the speed/duplex did not change. You may have to let this sit for a few seconds (or as long as it took me to write the last sentence), before it corrects itself. Here it is all corrected:

[root@ProfessionalVMware root]# esxcfg-nics -l
Name    PCI      Driver      Link Speed    Duplex MTU    Description                  
vmnic0  02:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1  02:02.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2  02:03.00 e1000       Up   1000Mbps Full   200    Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

As always, if you have questions or comments, drop a line in the comments.

VCDX Brown Bag The Second! – Coming soon

We may have an impromptu call between now and then, but I am in the midst of getting some good things prepared for the next one, like a conference platform that works… mostly. That said, if you have any specific topics you would like covered during the next session, drop a line in the comments or on Twitter.

Also note, this does not mean the VCP Brown Bags have stopped. Once we work out the conference platform bits, the VCP Brown Bags will also resume. Thanks for coming, and look forward to seeing you on the next one.

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.

« Older Entries   Recent Entries »