You are on page 1of 24

VMWARE VSPHERE 7.

0:
INSTALL, CONFIGURE, MANAGE

Lab 20: Monitoring Virtual Machine Performance


Document Version: 2020-11-04

Copyright © 2020 Network Development Group, Inc.


www.netdevgroup.com

NETLAB+ is a registered trademark of Network Development Group, Inc.

VMware is a registered trademark of VMware, Inc.


Lab 20: Monitoring Virtual Machine Performance

Contents
Introduction ........................................................................................................................ 3
Objectives............................................................................................................................ 3
Lab Topology....................................................................................................................... 4
Lab Settings ......................................................................................................................... 5
1 Create a CPU Workload .............................................................................................. 6
2 Use Performance Charts to Monitor CPU Use.......................................................... 14
3 Remove CPU Affinity and Change CPU Shares to Normal ........................................ 21

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 2


Lab 20: Monitoring Virtual Machine Performance

Introduction

In this lab, you will use the system monitoring tools to review the CPU workload.

Objectives

 Create CPU Workload


 Use Performance Charts to Monitor CPU Use
 Remove CPU Affinity and Change CPU Shares to Normal

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 3


Lab 20: Monitoring Virtual Machine Performance

Lab Topology

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 4


Lab 20: Monitoring Virtual Machine Performance

Lab Settings

The information in the table below will be needed in order to complete the lab. The
task sections below provide details on the use of this information.

Virtual Machine IP Address Account Password

sa-esxi-01 eth0: 172.20.10.51 root Train1ng$

sa-esxi-02 eth0: 172.20.10.52 root Train1ng$

sa-aio eth0: 172.20.10.10 sysadmin vmware123

sa-student eth0: 172.20.10.80 sysadmin vmware123

sa-vcsa eth0: 172.20.10.94 sysadmin@vclass.local vmware123

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 5


Lab 20: Monitoring Virtual Machine Performance

1 Create a CPU Workload

In this task, you will configure the Scheduling Affinity and adjust the Shares of Linux-01
and Linux-02. You run the CPUBUSY script in each virtual machine to create a heavy CPU
workload in your lab environment.

1. Launch the sa-student virtual machine to access the graphical login screen.

To launch the console window for a virtual machine, you may access by
either clicking on the machine’s graphic image from the topology page
or by clicking on the machine’s respective tab from the navigation bar.

2. Log in as sysadmin using the password vmware123.

3. Launch the Mozilla Firefox web browser by either clicking on the icon shortcut
found on the bottom toolbar or by navigating to Start Menu > Internet > Firefox
Web Browser.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 6


Lab 20: Monitoring Virtual Machine Performance

4. Notice the homepage is automatically configured to load the URL address of the
VMware vCenter Server Appliance (sa-vcsa virtual machine). Click on the LAUNCH
VSPHERE CLIENT (HTML5) button to launch the vSphere Client.

If you cannot successfully load the VMware Getting Started webpage,


then please wait an additional 3-5 minutes and refresh the page to
continue. During this time, the vCenter Server Appliance is still
booting up and requires extra time to initialize.

5. In the Username text field, type sysadmin@vclass.local and in the Password text
field, type vmware123. Click on LOGIN.

You may ignore the “browser-OS combination” warning message


presented on the VMware vCenter Single Sign-On page and continue
moving forward with the lab.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 7


Lab 20: Monitoring Virtual Machine Performance

6. From the dropdown Menu, select VMs and Templates.

7. Expand the Datacenter inventory object in the navigator pane, right-click Linux-01
and select Edit Settings.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 8


Lab 20: Monitoring Virtual Machine Performance

8. In the Edit Settings window, expand CPU. In the Shares dropdown, select High. In the
Scheduling Affinity text box, enter 1. Click OK.

The Scheduling Affinity setting forces the Linux-01 machine to run on


logical CPU 1. CPU affinity is used mainly to create CPU contention for
training purposes. The use of this feature in a production environment
is discouraged.

9. Right-click Linux-01 and select Power > Power On.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 9


Lab 20: Monitoring Virtual Machine Performance

10. Right-click Linux-02 and select Edit Settings.

11. In the Edit Settings window, expand CPU. In the Shares dropdown, select Low. In the
Scheduling Affinity text box, enter 1. Click OK.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 10


Lab 20: Monitoring Virtual Machine Performance

12. Right-click Linux-02 and select Power > Power On.

13. In the navigation pane, click Linux-01 and select LAUNCH WEB CONSOLE.

14. In the Linux-01 Console on the login window, type vmware123 for the password and
click Log In.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 11


Lab 20: Monitoring Virtual Machine Performance

15. Click on Applications and select Terminal Emulator to open a terminal window.

16. In the terminal, elevate your privileges by becoming the superuser of the system.
When prompted for the root password, enter vmware123 and press Enter.

Linux01:~$ sudo su

17. Change directory to the tools directory.

Linux01:/home/sysadmin# cd tools

18. View the contents of the tools directory.

