VCAP6-DCV Deployment – Objective 6.2 – Optimize Virtual Machine resources


Main Study Page

Objectives for 6.2 are broke down as the following

  • Adjust Virtual Machine properties according to a deployment plan:
    • Network configurations
    • CPU configurations
    • Storage configurations
  • Troubleshoot Virtual Machine performance issues based on application workload
  • Modify Transparent Page Sharing and large memory page settings
  • Optimize a Virtual Machine for latency sensitive workloads
  • Configure Flash Read Cache reservations

Adjust Virtual Machine properties according to a deployment plan

Adjusting VM properties according to a deployment plan could mean a lot of things and will come down to the question.  A lot of the following information can be found in vSphere 6 Resource Management Guide.

I will start with networking, to change the networking settings on a VM I will edit settings through the Web Client.

vcap6-2-1

From the drop down box I can select the port group the VM will be connected to and I can also change the adapter type.  The following options are available.

  • E1000 Emulated version of the Intel 82545EM Gigabit Ethernet NIC, with drivers available in most newer guest operating systems.
  • Flexible Identifies itself as a Vlance adapter when a virtual machine boots, but initializes itself and functions as either a Vlance or a VMXNET adapter, depending on which driver initializes it.
  • VMXNET 2 (Enhanced) Based on the VMXNET adapter but provides high-performance features commonly used on modern networks, such as jumbo frames and hardware offloads.
  • VMXNET 3 The VMXNET 3 adapter is the next generation of a paravirtualized NIC designed for performance, and is not related to VMXNET or VMXNET 2. It offers all the features available in VMXNET 2, and adds several new features like multiqueue support (also known as Receive Side Scaling in Windows), IPv6 offloads, and MSI/MSI-X interrupt delivery
  • SR-IOV passthrough Representation of a virtual function (VF) on a physical NIC with SR-IOV support. The virtual machine and the physical adapter exchange data without using the VMkernel as an intermediary. This adapter type is suitable for virtual machines where latency might cause failure or that require more CPU resources.

Using the correct device type is important and could well be covered in the exam, you may also be asked around resources and setting those correctly according to a deployment plan.  I have covered resource pool in a previous chapter see here.  The resources can also be set at a VM level.  To configure bandwidth allocation to a VM the following prerequisites must be met.

  • The VM must be connected to a distributed port group.
  • Verify that vSphere Distributed Switch is version 6.0.0 and later.
  • Verify that Network I/O Control on the switch is version 3.
  • Verify that Network I/O Control is enabled.
  • Verify that the virtual machine system traffic has a configured bandwidth reservation.

Options available here are

  • Shares – set the relative priority of the traffic from this virtual machine as shares from the capacity of the connected physical adapter.  Network I/O Control applies the configured shares when a physical adapter is saturated.  These are specified as High, NormalLow or Custom.
  • Reservation – reserve a minimum bandwidth that must be available to the VM network adapter when the virtual machine is powered on.  If you provision bandwidth by using a network resource pool, the reservation from the network adapters of powered on VMs that are associated with the pool must not exceed the quota of the pool.
  • Limit – set a limit on the bandwidth that the VM network adapter can consume.

The same sort of resource settings can be set for the CPU per VM outside of resource pools.

vcap6-2-2

  • Shares – Shares specify the relative importance of a virtual machine. If a virtual machine has twice as many shares of a resource as another virtual machine, it is entitled to consume twice as much of that resource when these two virtual machines are competing for resources.  These are specified as High, Normal or Low.
  • Reservation – Specify a guaranteed CPU or memory allocation for this virtual machine. Reservation defaults to 0. You can specify a reservation if you need to guarantee that the minimum required amounts of CPU or memory are always available for the virtual machine.
  • Limit – Specify the upper limit for this resource pool’s CPU or memory allocation.  You can usually accept the default (which is unlimited).  To specify a limit, deselect the Unlimited check box.

vcap6-2-3

Memory options are as follows

  • Shares – Each virtual machine is granted a number of memory shares. The more shares a virtual machine has, the greater share of host memory it receives. Shares represent a relative metric for allocating memory capacity.  These are specified as High, Normal or Low.
  • Reservation – Specifies the guaranteed minimum allocation for a virtual machine. The reservation is expressed in megabytes. If the reservation cannot be met, the virtual machine will not power on.
  • Limit – Places a limit on the consumption of memory for a virtual machine. This value is expressed in megabytes.

To change vCPU and vRAM settings the VM must be powered off by default, it is possible to enable hot add feature for vCPU and vRAM but it must be enabled first.  The prerequisites are as follows

  • Power off the VM
  • Ensure the VM has a guest OS that supports CPU / RAM hot add
  • Ensure the VM compatibility is ESXi 4.x and later
  • Ensure that VMware Tools is installed

To enable open the Web Client – VM – Edit Settings – Virtual hardware – CPU – Enable CPU Hot Add – Enable Memory Hot Plug

vcap1.4-10  vcap1.4-11

Finally resource settings can be enabled on the storage per VM with Storage I/O control enabled.  You allocate the number of storage I/O shares and upper limit of I/O operations per second (IOPS) allowed for each virtual machine. When storage I/O congestion is detected for a datastore, the I/O workloads of the virtual machines accessing that datastore are adjusted according to the proportion of virtual machine shares each virtual machine has.

vcap6-2-4

  • Shares –  similar to CPU and memory select the relative amount of shares to allocate to the virtual machine (Low, Normal, or High).
  • Limit IOPS – By default, IOPS are unlimited. You select Low (500), Normal (1000), or High (2000), or you can select Custom to enter a user-defined number of shares.

Troubleshoot Virtual Machine performance issues based on application workload

As with the other troubleshooting modules it will come down to experience more then anything.  VMware have some KBs on where to start troubleshooting VMs and what tools to be used see here and here.  For VMs that are running VMware Tools it is possible to run perfmon in guest to pull metrics on CPU and memory.

Open perfmon – Add Counter – VM Memory / VM Processor

vcap6-2-5

The statistics will then be monitored in guest.

vcap6-2-6


Modify Transparent Page Sharing and large memory page settings

Many ESXi workloads present opportunities for sharing memory across virtual machines.  For example, several virtual machines might be running instances of the same guest operating system, have the same applications or components loaded, or contain common data. In such cases, a host uses a proprietary transparent page sharing technique to securely eliminate redundant copies of memory pages.

Use the following advanced setting on a host to control the rate at which the system scan memory to identity opportunities for sharing memory.

  • Mem.ShareScanTime
  • Mem.ShareScanGhz

vcap6-2-7

You can also disable sharing for individual virtual machines by adding the following line to the VM advanced settings

>sched.mem.pshare.enable=FALSE option 


Optimize a Virtual Machine for latency sensitive workloads

You can adjust the latency sensitivity of a virtual machine to optimize the scheduling delay for latency sensitive applications.  ESXi is optimized to deliver high throughput. You can optimize your virtual machine to meet the low latency requirement of latency sensitive applications. Examples of latency sensitive applications are VOIP or media player applications, or applications that require frequent access to the mouse or keyboard devices.

This can be set to Low, Medium, Normal or High.

vcap6-2-8

To change this setting find the VM – Edit Settings – VM Options – Advanced – Latency Sensitivity.

vcap6-2-9


Configure Flash Read Cache reservations

Flash cache can be enabled to accelerate VM performance.  First enable this on the host then enable it on the VM.  Enabling this on the host is covered in a previous section, see here.  Once enabled the it can be selected for a VM by selecting the VM – Edit Setting – Virtual Hardware – Hard Disk – Virtual Flash Read Cache.  Having this enabled can affect DRS in the cluster so make sure this is planned for.

vcap6-2-9

 

Leave a comment

Your email address will not be published. Required fields are marked *