0% found this document useful (0 votes)
63 views98 pages

Module 8. Managing Virtual Machines

The document outlines the management of virtual machines (VMs) using VMware technologies, focusing on VM migration techniques such as vSphere vMotion and vSphere Storage vMotion. It emphasizes the importance of skills in migrating VMs, taking snapshots, and managing resources, while detailing the requirements and processes for successful VM migrations. Additionally, it covers Enhanced vMotion Compatibility for ensuring CPU compatibility during migrations and provides guidelines for performing these operations effectively.

Uploaded by

atiliocarvalho0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views98 pages

Module 8. Managing Virtual Machines

The document outlines the management of virtual machines (VMs) using VMware technologies, focusing on VM migration techniques such as vSphere vMotion and vSphere Storage vMotion. It emphasizes the importance of skills in migrating VMs, taking snapshots, and managing resources, while detailing the requirements and processes for successful VM migrations. Additionally, it covers Enhanced vMotion Compatibility for ensuring CPU compatibility during migrations and provides guidelines for performing these operations effectively.

Uploaded by

atiliocarvalho0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 98

Managing Virtual

Machines

© 2022 VMware, Inc.


Importance
Managing VMs effectively requires skills in migrating VMs, taking snapshots, and managing the
resources of the VMs.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-2


Module Lessons
1. Migrating VMs with vSphere vMotion
2. Configuring Enhanced vMotion Compatibility
3. Migrating VMs with vSphere Storage vMotion
4. Cross vCenter Migrations
5. Creating Virtual Machine Snapshots
6. Virtual CPU and Memory Concepts
7. Resource Controls

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-3


Migrating VMs with vSphere vMotion

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Recognize the types of VM migrations that you can perform within a vCenter instance
• Explain how vSphere vMotion works
• Verify vSphere vMotion requirements
• Migrate virtual machines using vSphere vMotion

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-5


About VM Migration
Migration means moving a VM from one host, datastore, or vCenter instance to another host,
datastore, or vCenter instance.
Migration can be cold or hot:
• A cold migration moves a powered-off or suspended VM.
• A hot migration moves a powered-on VM.
vCenter performs compatibility checks before migrating suspended or powered-on VMs to
ensure that the VM is compatible with the target host.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-6


Migration Types
The type of migration that you perform depends on the power state of the VM that you select
in the inventory and the migration type that you select in the Migrate wizard.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-7


About vSphere vMotion
A vSphere vMotion migration moves a powered-on VM from one host (compute resource) to
another.
vSphere vMotion provides the following capabilities:
• Improvement in overall hardware use
• Continuous VM operation while accommodating scheduled ESXi host downtime
• vSphere DRS to balance VMs across hosts

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-8


Configuring vSphere vMotion Networks
vSphere vMotion migrations
require correctly configured
VMkernel adapters on the
source and destination hosts.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1-9


vSphere vMotion Migration Workflow
The source host (ESXi01) and the destination host (ESXi02) can access the shared datastore
that holds the VM’s files.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 10


VM Requirements for vSphere vMotion Migration
For migration with vSphere vMotion, a VM must meet these requirements:
• If it uses an RDM disk, the RDM file and the LUN to which it maps must be accessible by the
destination host.
• It must not have a connection to a virtual device, such as a CD/DVD or floppy drive, with a
host-local image mounted.
You can use vSphere vMotion to migrate a VM with a device that is attached through a remote
console (such as a physical device or disk image).

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 11


Host Requirements for vSphere vMotion Migration (1)
Source and destination hosts must have the following characteristics:
• Accessibility to all the VM’s storage:
– 128 concurrent migrations are possible per datastore.
– If the swap file location on the destination host differs from the swap file location on the
source host, the swap file is copied to the new location.
• VMkernel port with vSphere vMotion activated
• Matching management network IP address families (IPv4 or IPv6) between the source and
destination hosts

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 12


