Change the Default PSP in VMware vSphere 5

One thing I do to my VMware ESXi hosts is set the default Path Selection Policy (PSP) for certain Storage Array Type Plugins (SATPs) to do the right thing. This eliminates my need to reconfigure each datastore’s multipath settings on each host, and helps guarantee that a new LUN added by someone other than me will function correctly from the start. Consider it part of my “make it easy to do the right thing” sysadmin mantra. This has been covered by others at various points for older vSphere versions, but the vMA & esxcli changed some with version 5, so here are the commands I use. I have two different arrays, one that is active/active without a specific SATP (so …

Read More

Use 'for' Loops with the vSphere Management Assistant

The VMware vSphere Management Assistant (vMA) claim to fame is that it has a UNIX shell and the vSphere CLI installed, making it handy for a lot of things, and makes cutting & pasting comands real easy when it’s paired with a decent SSH client. One of my favorite ways to use it is with ‘for’ loops in the shell, to make the same change to all of my ESXi hosts. Let’s say you have a list of servers you want to make a change to, like using esxcli to set the HBA queue depth. My list is a text file I create in nano or vi (see my post on installing nano on the vMA), one host per line: …

Read More

Install the nano Editor on the VMware vMA 5

The VMware vSphere Management Assistant (vMA) is a handy appliance for interacting with your environment via the Linux command line. I use it a lot, and I’m starting to get more of my team to use it. The problem is that it only ships with the vi text editor, which, described politely, is sort of arcane. Being a UNIX guy I’m used to it, but for others that just want to edit a file it’s overkill. For those situations I like nano, a simple open source editor. To install it on the vMA issue the command: sudo zypper install nano If you’re prompted for a password use the one you set for vi-admin (or whoever you’re logged into the vMA …

Read More

How Large Your Linux Swap Partition Should Be

This is post #4 in my December-long series on Linux VM performance tuning, Tuningmas. One of those timeless questions in system administration has always been “how much swap space do I configure on my server?” The old rule used to be twice the amount of memory, but does a server with 256 GB of RAM really need a half terabyte of swap? And what about VMs? Swapping on VMs is a serious performance drag. Would it be a good idea to just disable swap completely? One thing to consider is that there’s a tunable kernel parameter, /proc/sys/vm/swappiness, that controls the tendency of Linux to scavenge inactive memory pages and swap them out. It is a number from 0 to 100, …

Read More

Leave Some RAM For Filesystem Cache

This is post #3 in my December-long series on Linux VM performance tuning, Tuningmas. Many system administrators don’t realize it, but in most OSes RAM that’s unused by applications goes towards filesystem cache, which speeds disk operations. Some VM “right-sizing” tools don’t take this into account, and recommend pretty tight memory allocations which end up causing more disk I/O in the long term. Trading some RAM for better I/O performance is often a very good move, both for an individual VM and for the virtual environment as a whole. To understand what’s happening on a Linux VM and make a decision about how much RAM we should leave for filesystem cache we need to understand the ‘free’ command: total used …

Read More

Disable GUIs and X Windows on Linux VMs

This is post #2 in my December-long series on Linux VM performance tuning, Tuningmas. I remember an old story about people having performance issues on their Windows servers. It would happen intermittently, and never when the system administrator was around. Turns out it was the pretty OpenGL screensaver, which would kick in and slow everything down tremendously. When the admin was around he’d be using the console of the server, so no screen saver, and no problems. Graphical user interfaces make one-off administration tasks easier in some cases, but for virtual environments they come at a cost: additional RAM and CPU overhead. For a virtual environment you should shut them off, or install as little of them as you need, …

Read More

Align Your Partitions

This is post #1 in my December-long series on Linux VM performance tuning, Tuningmas. I wrote about it back in 2006, and lots of others have written about it since (Duncan Epping has a nice vendor-agnostic post with diagrams): misaligned storage trashing your I/O performance. What’s the big deal? In short, it is killing your I/O performance. Logical Block Addressing on your disk drive makes the Master Boot Record 63 bytes long. This means it occupies sectors 0-62 on disk, and the first partition will start at sector 63. The number 63 is a persona non grata in the computer world. It isn’t a power of 2, and it certainly doesn’t line up with your storage’s idea of the world …

Read More

Thoughts on the VMTN Subscription Idea

Mike Laverick has started something of a campaign to bring back the VMTN Subscription, which was something like the Microsoft TechNet or MSDN models. I’m a TechNet subscriber and for $349 I get access to most everything Microsoft has. For testing purposes this is great. I don’t have to spend a lot of time dealing with activation timeouts, I can just test things and leave the my own test environment up and running for when I want to test new VMware Tools, or whatever. I think that’s fair, since I buy real Windows licenses for every other VM that I have (dev, test, QA, production, etc.). Right now, if you want a test environment your options are to pay for …

Read More

Why Does My Linux VM's Virtual NIC Show Up As eth1?

Got a Red Hat Enterprise Linux (or CentOS, or Scientific Linux, or Oracle Enterprise Linux, etc.) 6 VM that won’t bring up it’s single network interface after you clone it? Get the following error when you try using /sbin/ifup to enable it? “Device eth0 does not seem to be present, delaying initialization.” When you use “/sbin/ifconfig -a” you see eth1 where eth0 should be? eth1      Link encap:Ethernet  HWaddr 00:50:56:9B:00:85             BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:812 errors:0 dropped:0 overruns:0 frame:0           TX packets:214 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:72509 (70.8 KiB)  TX bytes:28324 (27.6 KiB) lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           …

Read More

Cargo Cult System Administration

The term “cargo cult” comes from World War II, where the USA and Japan created small airstrips and bases on islands in the Pacific Ocean, and the locals mistook the cause & effect in relation to why goods and cargo appeared on the island. It’s absolutely fascinating, and the Wikipedia entry for cargo cults indicates some of these cults are still operating. The excellent book Code Complete, by Steve McConnell, introduced me to the idea of cargo cult software engineering. Turns out, a guy by the name of Eric Lippert coined the phrase “cargo cult programming,” and explains the whole thing well: During the Second World War, the Americans set up airstrips on various tiny islands in the Pacific.  After …

Read More