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 10MbpsHalf 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.
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.
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.
[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.
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
[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.
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.
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:
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:
Note: esxcfg-mpath is not actually listed in the tools section for this objective, but is indeed the way to accomplish this.
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:
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!
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!
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”:
Note, there are quite a few default alarms, one of them may work for you:
For ours, we want something a bit more generic, so right click somewhere in the empty space, and choose “New Alert”:
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:
Got that so far? Awesome! Next we move onto the actions:
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.
Most Recent Comments