Host Requirements for vSphere vMotion Migration (2)
• The number of concurrent, active vSphere vMotion tasks is a function of the vSphere
vMotion network speed:
– Each active vSphere vMotion process requires a minimum throughput of 250 Mbit/second
(Mbps) on the vSphere vMotion network.
– Concurrent migrations are limited to four on a 1 Gbps network.
– Concurrent migrations are limited to eight on a 10 Gbps (or faster) network.
– For better performance, dedicate at least two VMkernel port groups to the vSphere
vMotion traffic.
• Compatible CPUs:
– The CPU feature sets of both the source host and the destination host must be
compatible.
– Some features can be hidden by using Enhanced vMotion Compatibility or compatibility
masks.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 13


Performing a vSphere vMotion Migration
vSphere vMotion is used to move a powered-on VM to a different host.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 14


Checking Migration Errors
When you select the host or cluster, validation checks are performed to verify that most
vSphere vMotion requirements are met.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 15


Migrating Encrypted VMs
When powered-on, encrypted VMs are migrated, encrypted vSphere vMotion is automatically
used.

For VMs that are not encrypted, select one of


the following encrypted vSphere vMotion
menu items:
• Disabled
• Opportunistic (default): Encrypted
vSphere vMotion is used if the source and
destination hosts support it
• Required: If the source or destination host
does not support encrypted vSphere
vMotion, the migration fails

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 16


Lab 1: vSphere vMotion Migrations
Configure vSphere vMotion networking and migrate virtual machines using vSphere vMotion:
1. Configure vSphere vMotion Networking on sa-esxi-01.vclass.local
2. Configure vSphere vMotion Networking on sa-esxi-02.vclass.local
3. Prepare Virtual Machines for vSphere vMotion Migration
4. Migrate Virtual Machines Using vSphere vMotion

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 17


Review of Learner Objectives
• Recognize the types of VM migrations that you can perform within a vCenter instance
• Explain how vSphere vMotion works
• Verify vSphere vMotion requirements
• Migrate virtual machines using vSphere vMotion

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 18


Configuring Enhanced vMotion
Compatibility

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Describe the role of Enhanced vMotion Compatibility in migrations
• Configure EVC CPU mode on a vSphere cluster
• Explain how per-VM EVC CPU mode works with vSphere vMotion
• Configure EVC Graphics mode on a vSphere cluster or a VM

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 20


CPU Constraints on vSphere vMotion Migration
CPU compatibility between source and target hosts is a vSphere vMotion requirement that
must be met.

CPU Characteristics Exact Match Required Reason


By Source Host and
Target Host
Clock speeds, cache sizes, No The VMkernel virtualizes these
hyperthreading, and number characteristics.
of cores
Manufacturer (Intel or AMD) Yes Instruction sets contain many
family and generation small differences.
(Opteron4, Intel Westmere)
Presence or absence of SSE3, Yes Multimedia instructions are
SSSE3, or SSE4.1 instructions usable directly by applications.
Virtualization hardware For 32-bit VMs: No The VMkernel virtualizes this
assist characteristic.
For 64-bit VMs on Intel: Yes Intel 64-bit with VMware
implementation uses Intel
VT.
© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 21
About Enhanced vMotion Compatibility
Enhanced vMotion Compatibility is a cluster feature that enables vSphere vMotion migrations
between hosts without identical feature sets.
The feature uses CPU baselines to configure all the processors in the cluster that are activated
for Enhanced vMotion Compatibility.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 22


EVC Cluster Requirements for CPU Mode
All hosts in the cluster must meet several CPU-based requirements:
• Use CPUs from a single vendor, either Intel or AMD.
• Be activated for hardware virtualization: AMD-V or Intel VT.
• Be activated for execution-disable technology: AMD No eXecute (NX) or Intel eXecute
Disable (XD).
• Be configured for vSphere vMotion migration.
Applications in VMs must be CPU ID compatible.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 23


Configuring EVC CPU Mode on an Existing Cluster
You configure EVC CPU mode on an existing cluster to ensure vSphere vMotion CPU
compatibility between the hosts in the cluster.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 24


