BKNET VSICM8 M7 Deploying-Virtual-Machines

Download as pdf or txt
Download as pdf or txt
You are on page 1of 94

Module 7: Deploying

Virtual Machines
Importance

Virtual machines are the foundation of your virtual infrastructure.


Deploying VMs effectively involves recognizing the different types of virtual
hardware. It also requires skills in creating, cloning and managing VMs
and templates, modifying VMs, and updating templates.

2
Module Lessons

1. Creating Virtual Machines


2. Virtual Machine Hardware Deep Dive
3. Modifying Virtual Machines
4. Creating Templates and Cloning VMs
5. Introduction to Content Libraries
6. Subscribing to Content Libraries
7. Managing Templates in a Content Library

3
Lesson 1: Creating Virtual Machines
Learner Objectives

• Create and provision a virtual machine


• Explain the importance of VMware Tools
• Install VMware Tools
• Remove a virtual machine

5
About Provisioning Virtual Machines
You can create VMs in several ways.

6
Creating VMs with the New Virtual Machine Wizard
In the vSphere Client, you can use the New Virtual Machine wizard to
create a VM.

7
New Virtual Machine Wizard: Name, Folder, Compute
Resource
You can use the New Virtual Machine wizard in the vSphere Client to
create a VM.
The New Virtual Machine wizard prompts you for standard information:
• The VM name
• Folder in which to place the VM
• Resource on which the VM runs

8
New Virtual Machine Wizard: Name, Folder, Compute
Resource

9
New Virtual Machine Wizard: Storage, Compatibility

You select the datastore on which to store the VM’s files.


You select the ESXi version that this virtual machine will be compatible with

10
New Virtual Machine Wizard: Guest Operating System
You select the guest OS to be installed in the VM.

11
New Virtual Machine Wizard: Virtual Hardware
You can configure the virtual machine hardware. The default values for CPU,
memory and hard disk size are based on the guest OS that you selected.

You can also mount the ISO


image containing the guest
operating system installation
files.

12
Installing the Guest Operating System
Installing a guest operating system in your VM is similar to installing it on a
physical computer.

13
About VMware Tools
VMware Tools is a set of features that enhance the performance of a VM’s
guest operating system.
Benefits and features include:
• Device drivers • Increased graphical
– SVGA display performance
– VMXNET/VMXNET3 • Improved mouse performance
– Balloon driver for memory management • Guest OS heartbeat service
– Sync driver for quiescing I/O • Time synchronization
– Paravirtual SCSI controller • Ability to shut down the VM
remotely

14
Installing VMware Tools
Ensure that you select the latest version of VMware Tools for your guest
operating system.
To find out which VMware Tools ISO images are bundled with vSphere 8, see the
vSphere 8 Release Notes.
The method for installing VMware Tools depends on the guest operating system
type.

15
Downloading VMware Tools
You can download a specific version of VMware Tools from the VMware
Tools product download page.

For information about installing VMware Tools in specific guest operating


systems, see VMware Tools Administration at
https://docs.vmware.com/en/VMware-Tools/index.html 16
Deploying OVF Templates
You can deploy any VM or virtual
appliance stored in OVF format.
Virtual appliances are preconfigured
VMs:
• They are usually designed for a
single purpose.
• They are also available from
VMware Marketplace.

17
Removing VMs
You can remove a VM in the following ways:
• Remove from the inventory:
– The VM is unregistered from the ESXi host and vCenter.
– The VM’s files remain on the disk.
– The VM can later be registered (added) to the inventory.
• Delete from disk:
– All VM files are permanently deleted from the datastore.
– The VM is unregistered from the ESXi host and vCenter.

18
Lab 12: Creating and Removing a Virtual Machine

Use the vSphere Client to create a VM, remove a VM from the


inventory, and delete a VM from the datastore:
1. Create a Virtual Machine
2. Remove the Virtual Machine from the vCenter Inventory
3. Register the Virtual Machine to Re-Add it to the vCenter Inventory
4. Delete the Virtual Machine from the Datastore

19
Lab 13: (Simulation) Installing VMware Tools

Use the vSphere Client to install VMware Tools to an existing


Windows VM:
1. Mount the VMware Tools Image to the VM's DVD Drive
2. Install VMware Tools with the VMware Tools Setup Wizard
3. Verify that VMware Tools Is Running in the Guest OS

20
Review of Learner Objectives

• Create and provision a virtual machine


• Explain the importance of VMware Tools
• Install VMware Tools
• Remove a virtual machine

21
Lesson 2: Virtual Machine Hardware
Deep Dive
Learner Objectives

• Identify the files that make up a VM


• Compare VM hardware versions
• Recognize the virtual hardware components of a VM
• Navigate the vSphere Client and examine VM settings
• Identify methods for accessing a VM console

