VCP 5 – Objective 4.1 – Create and Deploy Virtual Machines

Identify capabilities of virtual machine hardware versions

Virtual Machine hardware versions dictate what hardware devices and types/versions of hardware devices are available to a VM.  The hardware version of a VM can be found on the summary tab in the VM Version field.  The different versions available are as follows
  • 8 – ESXi 5 – ability for up to 1TB of RAM and 32 vCPUs – 3D graphics and HD Audio, SmartCard Reader, USB 3, new driver for e1000.
  • 7 – ESXi 4 – ability for 255 GB RAM and 8 vCPUs – Introduced CBT, VM Hotplug, VMXNET 3, IDE Virtual Devices, SAS Virtual Devices.
  • 4 – ESX 3.x – ability for 64 GB of RAM (3.5), 16 GB RAM (3.0) and 4 vCPUs

Identify VMware Tools device drivers

The VMware Tools installation contains many device drivers which help to enhance performance.  It depends on the Operation System which ones get installed, but this is a list of what can be installed…
  • SVGA Driver – Enables 32-bit displays, high display resolution and faster graphics performance.  On windows based systems who are vista or later the VMware SVGA 3D (WDDM) driver is installed to support Aero.
  • SCSI Driver – If you specify to use a BusLogic Adapter, the guest OS uses this driver.  Some recent guest OSes will contain LSI Logic Parallel or SAS.
  • Paravirtual SCSI Driver – used for pvscsi adapters
  • VMXNet drivers – vmxnet and vmxnet3 drivers improve networking performance.
  • Mouse Driver – improves mouse performance.  This driver is required if you are going to use terminal services.
  • Audio Driver 
  • Kernel module for sharing folders – called hgfs.sys on windows and vmhgfs on Linux.  Used to share folders between hosts and guests. (in fusion or workstation).
  • ThinPrint Driver – used to add printers assigned to the host to the virtual machines.
  • Memory Control Driver – Use this, otherwise memory performance may be hindered.
  • Modules and Drivers that support making automatic backups – VSS modules for Windows vista and up.  Filesystem sync driver for others.
  • VMCI – used for more efficient communication between virtual machines.
Identify methods to access and use a virtual machine console
 
The old 'Generate Console URL' is gone, however you can now access the console from the web client as well as the original vSphere client.  
 
A few notables
  • You need to download and install the Client Integration Plug-In to use the console in the web client
  • There are a few configurable options in the web client with regards to the console.
    • Guest OS lock (*) – Locks the remote console after the last remote user disconnects.
    • Max Number of Sessions – Limits the simultaneous connections to the VM.

Identify virtual machine storage resources

Not sure what should go in this section.  Jason Langer put a description of the files that make a VM up so I guess I will do the same 🙂
 
So, A VM is made up of several different files as follows
  • .vmx – Virtual machine configuration File
  • .vmxf – Additional VM Config File
  • .vmdk – Virtual disk characteristics
  • -flat.vmdk – preallocated virtual disk
  • .nvram – BIOS config
  • .vmsd – snapshot database
  • .vmsn – snapshot data file
  • .vswp – swap file
  • .vmss – VM suspend file
  • .log – log file
  • #.log – old log files.
Place virtual machines in selected ESXi hosts/Clusters/Resource Pools
 
The placement of a VM in a resource pool has already been explained in section 5.3 of my blueprint notes.  As for hosts and clusters, during the New VM wizard you are prompted for a location to place your VM.  You can select either a cluster or a host.  If you select a cluster that is not DRS enabled, it will prompt you for a host as well.  
 