Changing the EVC Mode for a Cluster
Several EVC mode approaches are available to ensure CPU compatibility:
• If all the hosts in a cluster are compatible with a newer EVC mode, you can change the EVC
mode of an existing Enhanced vMotion Compatibility cluster.
• You can configure EVC mode for a cluster that does not have EVC mode configured.
You can raise or lower the EVC mode, but the VMs must be in the correct power state to do so.

EVC Mode VM Power Action


Raise the EVC mode to a CPU • Running VMs can remain powered on.
baseline with more features. • New EVC mode features are not available to the VMs until
they are powered off and powered back on again
(Suspending and resuming the VM is not sufficient.)
Lower the EVC mode to a • Power off VMs if they are powered on and running
CPU baseline with fewer at a higher EVC mode than the one you intend to
features. configure.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 25


Virtual Machine EVC CPU Mode
EVC mode can be applied to some or all VMs in a cluster:
• At the VM level, EVC mode facilitates the migration of VMs beyond the cluster and across
vCenter systems and data centers.
• You can apply more granular definitions of Enhanced vMotion Compatibility for specific VMs.
• VM EVC mode is independent of the EVC mode defined at the cluster level.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 26


Enhanced vMotion Compatibility for vSGA GPUs
EVC can also define a common baseline of GPU feature sets in a cluster.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 27


EVC Cluster Requirements for Graphics Mode
EVC for vSGA GPUs is configured at the ESXi cluster level:
• All ESXi hosts must satisfy GPU requirements of the defined baseline.
• Additional hosts cannot join the cluster if they cannot satisfy the baseline requirements.
• A mixed cluster of ESXi 6.7 and ESXi 7.0 hosts is supported when using Enhanced vMotion
Compatibility at a cluster level.
EVC for vSGA GPUs is configured at a virtual machine level:
• VM compatibility for ESXi 7.0 Update 1 is required (virtual machine hardware version 18).
• VMs using GPU Enhanced vMotion Compatibility at a VM level must run on ESXi 7.0 Update
1.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 28


Configuring EVC Graphics Mode on an Existing Cluster
At the cluster level, you configure EVC for vSGA in the same EVC settings as EVC for CPU.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 29


Virtual Machine EVC Graphics Mode
At the VM level, you configure
EVC for vSGA in the same VM
EVC settings as EVC for CPU.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 30


Review of Learner Objectives
• Describe the role of Enhanced vMotion Compatibility in migrations
• Configure EVC CPU mode on a vSphere cluster
• Explain how per-VM EVC CPU mode works with vSphere vMotion
• Configure EVC Graphics mode on a vSphere cluster or a VM

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 31


Migrating VMs with vSphere Storage
vMotion

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Explain how vSphere Storage vMotion works
• Recognize guidelines for using vSphere Storage vMotion
• Migrate virtual machines using vSphere Storage vMotion
• Migrate both the compute resource and storage of a virtual machine

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 33


About vSphere Storage vMotion
With vSphere Storage vMotion, you can migrate a powered-on VM from one datastore to
another datastore of any type.

Using vSphere Storage vMotion, you can


perform the following tasks:
• Move VMs off arrays for maintenance or to
upgrade.
• Change the disk provisioning type.
• Change VM files on the destination
datastore to match the inventory name of
the VM.
• Migrate between datastores to balance
traffic across storage paths and reduce
latencies.
• Redistribute VMs or virtual disks to different
storage volumes to balance capacity or
improve performance.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 34


vSphere Storage vMotion In Action
vSphere Storage vMotion uses an I/O mirroring architecture to copy disk blocks between the
source and destination.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 35


Identifying Storage Arrays That Support vSphere Storage APIs – Array
Integration
vSphere Storage vMotion offloads its operations to the storage array if:
• The array supports VMware vSphere Storage APIs – Array Integration, also called hardware
acceleration.
• Both datastores are located within the same storage array.
Use the vSphere Client to determine whether your storage array supports hardware
acceleration.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 36