23
Virtual Machine Encapsulation
Each VM is stored either as a collection of
files or objects:
• Files in a directory on a VMFS or NFS
datastore
• Objects on a vSAN or vSphere Virtual
Volumes datastore
Each virtual disk is encapsulated into a
single file or object.

24
About Virtual Machine Files
A VM includes a set of related files.

25
About VM Virtual Hardware

26
Virtual Hardware Versions
The virtual hardware version, or VM compatibility level, determines the operating
system functions that a VM supports.
Do not use a later version that is not supported by the VMware product.

27
About CPU and Memory
You can add, change, or configure CPU and memory resources to improve
VM performance.
The maximum number of virtual CPUs (vCPUs) that you can assign to a
VM depends on the
following factors:
• The number of logical CPUs on the host
• The type and version of installed guest operating system
A VM running on an ESXi 8.0 host can have up to 768 vCPUs.
The maximum memory size of a VM depends on the VM’s compatibility
setting.
The maximum memory size of a VM with ESXi 8.0 compatibility running on
ESXi 8.0 is 24 TB.
28
Compute Maximums
vSphere provides compute maximums, which are available at
https://configmax.vmware.com.

For all configuration maximums, see https://configmax.vmware.com


29
About Virtual Storage

Virtual disks are connected to virtual storage adapters.


The ESXi host offers VMs several choices in storage adapters:
• BusLogic Parallel
• LSI Logic Parallel
• LSI Logic SAS
• VMware Paravirtual SCSI
• AHCI SATA controller
• Virtual NVMe

30
About Thick-Provisioned Virtual Disks
Thick provisioning uses all the defined disk space at the creation of the
virtual disk, regardless of how much disk space is actually used by the
guest operating system file system.
Thick-provisioned disk types are either eager zeroed or lazy zeroed:
• In an eager-zeroed thick-provisioned disk, every block is prefilled with a
zero.
• In a lazy-zeroed thick-provisioned disk, a block is filled with zeroes
before data is written for the first time.

31
About Thick-Provisioned Virtual Disks

32
About Thin-Provisioned Virtual Disks
With thin provisioning, VMs use the disk space as needed:
• Virtual disks use only the capacity needed to hold the current files.
• The VM always sees the full allocated disk size.
Run the unmap command to reclaim the unused space from the virtual
disks.
Reporting and alerts help manage allocations and capacity.
You can mix thick and thin formats.

33
About Thin-Provisioned Virtual Disks
The following examples show efficient use of
storage:
• Provisioned space for virtual disks: 140 GB
• Available datastore capacity: 100 GB
• Used datastore capacity: 80 GB

34
Managing Datastores Containing ThinProvisioned Disk
When the total provisioned space of thin-provisioned disks is greater than
the size of the datastore, the datastore becomes overcommitted.
To actively monitor datastore capacity:
• Set alarms to send notifications about:
– Datastore disk overallocation
– VM disk use
• Use reporting to view space use.
To actively manage datastore capacity:
• Increase datastore capacity when necessary.
• Use vSphere Storage vMotion to mitigate space use problems on a
particular datastore.
35
Thick-Provisioned and Thin-Provisioned Disks
Virtual disk options differ in terms of creation time, block allocation, layout,
and zeroing out of allocated file blocks

36
About Virtual Networks
VMs and physical machines communicate through a virtual network.
When you configure networking for a VM, you select or change the
following settings:
• Network adapter type
• Port group to connect to
• Network connection state
• Whether to connect to the network when the VM powers on

37
About Virtual Networks

For more information about virtual networks, see vSphere Networking at


https://docs.vmware.com/en/VMware-vSphere/index.html. 38
About Virtual Network Adapters
When you configure a VM, you can add network adapters (NICs) and
specify the adapter type. Whenever possible, select VMXNET3.

39
About PCI Passthrough Devices
Passthrough devices help your environment use resources efficiently and
improve performance.
You connect a VM's guest OS to PCI or PCIe passthrough devices that are
configured on an ESXi host.

40
Other Virtual Devices
A VM must have a vCPU and virtual memory. The addition of other virtual devices
makes the
VM more useful:
• CD/DVD drive: For connecting to a CD, DVD, or ISO image.
• USB 3.0 and 3.1: Supported with host-connected and client-connected devices.
• Floppy drive: For connecting a VM to a floppy drive or a floppy image.
• Generic SCSI devices: A VM can be connected to additional SCSI adapters.
• vGPUs: A VM can use GPUs on the physical host for high-computation activities.
• Precision Clock: Provides a virtual machine with access to the system time of the
primary
ESXi host.
• vTPM: Trusted Platform Module 2.0 virtual cryptoprocessor, providing hardware-based
security-related functions.
41
About the Virtual Machine Console
The VM console provides the mouse, keyboard, and screen features to control
the VM.
You can use the remote console or the Web console to connect to client devices