For this sake I will briefly go over the process to create a new VM.
  1. Right click your target object and select 'New Virtual Machine'.
  2. Select a configuration option for the VM.
    • Typical – allows you specify
      • VM name and inventory location
      • Location to place the VM
      • Datastore to store the files.
      • Guest OS and Version
      • Parameter for virtual disk size and provisioning settings.
    • Custom
      • Includes everything from typical as well as
      • VM version (hardware version)
      • Number of vCPUs and Memory size
      • Number of NICs, Network to connect to and adapter type
      • SCSI Controller type
      • Disk type (new, existing, RDM, or no disk)
  3. Enter a name and location for the VM.  Name can be 80 characters long and must be unique within folders they are stored.  Location is a folder within your datacenter.
  4. Specify a host/cluster to host the VM, then specify a resource pool
  5. Select a datastore or datastore cluster to store the VM files on.  You can also disable Storage DRS at this point and point directly to a datastore within a datastore cluster.  Optionally as well you can select a VM Storage Profile..
  6. Select a Virtual Machine Hardware version (options are version 7 and 8).
  7. Select your OS.
  8. Select your number of CPUs and your cores per socket.
  9. Select the amount of memory to give the VM.  Sliders indicate Minimum, default, Maximum, Max for best performance, and max total recommended memory
  10. Select  number NICs to add and the corresponding network and adapter type associated with them as well as if they are connected at power on or not.
  11. Select your SCSI Controller type
    • BusLogic Parallel
    • LSI Logic Parallel
    • LSI Logic SAS
    • VMware Paravirtual
  12. Select  your disk type (New, Existing, RDM, or no disk)  Continue to select disk provisioning options (thick lazy zero, thick eager zero, or thin) as well as select another datastore for the disk if you want.
    • Thick Lazy Zeroed
      • All disk space is allocated up front but only the space needed immediately is provisioned.  The remaining space on the disk will be zeroed out on first write.
    • Thick Eager Zeroed
      • All disk space is allocated and zeroed out up front.
    • Thin
      • Uses only as much space as the disk needs and is allocated more on demand up to it's capacity.
  13. Select your advanced options.  The device node can be changed, as well as the disk mode (Independent).  Independent disks are not affected by snapshots and there are two types of independent disks.
    • Persistent – changes are immediately and permanently written to disk
    • Nonpersistent – changes to the disk are discarded when powered off.
  14. DONE!
Configure and deploy a Guest OS into a new virtual machine
 
Configuring the guest OS inside a VM is just the same as configuring and deploying the guest OS on a physical machine, except for the virtual CDROM part.  Basically you can just mount an ISO from a datastore to the CDROM of the VM, or connect the VM to either the hosts CDROM or the CDROM of the machine running the client.
 
If the boot sequence of the VM is too quick for you to get into the BIOS to change the boot order you can either Force the VM into the BIOS on next boot or delay the boot sequence by a number of seconds.
 
Configure/Modify disk controller for virtual disks
 
In order to modify a disk controller for a VM you first need to power the VM off.  After that go into the VMs settings and select the disk controller and click the 'Change Type' button.  To add a new SCSI controller you first need to add another virtual disk.  When adding the disk you specify the SCSI address as one different than the current (1:0, 2:0, 3:0).  When adding the disk vSphere will add another SCSI controller as well.
 
Configure appropriate virtual disk type for a virtual machine
 
I've already explained the different disk types above.  Choosing the appropriate one can sometimes by cut and dry and other times be a bit more difficult.  There are some definites though.  If you plan on using FT on your VM you need to use Thick Eager Zeroed.  I believe if you plan on using Microsoft NLB it is recommended to use an RDM.  If you need direct access to the underlying storage again you need an RDM.
 
Create/Convert thin/thick provisioned virtual disks
 
You can create disks from thin to thick in a couple of ways.  One way is to browse to your VM in the datastore browser.  When you find the .vmdk file that you wish to convert, right-click and select Inflate.  Another way is to simply storage vMotion the VM.  This will give you the option of converting the disk at the target datastore.
 
Configure disk shares
 
In most cases you have multiple VMs accessing the same datastore or same LUN.  Disk shares are the answer to prioritizing each virtual disk from one another by placing them in low and high priority classes.  Since disk I/O is a host centric resource it cannot be pooled, thus making disk shares configured on a host level.  You can allocate the host i/o to the VMs on that host and allow certain VMs priority over others.    Just as DRS shares are setup, disk shares are the same.  A share is a relative value that looks at the total number of shares on the host.  You can also set and IOP limit, which sets and upper bound for the storage resources allocated to a VM.
 
The process for setting shares are as follows
  1. Right click the VM and select Edit Settings
  2. Click disk on the resource tab
  3. Set the Shares value Low(500), Normal (1000), High(2000), or custom
  4. Select the Limit – IOps field and enter in the upper bound for IOPs
  5. DONE
Install/Upgrade/Update VMware Tools
 
Installing VMware Tools
  1. Either from the console menu of the VM Select VM->Guest-> Install/Upgrade VMware tools or Right click the VM and select Guest -> Install/Upgrade VMware Tools.
  2. Chose whether to do an interactive or automatic installation.  (automatic will reboot the VM)
  3. Follow through the wizard.  Included within the VMware Tools installation is the following
    • Drivers
      • explained above.
    • VMware Tools Service
      • Passes messages between hosts and guests
      • Runs scripts that help automate guest operations (ran when power state changes).
      • Synchronizes Time in the guest with the host.
      • Allows pointer to move freely from console to the client OS.
      • helps create the quiesced snapshots
      • Sends heartbeats to host to indicate system is running
    • VMware User Process
      • Copy/Paste and Drag/Drop.
  4. When prompted, reboot the VM. 
