Although it's easy to install Linux VMs on a VMware hypervisor, the default, out-of-the-box configuration doesn't...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
capitalize on the VM's potential maximum performance. However, there are ways to optimize Linux VMs on VMware.
First, consider your virtual hardware. Each new version of a VMware product also brings new virtual hardware versions. Use the most recent hardware version whenever possible because, as with most OSes, patches and performance improvements are added incrementally. Your paravirtualized hardware sits next to your virtual hardware.
Paravirtualized hardware is essentially a software implementation of a piece of hardware. For example, the network controller VMXNET3 is fully paravirtualized and talks directly to the hardware to provide better performance, bypassing layers of virtualization and reducing performance drag. You can also paravirtualize SCSI controllers.
Paravirtualized hardware provides significant performance enhancements, so if it's available, take it. On that note, however, some older Linux platforms don't support paravirtualized hardware. Your mileage might vary.
One thing administrators tend to forget about is unused hardware. By default, Linux VMs come with hardware that you might never use, such as floppy drives, CD-ROMs and sound cards.
Most large environments automatically remove floppy drives. Admittedly, it won't free up massive amounts of RAM in smaller estates, but in medium-sized estates, this can save a reasonable amount of memory resources.
You should also remove this extraneous hardware as part of a physical-to-virtual cleanup. VMs that have been cleaned up and right-sized tend to perform better.
When you build a VM, don't use the VMware default settings, as these are very conservative. I recommend looking at vendor documentation for sensible default settings. Even better, develop a service offering with small, medium and large options so that it provides consistency for everyone involved. Then, choose the correct size. This is especially important when it comes to disk size because it can be difficult to expand boot volumes.
Installing a GUI
There are other components you can adjust to improve performance, and some Linux vendors do this better than others. The most important item to consider is run level. RedHat and CentOS install the GUI by default. I recommend you avoid installing the GUI unless it's absolutely necessary. If you don't install the GUI, you'll use less CPU and RAM and have fewer applications to manage. This can save a significant amount of resources across the state. However, some servers might require a GUI for a specific application. If your Linux VMs already have the GUI installed, it's possible to turn off the GUI-using system. Use the following command to set the system to boot to the networked command line:
systemctl set-default multi.user
If the administrator can't live without the GUI, repeat the process, and use the command shown below:
Systemctl set-default graphical.target
It's also possible to start the GUI on an as-needed basis by typing init 5. This loads the GUI for the duration of that session.
Open-VM-Tools vs. VMware Tools
Traditionally, one of the first things an administrator had to do to improve performance was install VMware Tools, but recently, most vendors have switched to Open-VM-Tools (OVT), an open source version of VMware Tools.
Most Linux vendors, including Red Hat and Canonical, ship OVT as part of the default Linux installation. If OVT is installed, make sure it isn't overwritten by VMware Tools. If you do install VMware Tools over OVT, the OS vendor might consider an unsupported configuration.
Administrators often overlook system time. By default, the time is picked up from the hypervisor. System time best practices have changed over the years, but the current best practice is to make sure that the Linux VMs and hosts are all synchronized directly to a Network Time Protocol (NTP) host on the network. If all of your networked devices use the same NTP server, all of your servers will be in sync. Correct system time is critical to running an effective network.
Linux VMs that run Java have a known memory management issue, one that can severely affect performance. Based on the way the VMware balloon driver in the guest Java allocates and reclaims memory, performance will be suboptimal.
The VMware Tools or OVT driver tries to reclaim unused memory, but Java expects to use the memory it was originally allocated. To avoid this issue, allocate the VM's memory up front. This might go against the conventional wisdom of letting VMware manage the memory allocated to the VM, but it's necessary to achieve optimal Java VM performance.
Finally, look at disk configuration. Disk expansion is easy to manage in a virtual environment, but the best practice is to separate system disks from data disks.
Any administrator who doesn't use logical volume management (LVM) or something similar misses a very valuable function of the virtual environment.
LVM acts as a layer of glue over any virtual disks, which allows the administrator to add or manage disks underneath the OS and still present the additional disk as one contiguous space. This eliminates the need to mess around with the partition to get more space. The administrator can thin provision these underlying disks so that space isn't allocated until it's needed. LVM has other built-in functions, such as disk snapshotting, but should be used with caution.
Also, if you don't use CD-ROMs or other virtual removable media, make sure to disconnect them. If virtual CDs remain connected, they prevent vMotion of Linux VMs to other hosts, and because the VMs can't be moved, they can even affect the DRS.
Review alternate Linux I/O schedulers