Linux01:/home/sysadmin/tools# ls

Notice the perl script cpubusy.pl. You will run this script to generate
CPU activity on Linux-01.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 12


Lab 20: Monitoring Virtual Machine Performance

19. Execute the cpubusy.pl script.

Linux01:/home/sysadmin/tools# perl cpubusy.pl

20. Repeat steps 13 - 19 for the Linux-02 virtual machine.


21. Change focus back to the vSphere Web Client and continue to the next task.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 13


Lab 20: Monitoring Virtual Machine Performance

2 Use Performance Charts to Monitor CPU Use

In this task, you use performance charts to monitor CPU metrics.

1. While in the vSphere Client, select Linux-01 from the navigator pane and select the
Monitor tab in the main workspace.

2. Click on Advanced in the middle pane, underneath Performance.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 14


Lab 20: Monitoring Virtual Machine Performance

3. Notice the real-time CPU usage graph appears. Click the Chart Options link.

4. In the Chart Options window, ensure that CPU is selected from the Chart Metrics
pane. In the Timespan dropdown menu, verify that Real-time is selected.

Using Chart Options allows you to specify objects to monitor, what


counters to utilize, time stamps, and chart types. You can also
customize preconfigured charts that have been created.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 15


Lab 20: Monitoring Virtual Machine Performance

5. In the Select counters for this chart pane, ensure that Readiness and Usage are the
only boxes that are checked. You may need to scroll down in the pane to verify the
settings.

6. In the Select object for this chart pane on the right, deselect the 0 checkbox.

7. Click OK to save the configurations.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 16


Lab 20: Monitoring Virtual Machine Performance

8. Notice the CPU/Real-time chart for the Linux-01 virtual machine appears.

9. Open a new tab in Firefox and type https://sa-vcsa.vclass.local/ui/ into the


address field, followed by pressing the Enter key.

10. On the new tab, in the navigator pane, click the VMs and Templates tab and expand
the Datacenter object. Select the Linux-02 virtual machine and ensure that the
Monitor tab is selected.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 17


Lab 20: Monitoring Virtual Machine Performance

11. Repeat steps 2 - 8 to configure the CPU Performance graph for the Linux-02 virtual
machine.
12. On the Linux-02 Firefox tab, use the mouse pointer to point to the end of the line
graph and view the current CPU Ready value in milliseconds.

13. Change focus back to the vSphere-Linux-01 tab. Verify that CPU usage in % is
selected and use the mouse pointer to point to the end of the line graph and view
the Percentage of time that the virtual machine was ready, but could not get
scheduled to run on the physical CPU.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 18


Lab 20: Monitoring Virtual Machine Performance

14. In the Linux-01 main workspace window, from the View dropdown window, select
CPU usage in MHz. View the CPU usage in megahertz during the interval.

15. In the Linux-01 main workspace window, from the View dropdown window, select
Memory. View different points of the Amount of guest physical memory that is
being actively read or written by guest. Activeness is estimated by ESXi. You can also
view the Active, Ballooned, Consumed, and Granted memory.

16. Repeat steps 13 -15 to configure the CPU Performance graph for the Linux-02 virtual
machine.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 19


Lab 20: Monitoring Virtual Machine Performance

17. There are metrics available to view that include Datastore, Disk, CPU Ready,
Network, Power, and Virtual Disk. For the purpose of this task, we chose to use
custom performance chart options and the views of CPU Usage in %, MHZ, and
Memory.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 20


Lab 20: Monitoring Virtual Machine Performance

3 Remove CPU Affinity and Change CPU Shares to Normal

In this task, you shut down the Linux-01 and Linux-02 virtual machines, remove CPU
affinity from both virtual machines, and change the CPU shares of both virtual machines
to Normal.

1. In the navigation pane, right-click Linux-01 and select Power > Shut Down Guest OS.
Click YES to confirm the shutdown.

2. Right-click on Linux-02 and select Power > Shut Down Guest OS. Click YES to
confirm the shutdown.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 21


Lab 20: Monitoring Virtual Machine Performance

3. Right-click Linux-01 and select Edit Settings.

4. In the Edit Settings window, expand the CPU Pane. From the Shares dropdown,
select Normal. In the Scheduling Affinity text box, delete the value 1. Click OK.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 22


Lab 20: Monitoring Virtual Machine Performance

Entering 0 for Scheduling Affinity is not the same as deleting the value.
The text box must be blank.

5. Right-click Linux-02 and select Edit Settings.

6. In the Edit Settings window, expand the CPU Pane. From the Shares dropdown,
select Normal. In the Scheduling Affinity text box, delete the value 1. Click OK.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 23


Lab 20: Monitoring Virtual Machine Performance

Entering 0 for Scheduling Affinity is not the same as deleting the value.
The text box must be blank.

7. The lab is now complete; you may end your reservation.

11/6/2020 Copyright © 2020 Network Development Group, Inc. www.netdevgroup.com Page 24

You might also like