42
Lab 14: Adding Virtual Hardware

Use the vSphere Client to examine a virtual machine's configuration


and add virtual hardware to
the virtual machine:
1. Examine a Virtual Machine's Configuration
2. Add Virtual Hard Disks to the Virtual Machine
3. Compare Thin-Provisioned and Thick-Provisioned Disks

43
Review of Learner Objectives

• Identify the files that make up a VM


• Compare VM hardware versions
• Recognize the virtual hardware components of a VM
• Navigate the vSphere Client and examine VM settings
• Identify methods for accessing a VM console

44
Lesson 3: Modifying Virtual Machines
Learner Objectives

• Describe virtual machine settings and options


• Add a hot-pluggable device
• Dynamically increase the size of a virtual disk

46
Modifying Virtual Machine Settings
You can modify a VM’s configuration by
editing the VM's settings:
• Add virtual hardware:
– You can add some hardware while the
VM is powered on.
• Remove virtual hardware:
– You can remove some hardware only
when the VM is powered off.
• Set VM options.
• Control a VM’s CPU and memory
resources

47
Hot-Pluggable Devices

With the hot plug option, you can add resources to a running VM.
Examples of hot-pluggable devices:
• USB controllers
• Ethernet adapters
• Hard disk devices

48
Hot-Pluggable Devices

With supported guest operating


systems, you can also add CPU and
memory while the VM is powered on.

49
Dynamically Increasing Virtual Disk Size
You can increase the size of a
virtual disk that belongs to a
powered-on VM.
• It must not have snapshots
attached.
• It might require system tools to
make the new space usable.

50
Inflating Thin-Provisioned Disks
Thin-provisioned virtual disks can be converted to a thick, eager-zeroed
format.
Choose one of the following methods to inflate a thin-provisioned disk on a
VM that is either powered on or off:
• Select the VM’s file with the .vmdk extension and select Inflate.
• Select thick-provisioned when you use vSphere Storage vMotion to
migrate the VM to a different datastore.

51
Inflating Thin-Provisioned Disks

Thin-provisioned virtual disks can be converted to a thick, eager-


zeroed format.
Choose one of the following methods to inflate a thin-provisioned
disk on a VM that is either powered on or off:
• Select the VM’s file with the .vmdk extension and select Inflate.
• Select thick-provisioned when you use vSphere Storage vMotion to
migrate the VM to a different datastore.

52
Inflating Thin-Provisioned Disks

53
VM Options: General Settings
You can use the VM Options tab to modify properties such as the display
name for the VM and the type of guest operating system that is installed.

54
VM Options: VMware Tools Settings
You can use the VMware Tools controls to customize the power buttons on
the VM

55
VM Options: VM Boot Settings
Occasionally, you might need to set the VM boot options

56
Lab 15: Modifying Virtual Machines

Modify a VM’s memory size, increase a VM's storage size, and


rename a VM:
1. Adjust Memory Allocation on a Powered-On Virtual Machine
2. Increase the Size of a Virtual Disk
3. Configure the Guest OS to Recognize the Additional Disk Space
4. Rename a Virtual Machine in the vCenter Inventory

57
Review of Learner Objectives

• Describe virtual machine settings and options


• Add a hot-pluggable device
• Dynamically increase the size of a virtual disk

58
Lesson 4: Creating Templates and
Cloning VMs
Learner Objectives

• Create a template of a virtual machine


• Deploy a virtual machine from a template
• Clone a virtual machine
• Create customization specifications for guest operating systems

60
About Templates

A template is a static image of a virtual machine. You use templates


to create and provision new VMs.
A template typically includes:
• A guest operating system
• One or more applications
• A specific VM hardware configuration
• VMware Tools

61
About Templates
To use templates, you must be connected to vCenter.

62
Creating a Template: Clone VM to Template
You can create templates using different methods. One method is to clone
the VM to a template. The VM can be powered on or off.

63
Creating a Template: Convert VM to Template
You can create a template by converting a VM to a template. In this case,
the VM must be powered off

64
Creating a Template: Clone a Template
You can create a template from an existing template.

65
Updating Templates
You update a template to include new patches,
add and remove virtual hardware, upgrade
VMware Tools, update the VM hardware
version, and install new applications.
To update a template:
1. Convert the template to a VM.
• VMs cannot be deployed from this template
while it is a VM.
2. Place the VM on an isolated network to
prevent user access.
3. Make appropriate changes to the VM.
4. Convert the VM to a template.

66
Deploying VMs from a Template
To deploy a VM, you must provide information such as the VM name, inventory
location, host, datastore, and guest operating system customization data.