vSphere Storage vMotion Guidelines and Limitations
Guidelines:
• Plan the migration and coordinate with administrators
• Perform migrations during off-peak hours
Limitation:
• Independent virtual machine disks must be in persistent mode

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 37


Changing Both Compute Resource and Storage During Migration
When you change both compute resource and storage during migration, a VM changes its host
and datastore and optionally its network, either within or across vCenter instances.
• This technique combines vSphere vMotion and vSphere Storage vMotion into a single
operation.
• You can migrate VMs across clusters, data centers, and vCenter instances.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 38


Use Cases for Changing Both Compute Resource and Storage
Compute resource and storage migration is useful in the following cases:
• Migrating a VM located on a host's local storage to a host that uses shared storage
• Migrating a VM to a new cluster, when the target cluster does not have access to the source
cluster's storage
• Migrating a VM to a different data center, whose storage is not shared with the source data
center
• Migrating a VM to a different vCenter instance, whose storage is not shared with the source
vCenter instance

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 39


Lab 2: vSphere Storage vMotion Migrations
Use vSphere Storage vMotion to migrate virtual machines:
1. Migrate Virtual Machine Files from One Datastore to Another
2. Migrate Both the Compute Resource and Storage of a Virtual Machine

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 40


Review of Learner Objectives
• Explain how vSphere Storage vMotion works
• Recognize guidelines for using vSphere Storage vMotion
• Migrate virtual machines using vSphere Storage vMotion
• Migrate both the compute resource and storage of a virtual machine

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 41


Cross vCenter Migrations

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Recognize the types of VM migrations that you can perform across vCenter instances

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 43


About Cross vCenter Migrations
With vSphere vMotion, you can migrate VMs between vCenter instances, whether or not they
are in the same Enhanced Linked Mode group.
Cross vCenter migrations are helpful in the following cases:
• Balancing workloads across clusters and vCenter instances that are in the same site or in
another geographical area.
• Moving VMs between environments that have different purposes, for example, from a
development environment to production environment.
• Moving VMs to meet different service level agreements (SLAs) for storage space,
performance, and so on.
• Moving VMs from an on-premises vSphere data center to a data center in the public cloud,
such as VMware Cloud on AWS.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 44


Cross vCenter Migration Requirements
Cross vCenter migrations have the following requirements:
• Hosts must be time-synchronized.
• Both vCenter instances can be in the same or different vCenter Single Sign-On domain.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 45


Performing a Cross vCenter vMotion in Same SSO Domain
In the Migrate wizard, select a compute resource at the destination vCenter instance.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 46


Performing a Cross vCenter vMotion in Different SSO Domain (1)
From the Migrate wizard, select Cross vCenter Server export as the migration type.
Optionally, you can clone the VM rather than migrate it.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 47


Performing a Cross vCenter vMotion in Different SSO Domain (2)
Then, you specify the FQDN or IP address of the target vCenter instance and the vCenter
credentials.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 48


Network Checks for Cross vCenter Migrations
vCenter performs several network compatibility checks to prevent the following configuration
problems:
• MAC address incompatibility on the destination host
• vSphere vMotion migration from a distributed switch to a standard switch
• vSphere vMotion migration between distributed switches of different versions

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 49


VMkernel Networking Layer and TCP/IP Stacks
The VMkernel networking layer provides connectivity to hosts and handles the standard
system traffic of vSphere vMotion, IP storage, vSphere Fault Tolerance, vSAN, and others.
TCP/IP stacks at the VMkernel level that are configured by default:
• Default TCP/IP stack
• vSphere vMotion TCP/IP stack
• Provisioning TCP/IP stack
You can also create a custom TCP/IP stack.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 50


vSphere vMotion TCP/IP Stacks
Each ESXi host has a second TCP/IP stack that is dedicated to vSphere vMotion migration.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 51


About Long-Distance vSphere vMotion Migration
Long-distance vSphere vMotion migration is an
extension of cross vCenter migration.
vCenter instances are spread across large
geographic distances and where the latency
across sites is high.
Use cases for long-distance vSphere vMotion
migration:
• Permanent migrations
• Disaster avoidance
• Site Recovery Manager and disaster
avoidance testing
• Multisite load balancing
• Follow-the-sun scenario support

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 52


Networking Prerequisites for Long-Distance vSphere vMotion
Long-distance vSphere vMotion migrations must connect over layer 3 connections:
• Virtual machine network:
— L2 connection
— The same VM IP address is available at the destination
• vSphere vMotion network:
— L3 connection
— 250 Mbps per vSphere vMotion operation
— Round-trip time between hosts can take up to 150 milliseconds.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 53


Review of Learner Objectives
• Recognize the types of VM migrations that you can perform across vCenter instances

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 54


Creating Virtual Machine Snapshots

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Take a snapshot of a virtual machine
• Manage multiple snapshots
• Delete virtual machine snapshots
• Consolidate snapshots

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 56


About VM Snapshots
With snapshots, you can preserve the state of the VM so that you can repeatedly return to the
same state.
For example, if problems occur during the patching or upgrading process, you can revert to the
previous state.
VM snapshots are not recommended as a VM backup strategy.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 57


Taking Snapshots
You can take a snapshot while a VM is powered
on, powered off, or suspended.
A snapshot captures the following items:
• VM configuration
• VM memory state (optional)
• Virtual disks
A snapshot capture does not include
Independent virtual disks (persistent and
nonpersistent).

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 58


Types of Snapshots
A delta or child disk is created when you create a snapshot:
• On the datastore, the delta disk is a sparse disk.
• Delta disks use different sparse formats depending on the type of datastore.

Snapshot Datastore Type Filename Block


Type Size
VMFSsparse • VMFS5 with virtual disks smaller than 2 #-delta.vmdk 512 bytes
TB
SEsparse • VMFS6 #-sesparse.vmdk 4 KB
• VMFS5 with virtual disks larger than 2
TB
• Space efficient (thin provisioned)
• Supports disk reclamation (unmap)
vsanSparse • vSAN Delta object 4 MB

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 59


VM Snapshot Files
A snapshot consists of a set of files:
• -Snapshot#.vmsn: Configuration state
• -Snapshot#.vmem: Memory state (optional)
• -00000#.vmdk: Disk descriptor
• -00000#-delta.vmdk: VMFS5 delta
• -00000#-sesparse.vmdk: VMFS6 delta
• .vmsd: Stores names, descriptions, and
relationships for all the VM's snapshots

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 60


VM Snapshot Files Example (1)

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 61


VM Snapshot Files Example (2)

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 62


VM Snapshot Files Example (3)

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 63


Managing Snapshots
In the vSphere Client, you can view snapshots for the active VM and take edit, delete, and
revert to actions.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 64


Deleting VM Snapshots (1)
If you delete a snapshot one or more levels above the, You are here level, the snapshot state
is deleted. In this example, the snap01 data is committed into the parent (base disk), and the
foundation for snap02 is retained.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 65


Deleting VM Snapshots (2)
If you delete the latest snapshot, the changes are committed to its parent. The snap02 data is
committed into snap01 data, and the snap02 -delta.vmdk file is deleted.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 66


Deleting VM Snapshots (3)
If you delete a snapshot one or more levels below the You are here level, subsequent
snapshots are deleted, and you can no longer return to those states. The snap02 data is
deleted.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 67


Deleting All VM Snapshots
The delete-all-snapshots mechanism uses storage space efficiently. The size of the base disk
does not increase. Snap01 is committed to the base disk before snap02 is committed.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 68


About Snapshot Consolidation
Snapshot consolidation is a method for committing a chain of delta disks to the base disks
when the Snapshot Manager shows that no snapshots exist, but the delta disk files remain on
the datastore.

Snapshot consolidation resolves problems that might occur with snapshots:


