Hi All ...
In the third part, we will talk about VMs: their basic settings and configuration and best practices when creating and configuring a VM.
Credits:
- Cormac Hogan
- Petra Jorgenson
- Andrea Mauro, aka. AndreTheGiant
Let's Start...
1. Virtual NICs:
Official Kb from VMware containing nice comparison between different types of Virtual NICs (vNICs):
VMware KB: Choosing a network adapter for your virtual machine
2. Virtual Machine MAC Address:
VM MAC address consists of 6 bytes, first 3 bytes are reserved for VMware Inc. If the VM is created through vSphere (Web) Client connected to direct host, first 3 bytes will be (00:0C:29). If it’s created through vCenter server, first 3 bytes will be (00:50:56). Last 3 bytes of its MAC address are based on:
1-) Physical host’s BIOS unique ID (SMBIOS ID) where VM exists.
2-) Hash based on VM’s name.
Keep in mind that, when VM’s vMotioned, its host is changed and then its MAC address is changed. All settings based on MAC address are re-configured automatically.
3. Disk Provisioning Types:
Thin Provisioning | Best for saving storage. It just uses storage as it’s used inside Guest OS, although the Guest OS sees the full disk as pre-configured. The only disadvantage is that it leads to woeful massive fragmentation which slows down performance somehow. |
Thick Provisioning – Lazy Zeroed | Best for fragmentation. It allocates all the disk storage configured in the Guest OS setup, but it slows down I/O performance due to it padding the allocated storage with zeros before using it simultaneously. |
Thick Provisioning – Eager Zeroed | Best I/O Performance and fragmentation. It allocates all the disk storage configured in the Guest OS and pads it with zeros before using it, so no overhead in the performance. |
4. SCSI Controller Type:
This document from VMware Communities is about all types of VM SCSI Controller Types with many links for each type information and troubleshooting by Andrea Mauro (AndreTheGiant):
http://communities.vmware.com/docs/DOC-10971
Also, this link is only about Para-virtual SCSI Controller:
vSphere 5.5 Documentation Center - Paravirtual SCSI Controller
5. Independent Disks:
You can take snapshot regardless of what mode (Independent or not) you chose. In case of Independent and Persistent mode, when you take a snapshot, any changes that you do on that VM after taking snapshot will be written to the same VM .vmdk file.
In case of Independent and Non-persistent, any changes made after a snapshot will be discarded when this VM is powered off.
In case of Dependent, a new .vmdk file will be created and any changer onwards will be written to that new file.
Independent mode will make you save a space as all the changes are written in the same .vmdk, but it will make revert to snapshot slow.
Dependent mode will make revert to snapshot faster, but you pay price in terms of disk space as it creates new .vmdk file to hold new changes.
6. Snapshots:
This note is all about VMware Snapshot Technology and some of its features: Quiesce Guest File System & Consolidate Snapshots.
The following link is an official KB from VMware:
VMware KB: Understanding virtual machine snapshots in VMware ESXi and ESX
This link is an article by Cormac Hogan about Consolidation of snapshots:
vSphere 5.0 Storage Features Part 9 - Snapshot Consolidate | VMware vSphere Blog - VMware Blogs
Quiesce Guest File System | Holds Guest OS processes in a consistent state when taking snapshot. This applied to only Powered-on VMs. |
Consolidate Snapshots | Manually apply changes from snapshot to its parents. Used when deleting snapshots between current state and a certain parent state doesn’t apply changes. |
7. Clone & Templates:
Clones and templates are great to reduce time required for creating many VMs with same basic configuration (Guest OS, Domain, etc.).
Link provided below, is a great article by Petra Jorgenson explaining and simplifying the process:
VMware Template Creation: Make VMware Templates in vCenter Server
By default, Sysprep files for Windows Vista, 7, Server 2k8 and above already exist on vCenter 5.x.
8. Upgrading VM Hardware Level to 9/10:
By powering down the hardware-levelled-eight VM then right click it and upgrade VM Hardware Level. Another way is through vSphere Web Client.
9. Virtual Machine Swap Files:
vmname-xxxxx.vswp: Used for host-based swap files which reduces memory congestion and allows for memory over-commitment. Its size= Memory configured for VM - Memory reservation for the VM.
vmx-vmname-xxxxxx.vswp: Used for VMX swap files which reduces memory overhead for each VM. This allows better utilization of host memory and reduces losses because of memory overheads (required for some vSphere Kernel operations) for each VM.
10. Virtual Machine Configuration Best Practice:
1-) Choose the correct OS while creating VM to select proper default controllers and settings.
2-) Use only one time sync. software, i.e. for Windows (NTP Server or VMware Tools) and for Linux (Linux NTP(recommended) or VMware Tools).
3-) Use the latest VM Hardware Version, i.e. Version 9 or 10 (if possible).
4-) Install the latest version of VMware Tools.
5-) Don’t over-assign vCPUs for any VM to prevent CPU Scheduler overload and to prevent high RDY %.
6-) When using VMs with vCPUs more than 8, or when enabling vNUMA for higher-performance VMs, try to match vNUMA layout with pNUMA layout, i.e. choose the number of vSockets & vCores matching the underlying pNUMA configuration. (vNUMA is representing the same pNUMA configuration, but to the Guest OS.)
For example: If a host with 2 NUMA nodes, each with 4 cores per socket and you need 8-vCPUs VM, let your vCPUs be configured as 2 vSockets with 4 vCores each not a 1 vSocket with 8 vCores. For a 6-vCPUs VM, let your vCPUs be configured as 2 vSockets with 3 vCores and so on.
7-) If available, try to use SSD caches for Swapping files (Host Cache Configuration).
8-) Size the queue depth of Guest OS and Hosts properly.
9-) Hot Add of CPU and memory must be enabled when the VM is powered down.
10-) Be careful when changing default drivers and controllers.
11-) Be careful when applying Memory Reservation, as the VM won’t be powered up if there’s no enough RAM for Memory Reservation.
12-) Make sure that there’s enough storage for both VMDK files and the Swap files as the VM won’t be powered up if there’s no enough storage for Swap files.
13-) Try to keep VMDK disks aligned with underlying partitions, but not so important for new OS, like Win 7 or Win 2k8. Check also the following nice article by Andrea Mauro (AndreTheGiant)explaining and summarizing how to do that perfectly:
Share the knowledge ...
Previous: vSphere 5.x Notes & Tips - Part II: