Creating a virtual machine (VM) for VMware vSphere is a very different process than creating a virtual machine...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
for VMware Infrastructure 3 (VI3). There are many changes that solutions providers need to be aware of.
VMware makes creating a virtual machine really easy -- in fact, too easy. The vSphere client has a nice wizard: You just click "Next," use mostly default settings and enter some basic information to create a new VM. However, many of the VM configuration options and virtual hardware choices can make a huge impact on how your customer's VM functions. Making the wrong choices can degrade the VM's performance and cause malfunctions, which can affect the applications running on the VM.
In this tip, solutions providers will learn about the new features available for creating a virtual machine in vSphere. You'll also find information on proper VM configuration for vSphere.
Creating a virtual machine for vSphere: Virtual machine hardware
Let's start with VM hardware. Version 4 was used for VMs in VI3, and version 7 was introduced in vSphere. You might be wondering what the version means. If you open the .vmx file of a VM with a text editor, you will see a line that says virtualHW.version, and the value will be either 4 or 7. The 4 or 7 represents whether the VM is using the new vSphere hardware format (7) or the VI3 format (4). Because VMs have no physical hardware, the version is simply used by the VM configuration file (.vmx) to determine what VM configuration settings and features can be used.
If the VM is in a mixed environment of vSphere and VI3 hosts and has the chance of being migrated to a VI3 host because of a high availability, Distributed Resource Scheduler or VMotion event, then you should use version 4. Otherwise, stick with version 7, because some of vSphere's features won't work without this version. You can upgrade the VM hardware version from 4 to 7 at any time by using the vSphere client to select the VM while it is powered and then choosing Inventory, Virtual Machine and then Upgrade Virtual Machine Hardware.
The benefits of version 7 include Fault Tolerance, the Changed Block Tracking feature of vStorage API, hot-add of CPU and memory and many more. You can check to see which VM version is currently used by selecting the VM using the vSphere Client and then selecting the Summary tab. In the General pane, the VM version will be displayed (figure 1).
Figure 1 -- Identifying the VM version
You have the option of choosing which version to use (figure 2) when creating a VM by choosing the Custom configuration type in the New Virtual Machine wizard. If you choose Typical, you will not have the option to choose version 4, because all new VMs default to version 7 in vSphere.
Figure 2 -- Choosing which version to use
Creating a virtual machine for vSphere: Choosing guest operating systems
There are definitely more guest operating system (OS) choices in vSphere when creating a virtual machine. And having the guest OS setting match the guest OS that is installed on the VM is very important for the following reasons:
- It determines whether or not to allow features like CPU and memory hot-add.
- It determines which VMware Tools version to use when installing on a guest OS.
- It determines the defaults for other VM configuration screens in the VM creation wizard.
- It determines which virtual hardware devices will be available to the VM.
- It helps the host to better handle specific hardware setbacks that may be unique to the OS chosen.
Setting the guest OS incorrectly can negatively affect the performance of your VM and can occasionally cause high CPU utilization. So it's important to set the guest OS correctly.
Make absolutely sure you choose the correct OS (32/64-bit), edition and version, and also ensure that you match the guest OS that will be installed on the VM. If you browse through the OS choices in vSphere, you will notice many more Linux distributions and Windows versions as well as new selections for Solaris, FreeBSD and more (figure 3).
Creating a virtual machine for vSphere: Selecting CPU and memory
When it comes to choosing CPU and memory for your VM, you have more options in vSphere. VI3 only allowed you to assign up to four virtual CPUs (vCPUs) and 64 GB to a VM (figure 4). In vSphere, you can assign up to eight vCPUs and 255 GB of RAM to a VM. However, to support more than four vCPUs, the host must have a vSphere Enterprise Plus license, the host CPUs/cores must total more than four and the guest OS must support more than four vCPUs.
The ability to assign an odd number of vCPUs to a VM is also new to vSphere. In VI3, you could only assign one, two or four vCPUs to a VM. In vSphere, you can assign any number, one through eight, as long as the guest OS also supports an odd number of vCPUs.
Figure 4 -- Assigning virtual CPUs (vCPUs)
Thanks to memory overcommit, you can now assign more memory to a VM (up to 255 GB) than the host physically has available (figure 5). But remember, just because you can assign a VM up to eight vCPUs and 255 GB of memory doesn't mean that you should. Assigning too many vCPUs to a VM can drastically reduce the performance of your VMs under certain circumstances.
Figure 5 -- Assigning memory to a VM
Creating a virtual machine for vSphere: Virtual network interface cards
VSphere introduced a new virtual network adapter type called VMXNET3, which is the third generation of VMware's homegrown virtual network interface card (NIC). Why did VMware develop its own virtual NICs instead of emulating existing physical NIC types? Because VMware needed a virtual NIC that was designed for virtualization and could also help minimize I/O virtualization overhead.
VMXNET3 offers better performance then VMXNET2, which was introduced in VI3. VMXNET3 also has some new features, such as Receive-Side Scaling (RSS), TCP Segmentation Offload (TSO) over IPv6 and large TX and RX ring sizes that can help increase host scalability for VMs with high network loads. One disadvantage to using the new VMXNET3 NIC (figure 6) is that it currently does not support Fault Tolerance.
Figure 6 -- Creating network connections
Creating a virtual machine for vSphere: Selecting virtual storage adapters
There are several new types of virtual storage adapters for vSphere to choose from. In VI3, the only storage adapter types available were either a BusLogic or LSI Logic parallel SCSI adapter. In vSphere, you have additional choices, which include an LSI Logic SAS (serial-attached SCSI) and a paravirtual SCSI adapter. Additionally, you can optionally use an integrated drive electronics adapter, which was not available in VI3. The new LSI Logic SAS adapter is only intended to be used by Windows Server 2008 for use in clusters with shared disks.
Paravirtualization is a technology available for certain OSes that use a special driver to communicate directly with the hypervisor. Paravirtualization allows for greater throughput and lower CPU utilization for VMs and is useful for disk I/O intensive applications. Paravirtualized SCSI adapters (figure 7) have some restrictions, though. You can only use them for non-primary OS partitions. You cannot use them with Fault Tolerance.
Figure 7 -- Selecting VMware Paravirtual in the SCSI controller
Selecting an IDE adapter isn't a very straightforward process. Solutions providers first have to select a SCSI adapter. Then, in the Advanced Options for creating a disk, you need to switch the virtual device node from SCSI to IDE (figure 8). Even though the summary screen will show that a SCSI adapter will be used when creating a VM, if you edit the settings of the VM after it is created, the SCSI adapter will not be present. Instead, a hidden IDE adapter is used, which is also used by the VM's CD/DVD drive.
Figure 8 -- Switching the virtual device node to IDE
Creating virtual disks for a vSphere virtual machine
When creating a virtual disk for a VM, you have two new options that appear in the disk provisioning section (figure 9). The first option is to use a thin-provisioned disk format. Thin disks are not new to vSphere; they also existed in VI3 but could only be created manually using the service console vmkfstools command. In vSphere, solutions providers can now create thin disks when creating a VM using the vSphere client. Unlike thick disks, where all disk space is allocated at the time of creation, thin disks start out small (1 MB) and grow up to the size specified when they were created, as data is written to them.
There is also an option for supporting the Fault Tolerance clustering feature. If you select this option, you cannot select a thin disk format, and the VM is forced to use thick disks. In addition, the disk is formatted using the eager zeroed method, instead of the default lazy zeroed method. The eager zeroed method zeroes out all disk blocks when the disk is created instead of on-demand. On-demand means disk blocks are zeroed the first time they are written to after the disk is created.
Figure 9 -- Selecting disk format when creating a VM virtual disk
Read part two on VMware virtual machines in vSphere: Options and hardware
About the expert
Eric Siebert is a 25-year IT veteran whose primary focus is VMware virtualization and Windows server administration. He is one of the 300 vExperts, named by VMware, for 2009. He is the author of the book VI3 Implementation and Administration and a frequent TechTarget contributor. In addition, he maintains vSphere-land.com, a VMware information site.