• The snapshot descriptor file is committed correctly, and the Snapshot window shows that all
the snapshots are deleted.
• The snapshot files (-delta.vmdk or -sesparse.vmdk) still exist in the VM's folder on the
datastore.
• Snapshot files can continue to expand until they reach the size of the -flat.vmdk file or
until the datastore runs out of space.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 69


Discovering When to Consolidate Snapshots
On the Monitor tab under All Issues for the VM, a warning notifies you that a consolidation is
required.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 70


Consolidating Snapshots
After the snapshot
consolidation warning appears,
you can use the vSphere Client
to consolidate the snapshots.
All snapshot delta disks are
committed to the base disks.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 71


Lab 3: Working with Snapshots
Take VM snapshots, revert a VM to a different snapshot, and delete snapshots:
1. Take Snapshots of a Virtual Machine
2. Add Files and Take Another Snapshot of a Virtual Machine
3. Revert the Virtual Machine to a Snapshot
4. Delete a Snapshot
5. Delete All Snapshots

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 72


Review of Learner Objectives
• Take a snapshot of a virtual machine
• Manage multiple snapshots
• Delete virtual machine snapshots
• Consolidate snapshots

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 73


Virtual CPU and Memory Concepts

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Describe CPU and memory concepts in relation to a virtualized environment
• Recognize techniques for addressing memory resource overcommitment
• Identify additional technologies that improve memory use
• Describe how VMware Virtual SMP works
• Explain how the VMkernel uses hyperthreading

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 75


Memory Virtualization Basics
vSphere has the following layers of memory:
• Guest OS virtual memory is presented to
applications by the operating system
• Guest OS physical memory is presented to
the virtual machine by the VMkernel
• Host machine memory that is managed by
the VMkernel provides a contiguous,
addressable memory space that is used by
the VM

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 76


VM Memory Overcommitment
Memory is overcommitted when the combined
configured memory footprint of all powered-on
VMs exceeds that of the host memory sizes.
When memory is overcommitted:
• VMs do not always use their full allocated
memory
• To improve memory use, an ESXi host
reclaims memory from idle VMs to allocate
to VMs that need more memory
• VM memory can be swapped out to
the .vswp file
• VM memory overhead can be swapped out
to the vmx-*.vswp file

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 77


Memory Overcommit Techniques
An ESXi host uses memory overcommit techniques to allow the overcommitment of memory
while possibly avoiding the need to page memory out to disk.

Methods Used by the ESXi Details


Host
Transparent page sharing This method economizes the use of physical memory
pages. In this method, pages with identical contents are
stored only once.
Ballooning This method uses the VMware Tools balloon driver to
deallocate memory from virtual machines. The ballooning
mechanism becomes active when memory is scarce,
sometimes forcing VMs to use their own paging areas.
Memory compression This method reduces a VM's memory footprint by storing
memory in a compressed format.
Host-level SSD swapping The ESXi host can swap out memory to locally-attached
solid-state drives.
VM memory paging to disk Using VMkernel swap space is the last resort
because of poor performance.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 78


Configuring Multicore VMs
You can build VMs with multiple virtual CPUs (vCPUs). The number of vCPUs that you configure
for a single VM depends on the physical architecture of the ESXi host.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 79


About Hyperthreading
With hyperthreading, a core can execute two
threads or sets of instructions at the same
time:
• Hyperthreading provides more logical CPUs
on which vCPUs can be scheduled
• Hyperthreading is activated by default
To activate hyperthreading:
• Verify that the host system supports
hyperthreading
• Activate hyperthreading in the system BIOS
• Ensure that hyperthreading for the ESXi
host is turned on

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 80


CPU Load Balancing
The VMkernel balances
processor time to guarantee
that the load is spread
smoothly across processor
cores in the system.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 81


Review of Learner Objectives
• Describe CPU and memory concepts in relation to a virtualized environment
• Recognize techniques for addressing memory resource overcommitment
• Identify additional technologies that improve memory use
• Describe how VMware Virtual SMP works
• Explain how the VMkernel uses hyperthreading

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 82


Resource Controls

© 2019 VMware Inc. All rights reserved.