67
Cloning Virtual Machines
Cloning a VM creates a VM that is an exact copy of the original:
• Cloning is an alternative to deploying a VM from a template.
• The source VM can be powered on or off.

68
Guest Operating System Customization
When you deploy a VM from a template or clone a VM, you can customize
some aspects of the guest operating system.
By customizing a guest operating system, you can change information,
including the following details:
• Computer name
• Network settings
• License settings
• Time zone
• Administrator or root password
• Windows Security Identifier

69
About Customization Specifications

You can create a customization specification to prepare the guest


operating system:
• Specifications are stored in the vCenter database.
• Windows and Linux guests are supported.

70
Customizing the Guest Operating System
When cloning a VM or deploying a VM from a template, you can use a
customization specification to prepare the guest operating system.

71
Lab 16: Creating Templates and Deploying VMs

Create a VM template, create a customization specification, and


deploy VMs from a template:
1. Create a Virtual Machine Template
2. Create Customization Specifications
3. Deploy Virtual Machines from a Template

72
Review of Learner Objectives

• Create a template of a virtual machine


• Deploy a virtual machine from a template
• Clone a virtual machine
• Create customization specifications for guest operating systems

73
Lesson 5: Introduction to Content
Libraries
Learner Objectives

• Identify the benefits of a content library


• Recognize types of content libraries
• Create a local content library
• Deploy a virtual machine from a content library

75
About Content Libraries
Content libraries are repositories of OVF templates and other file types that can
be shared and synchronized across vCenter systems globally.

76
Benefits of Content Libraries
Storage efficiency and consistency are key reasons to install and use a
content library.
Using content libraries, administrators can perform the following functions:
• Store and share content, such as templates, ISO images, scripts.
• Perform distributed file management.
• Synchronize content libraries across sites and vCenter instances.
• Mount an ISO file directly from a content library.
• Maintain versions of VM templates

77
Benefits of Content Libraries
Content libraries are stored on vSphere datastores.

78
Content Library Types
Content is stored in one of the content library types:
• Local: Content that is controlled by the administrator
• Published: A local library that is available for subscription
• Subscribed: A library that synchronizes with a published library
Administrators can change content in a local or published content library.
Users cannot change content in a subscribed content library.
A subscribed content library cannot be published.

79
Content Library Interface
To create and manage your content libraries, from the main menu, select
Content Libraries.

80
Creating a Local Content Library
When you create a content library, you select the content library type, for
example, Local content library.

81
Populating the Content Library with Templates
You can populate the content library with the following template types:
VM Templates:
• Can be stored on any datastore type, except NFS
• Stored in the default disk format of the datastore (for example, thick-
provisioned eagerzeroed)
• Are associated with a host
• Appear in the vCenter inventory

82
Populating the Content Library with Templates
OVF Templates:
• Must be stored on the datastore (of any type) that is associated with the
content library
• Stored in thin-provisioned format
• Are not associated with a host
• Do not appear in the vCenter inventory

83
Adding VM or OVF Templates to a Content Library
When you clone a virtual machine into a template in a content library, you
can select whether to create a VM template or an OVF template.

84
Adding OVF Templates to a Content Library
When you clone a template from the vCenter inventory into a template in a
content library, the template is stored as an OVF template in the library.

85
Viewing Content Library Items
The content in the content library is divided into categories:
Templates:
• VM templates
• OVF templates
Other Types:
• All other file types, such as ISO images

86
Deploying VMs from a Content Library
You can deploy VMs from templates in a content library by using the New
Virtual Machine wizard.

87
Lab 17: Using Local Content Libraries

Create a local content library to clone and deploy virtual machines:


1. Create a Local Content Library
2. Create an OVF Template in the Content Library
3. Create a VM Template in the Content Library
4. View the Content Library Templates
5. Deploy a VM from a Template in the Content Library

88
Review of Learner Objectives

• Identify the benefits of a content library


• Recognize types of content libraries
• Create a local content library
• Deploy a virtual machine from a content library

89
Lesson 6: Subscribing to Content
Libraries
Learner Objectives

• Publish content libraries


• Subscribe to a published content library

91
Content Libraries: Local, Published, and Subscribed
You can publish a local content library so that other libraries can subscribe
and download a copy of the data.
After synchronization, both published and subscribed libraries contain the
same items, or the subscribed library contains the metadata for the items.

92
Publishing a Content Library
You can enable publishing on a local content library by editing its settings.
You can add password protection to the library.
Subscribed libraries use the subscription URL to access the published library.

93
Subscribing to a Content Library

You subscribe a content library to a


published content library by
configuring the path to the
subscription URL:
• You can immediately download
all library content to the storage
location that you configure.
• To save space, you can store
only metadata for items until they
are used

94

You might also like