Configure virtual machine time synchronization
 
There are a couple of ways to setup and configure time synchronization.
 
In the GUI
  • Within the GUI on the guest select the options tab on the VMware Tools Property box.
  • Check/Uncheck the option labeled 'Time Synchronization between the VMs and the ESX Server"

Using the VMware Tools configuration utility.

This is a command line interface that you can use to modify VMware tools settings.  To setup time synchronization do the following

  • navigate to the VMware Tools installation folder and execute one of the following commands
  • VMwareToolboxCmd timesync status -displays the status of the time sync (enabled or disabled)
  • VmwareToolboxCmd timesync enable or disable – enable or disable timesync

You can disable timesync completely by adding the following lines to the vmx file of the VM.

tools.syncTime = "FALSE"

time.synchronize.continue = "FALSE"
time.synchronize.restore = "FALSE"
time.synchronize.resume.disk = "FALSE"
time.synchronize.shrink = "FALSE"
time.synchronize.tools.startup = "FALSE"
 
Convert a physical machine using VMware Converter
 
The process of converting a physical machine that is powered on  is as follows.
  1. Install the VMware converter standalone on a machine.  See the guide for supported OSes as it is too lengthy to list here.  Start the wizard and select 'Convert Machine'
  2. Select your source machine.  There are a few other options for this.
    • Be sure that the converter standalone server has network access to the source machine
    • Turn off the firewall on the source machine
    • Disable simple file sharing on the source.
    • make sure that no other conversion job is running against the source.
    • If you have any Converter 3.x on the source, un install them.
    • You will need to select whether the source is local (the machine you are on) or remote (provide IP and OS type.)
    • This step will install the converter standalone agent on the source machine.
    • If source is a Linux machine, be sure to use the root account.  Also, be sure you are using GRUB as LILO is not supported.
  3. Select a destination for the new VM.  There are in turn a couple of destinations.
    • Managed Destination (ESX/ESXi)
      • Select VMware Infrastructure virtual machine as the destination type.
      • Provide IP or host name along with credentials of the host or vCenter server.
      • Give the new VM a name and select a folder (if using vCenter) to store it in.
      • You can now customize the location of the VM by selecting and host, resource pool or a cluster.  If using DPM with the cluster you should temporarily set it to manual to avoid a host from being powered off during the conversion.
      • Select a datastore to store the files on.
      • Select the VM version (hardware).
    • Hosted Destination (workstation, fusion, server, or player).
      • Select VMware Workstation or other VMware virtual machine.
      • Select the correct target for the VM in the VMware product box.
      • Provide a name for the VM
      • Specify a location to store the files (can be a remote path '\\server\c$\" or a local path c:\
      • Provide user credentials if using network path.
  4. Configure the hardware of the destination VM
    • Select your data copy type.  Options include
      • Copy all disks and maintain layout – basically disk based cloning.
      • Select volumes to copy – volume based cloning, performed at file or block level.
      • Linked Clone – creates the VM that shares the disk with the source machine.  available only on hosted sources and hosted destinations.
    • Resize Volume – allows you to resize the disks.  Options include
      • Maintain size
      • Min size – copies only used space
      • Type size in GB – max 999GB
      • Type size in MB – max 999GB
    • You also have the options to add, remove and move disks around at this point as well as perform disk alignment as well.
    • Edit the number of processors and cores.
    • Allocate memory for the VM
    • Specify a disk controller (SCSI BusLogic, IDE, LSI Logic, LSI Logic SAS)
    • Configure the network settings.
  5. Configure Guest Software
    • Customize the Guest OS (identity, computer name, domain, etc).
    • Chose whether to install VMware tools inside the Guest OS.
  6. Configure conversion job
    • Chose whether to remove system restore checkpoints (speeds up conversion).
    • Chose whether to stop certain services on the source machine during the conversion
    • Chose startup mode for destination services.
    • Chose whether to power off source and power on destination after conversion.
    • Limit conversion resources.
    • Chose whether to remove the agent after conversion
  7. DONE
Import a supported virtual machine source using VMware Converter
 
Conversion/import process is quite similar.  Supported virtual machines and images include
  • VMware Virtual Machines, backup images, and third-party VMs such as workstation, and server
  • VCB
  • Acronis TrueImage
  • Microsoft Virtual PC
  • Virtual Server
  • Symantec Backup Exec Server Recovery (live state recovery).
  • StorageCraft
  • Parallels Desktop/Workstation
  • Norton Ghost (only sv2i).
Modify virtual hardware settings using VMware Converter
 
This was explained above during the conversion process.
 
Configure/Modify virtual CPU and Memory resources according to OS and application requirements
 
Configuring/Monitoring CPU resources
 
If you are constantly seeing High CPU host usage or VM CPU ready values above 20% the following solutions may help.
  • Verify VMware tools is installed on every VM on the host.
  • Compare the CPU of all VMs on the host or resource pool using a stacked bar chart.
  • Determine whether high ready time is resulted from a CPU limit, if so, increase the limit
  • Increase the shares to give VM more opportunities to run.  If host ready time doesn't decrease (since it is constrained) increase CPU reservations for high priority machines.
  • Decrease the number of vCPUs
  • increase memory allocated to VM.  This should in turn decrease disk and network activity for apps that cache.
  • If the VM is not in a DRS cluster, add it to one.  If it is, increase the number of hosts or migrate one ore more VMs off of the host.
  • Upgrade the physical CPUs or cores on the host
  • Use the newest version of vSphere and enable CPU saving features like TCP segmentation offload, large memory pages, and jumbo frames.
 
Configuring/Monitoring Memory resources
 
If you are constantly seeing high or low memory usage or free memory is consistently 6% or less and swapping is occurring the following steps may help.
  • Again, verify VMware tools is installed.  The balloon driver is included with the tools and is critical to performance.
  • Verify that the balloon driver is enabled.
  • Reduce the memory space on the VM and correct cache size if it is too big.
  • If reservations is set to a value much higher than it's active memory, decrease this reservation so the vmkernel can reclaim the idle memory for other VMs
  • Migrate 1 or more VMs to another host.
  • Add Physical memory.
 
Configure/Modify virtual NIC adapter and connect virtual machines to appropriate network resources
 
Adding a new NIC is a very simple task.  Simply Right-click your VM -> Edit Settings.  Select Add and your nic type.  Only those NIC types that are available for your OS are displayed.  Nic types include
  • Vlance
    • an emulated version of the AMD PCnet32 Lance.  This is an older 10MBps NIC with drivers for most 32 bit systems except Vista and later.
  • VMXNET
    • No physical counterpart, optimized for performance in a VM, needs VMware Tools
  • VMXNET 2 (Enhanced)
    • Like VMXNET but provides high-performance features such as jumbo frames and hardware offloads.  Only available for some OSes and must be on ESX 3.5 or later.
  • VMXNET 3
    • Next generation of paravirtualized NIC designed for performance.  All the features that VMXNET 2 had but adds multiqueue support (Receive side scaling), IPv6 offloads, and MSI/MSI-X interrupt delivery.  Supported only on hardware version 7 and later
  • Flexible
    • Identifies itself as a VLANCE during boot, but initializes as a vlance or vmxnet  after the driver is initialized.  If VMware tools is installed, it will be a vmxnet.
  • E1000
    • Emulated version of Intel 82545EM.
  • E1000e
    • Emulates a new model of the Intel GB adapters.  Only available on hardware version 8 in vSphere 5
Along with NIC type you can select what vSwitch the NIC is attached to, as well as whether or not it should be connected at power on.
 
Modifying a current nic is similar to adding a nic, you cannot change the type (you will have to add another NIC to do that), but you can change the MAC address.  You can also select Advanced Settings on the NIC in order to select a port within the vSwitch to connect to.
 
Determine appropriate datastore locations for virtual machines based on application workloads
 
First off you will need to know what your application workloads.  This can be done in a number of ways including the graphs in the client as well as esxtop.  The main counters to watch within ESXTOP are as follows
  • CMDS/s – Number of IOPS being sent to or coming from the device or VM.
  • DAVG/cmd – Average response time in milliseconds per command being sent to the device
  • KAVG/cmd – amount of time the command spends in the VMkernel
  • GAVG/cmd – response time as it is perceived by the guest OS. (DAVG + KAVG)

Once you determine the requirements for your VM, one could use VM Storage Profiles to ensure that VMs are on their intended disks, even with Storage DRS enabled.

2 thoughts on “VCP 5 – Objective 4.1 – Create and Deploy Virtual Machines

Leave a Reply

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