Learner Objectives
• Assign share values for CPU and memory resources
• Describe how virtual machines compete for resources
• Define CPU and memory reservations and limits

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 84


Reservations, Limits, and Shares
Beyond the CPU and memory configured for a
VM, you can apply resource allocation settings
to a VM to control the amount of resources
granted:
• A reservation specifies the guaranteed
minimum allocation for a VM
• A limit specifies an upper bound for CPU or
memory that can be allocated to a VM
• A share is a value that specifies the relative
priority or importance of a VM's access to a
given resource

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 85


Resource Allocation Reservations: RAM
RAM reservations:
• Memory reserved to a VM is guaranteed never to swap or balloon.
• If an ESXi host does not have enough unreserved RAM to support a VM with a reservation,
the VM does not power on.
• Reservations are measured in MB, GB, or TB. The default is 0 MB.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 86


Resource Allocation Reservations: CPU
CPU reservations:
• CPU that is reserved for a VM is guaranteed to be immediately scheduled on physical cores.
The VM is never placed in a CPU ready state.
• If an ESXi host does not have enough unreserved CPU to support a VM with a reservation,
the VM does not power on.
• Reservations are measured in MHz or GHz.
• The default is 0 MHz.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 87


Resource Allocation Limits
RAM limits:
• VMs never consume more physical RAM
than is specified by the memory allocation
limit.
• VMs use the VM swap mechanism (.vswp) if
the guest OS attempts to consume more
RAM than is specified by the limit.
CPU limits:
• VMs never consume more physical CPU than
is specified by the CPU allocation limit.
• CPU threads are placed in a ready state if
the guest OS attempts to schedule threads
faster than the limit allows.
Usually, specifying a limit is not necessary.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 88


Resource Allocation Shares
Shares define the relative importance of a VM:
• If a VM has twice as many shares of a resource as another VM, the VM is entitled to consume
twice as much of that resource when these two VMs compete for resources.
• Share values apply only if an ESXi host experiences contention for a resource.
You can set shares to high, normal, or low. You can also select the custom setting to assign a
specific number of shares to each VM.

Setting CPU Share Values Memory Share Values


High 2,000 shares per vCPU 20 shares per MB of configured VM
memory
Normal 1,000 shares per vCPU 10 shares per MB of configured VM
memory
Low 500 shares per vCPU 5 shares per MB of configured VM
memory

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 89


Resource Shares Example (1)
VMs are resource consumers. The default resource settings that you assign during VM creation
work well for most VMs.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 90


Resource Shares Example (2)
You can add shares to a virtual machine while it is running.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 91


Resource Shares Example (3)
Shares guarantee that a VM is given a certain amount of a resource.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 92


Resource Shares Example (4)
When you delete or power off a VM, fewer total shares remain, so the surviving VMs get more
access.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 93


Defining Resource Allocation Settings for a VM
You can edit a VM's settings to configure CPU and memory resource allocations.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 94


Viewing VM Resource Allocation Settings
You can view reservations, limits, and shares settings for all VMs in a cluster.

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 95


Lab 4: Controlling VM Resources
Observe the behavior of VMs with different CPU share values:
1. Create CPU Contention
2. Verify the CPU Share Functionality

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 96


Review of Learner Objectives
• Assign share values for CPU and memory resources
• Describe how virtual machines compete for resources
• Define CPU and memory reservations and limits

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 97


Key Points
• Hot migrations use vSphere vMotion, vSphere Storage vMotion, or both.
• You can migrate VMs between vCenter instances, whether they are in the same SSO domain,
different SSO domain, or geographically far apart.
• Enhanced vMotion Compatibility prevents vSphere vMotion migrations from failing because
of incompatible CPUs or incompatible vSGA GPUs.
• You can use VM snapshots to preserve the state of the VM so that you can return repeatedly
to the same state.
• You can apply reservations, limits, and shares against a VM to control the amount of CPU
and memory resources granted.
Questions?

© 2022 VMware, Inc. M08_Managing Virtual Machines | 1 - 98

You might also like