VMWARE VSPHERE 6.
7:
INSTALL, CONFIGURE, MANAGE
Lab 15: Managing Virtual Machines
Document Version: 2019-04-17
Copyright © 2019 Network Development Group, Inc.
www.netdevgroup.com
NETLAB Academy Edition, NETLAB Professional Edition, and NETLAB+ are registered trademarks of Network Development Group, Inc.
VMware is a registered trademark of VMware, Inc.
Lab 15: Managing Virtual Machines
Contents
Introduction ........................................................................................................................ 3
Objectives............................................................................................................................ 3
Lab Topology ....................................................................................................................... 4
Lab Settings ......................................................................................................................... 5
1 Unregister a Virtual Machine from the vCenter Server Appliance Inventory ............ 6
2 Register a Virtual Machine in the vCenter Server Appliance Inventory ................... 11
3 Unregister and Delete a Virtual Machine from the Datastore ................................. 13
4 Take Snapshots of a Virtual Machine ....................................................................... 15
5 Revert the Virtual Machine to a Snapshot................................................................ 24
6 Delete an Individual Snapshot .................................................................................. 29
7 Delete All Snapshots ................................................................................................. 31
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 2
Lab 15: Managing Virtual Machines
Introduction
In this lab, you will perform virtual machine management tasks.
Objectives
• Unregister a virtual machine from the vCenter Server Appliance inventory
• Register a virtual machine in the vCenter Server Appliance inventory
• Unregister and delete virtual machines from the datastore
• Take snapshots of a virtual machine
• Revert the virtual machine to a snapshot
• Delete an individual snapshot
• Delete all snapshots
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 3
Lab 15: Managing Virtual Machines
Lab Topology
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 4
Lab 15: Managing Virtual Machines
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 [email protected] vmware123
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 5
Lab 15: Managing Virtual Machines
1 Unregister a Virtual Machine from the vCenter Server Appliance
Inventory
In this task, you will unregister a virtual machine from the vCenter Server Appliance
inventory. Unregistering does not delete the virtual machine from the datastore.
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.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 6
Lab 15: Managing Virtual Machines
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 User name text field, type [email protected] 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.
6. In the navigator pane, select the VMs and Templates tab.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 7
Lab 15: Managing Virtual Machines
7. Expand the Datacenter inventory object in the navigator pane, followed by selecting
VM1-1. Click on the Datastores tab in the main workspace.
8. Notice the datastore where the VM1-1 virtual machine resides on. Right-click VM1-1
and select Remove from Inventory.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 8
Lab 15: Managing Virtual Machines
9. Click Yes to confirm the removal.
10. Verify that the VM1-1 virtual machine no longer appears in the inventory. In the
navigator pane, click the Storage tab.
11. In the navigator pane, expand the Datacenter object and right-click on Local01-2,
selecting Browse Files.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 9
Lab 15: Managing Virtual Machines
12. View the folders and notice the VM1-1 folder still exists. Double-click the VM1-1
folder and view the virtual machine files.
13. Leave vSphere Client open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 10
Lab 15: Managing Virtual Machines
2 Register a Virtual Machine in the vCenter Server Appliance Inventory
In this task, you will return a virtual machine that was removed from inventory back into
the inventory by registering it with the vCenter Server Appliance.
1. While in vSphere Client, in the main workspace, select the VM1-1.vmx file and click
on the Register VM button.
2. In the Register Virtual Machine window, on the Name and Location step, enter
VM1-1 as the name. Expand the Datacenter object, select Datacenter as the location,
and click Next.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 11
Lab 15: Managing Virtual Machines
3. On the Select a compute resource step, select sa-esxi-1.vclass.local and click Next.
4. On the Ready to Complete step, click Finish.
5. In the navigator pane, click the VMs and Templates tab.
6. Verify that the VM1-1 virtual machine is back in the inventory.
7. Leave vSphere Client open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 12
Lab 15: Managing Virtual Machines
3 Unregister and Delete a Virtual Machine from the Datastore
In this task, you will remove a virtual machine from the vCenter Server Appliance
inventory and delete all associated virtual machine files from the datastore, including
the configuration file and the virtual machine disk files.
1. While in vSphere Client, select the VM1-1 virtual machine from the navigator pane
and click the Datastores tab. Notice the datastore name on which the VM1-1 virtual
machine resides.
2. Right-click the VM1-1 virtual machine from the inventory, select Delete from Disk
and click Yes to confirm the deletion.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 13
Lab 15: Managing Virtual Machines
3. Verify that the VM1-1 virtual machine no longer appears in the inventory. In the
navigator pane, click the Storage icon and expand the inventory view.
4. Ensure that Local01-2 is selected and that you are viewing the Files tab. Verify that
the folder and files from which the VM1-1 virtual machine was registered no longer
exist.
5. Leave vSphere Client open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 14
Lab 15: Managing Virtual Machines
4 Take Snapshots of a Virtual Machine
In this task, you will take a snapshot to preserve the state and the data of a virtual
machine at the time the snapshot is taken. You use snapshots when you must revert to
the same virtual machine state.
1. While in vSphere Client, click on the VMs and Templates tab in the navigator pane.
2. Right-click VM2-1 from the navigator pane and select Power > Power On.
3. Right-click VM2-1, select Open Remote Console.
If a question dialog box appears upon bootup, select I Copied It as the
answer to proceed.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 15
Lab 15: Managing Virtual Machines
4. In the VM2-1 virtual machine console window, login as sysadmin and use vmware123
as the password.
5. Click on Activities found in the upper-left corner of the screen and type text into the
search field. Given the results, click on the Text Editor icon to launch the application.
6. In the text editor window, type This is a test file to be used with the
snapshot feature.
7. Click the Save button.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 16
Lab 15: Managing Virtual Machines
8. Enter TestFile in the Name text field and navigate to the Documents directory to
save the file there. Click Save.
9. Close the text editor application.
10. Change focus to the vSphere Client, right-click VM2-1 from the navigator pane and
select Snapshots > Take Snapshot.
11. Configure the snapshot with the information below:
a. Name: With TestFile
b. Description: Created TestFile
c. Snapshot the virtual machine’s memory: Deselect the checkbox
d. Quiesce guest file system (Needs VMware Tools installed): Leave deselected
e. Click OK.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 17
Lab 15: Managing Virtual Machines
12. Once the snapshot task is completed in the Recent Tasks pane, return to the VM2-1
virtual machine console and reopen the text editor application.
13. In the text editor window, type This is another test file to be used with the
snapshot feature.
14. Click the Save button.
15. Enter TestFile-2 in the Name text field and navigate to the Documents directory to
save the file there. Click Save.
16. Close the text editor application.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 18
Lab 15: Managing Virtual Machines
17. Change focus to the vSphere Client, right-click VM2-1 from the navigator pane and
select Snapshots > Take Snapshot.
18. Configure the snapshot with the information below:
a. Name: With TestFile and TestFile-2
b. Description: Created TestFile-2
c. Snapshot the virtual machine’s memory: Deselect the checkbox
d. Quiesce guest file system (Needs VMware Tools installed): Leave deselected
e. Click OK.
19. Once the snapshot task is completed in the Recent Tasks pane, return to the VM2-1
virtual machine console window.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 19
Lab 15: Managing Virtual Machines
20. Click on Activities found in the upper-left corner of the screen and click the Files
icon to launch the file manager application.
21. In the file manager window, navigate to the Documents directory.
22. Right-click TestFile-2 and select Move to Trash.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 20
Lab 15: Managing Virtual Machines
23. In the left pane of the file manager window, right-click Trash and select Empty Trash.
24. When asked for confirmation, click Empty Trash.
25. Close the file manager.
26. Change focus to the vSphere Client, right-click VM2-1 from the navigator pane and
select Snapshots > Take Snapshot.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 21
Lab 15: Managing Virtual Machines
27. Configure the snapshot with the information below:
a. Name: Without TestFile-2
b. Description: Deleted TestFile-2
c. Snapshot the virtual machine’s memory: Leave the checkbox selected
d. Quiesce guest file system (Needs VMware Tools installed): Leave deselected
e. Click OK.
Notice that this task takes slightly longer than previous snapshots
because the guest memory is also being saved.
28. Once the snapshot task is completed in the Recent Tasks pane, right-click the VM2-1
virtual machine and select Snapshots > Manage Snapshots.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 22
Lab 15: Managing Virtual Machines
29. You should see four snapshots. The difference in icons is due to whether the
Snapshot the virtual machine’s memory checkbox was selected when the snapshot
was taken.
30. Close the VM2-1 virtual machine console.
31. Leave the Manage Snapshots window open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 23
Lab 15: Managing Virtual Machines
5 Revert the Virtual Machine to a Snapshot
In this task, you will revert a virtual machine to the state it had at the time when the
selected snapshot was taken.
1. While in vSphere Client, on the Manage Snapshots window, select the With TestFile
and TestFile-2 snapshot and click Revert to.
2. Click OK to confirm the revert.
3. Back on the Manage Snapshots window, click Done.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 24
Lab 15: Managing Virtual Machines
4. Notice the virtual machine powered off due to the snapshot of the virtual machine’s
memory not being selected. Right-click the VM2-1 virtual machine in the navigator
pane and select Power > Power On.
5. Right-click VM2-1 and select Open Remote Console.
If a question dialog box appears upon bootup, select I Copied It as the
answer to proceed.
6. In the VM2-1 virtual console window, login as sysadmin with vmware123 as the
password.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 25
Lab 15: Managing Virtual Machines
7. Once logged in, click on Activities and click the Files icon.
8. Navigate to the Documents directory.
9. Notice that both TestFile and TestFile-2 appear. Close the virtual machine console.
10. While in the vSphere Client, right-click the VM2-1 virtual machine from the navigator
pane and select Snapshots > Manage Snapshots.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 26
Lab 15: Managing Virtual Machines
11. Notice the pointer should be below the snapshot named “With TestFile and TestFile-
2”. Select the Without TestFile-2 snapshot and click Revert to.
12. Click OK to confirm the revert operation.
13. Back on the Manage Snapshots window, click Done.
14. Notice the virtual machine stayed powered on due to the snapshot of the virtual
machine’s memory being selected. Right-click the VM2-1 virtual machine in the
navigator pane and select Open Remote Console.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 27
Lab 15: Managing Virtual Machines
15. In the VM2-1 virtual machine console window, click Activities, followed by clicking
on the Files icon.
16. Navigate to the Documents directory.
17. Notice that only TestFile appears. Close the virtual machine console.
18. Leave vSphere Client open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 28
Lab 15: Managing Virtual Machines
6 Delete an Individual Snapshot
In this task, you will remove a snapshot from the Snapshots tab. The snapshot files are
consolidated and written to the parent snapshot disk.
1. While in vSphere Client, right-click VM2-1 from the navigator pane and select
Snapshots > Manage Snapshots.
2. Notice the “You are here” pointer is below the snapshot named “Without TestFile-2”.
Select the With TestFile and TestFile-2 snapshot and click the Delete icon.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 29
Lab 15: Managing Virtual Machines
3. Click OK to confirm the deletion.
4. Back on the Manage Snapshots window, click Done.
5. Notice the virtual machine did not power off. Right-click VM2-1 and select Open
Remote Console.
6. If the file manager window is not already opened, click on Activities and click the
Files icon. Navigate to the Documents directory.
7. Notice that TestFile only appears. Close the virtual machine console.
8. Leave vSphere Client open to continue with the next task.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 30
Lab 15: Managing Virtual Machines
7 Delete All Snapshots
In this task, you will use the Delete All function to delete all the snapshots of a virtual
machine.
1. While in vSphere Client, right-click VM2-1 from the navigator pane and select
Snapshots > Delete All Snapshots.
2. Click OK to confirm that you want to delete all the remaining snapshots.
3. Right-click VM2-1 and select Snapshots > Manage Snapshots.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 31
Lab 15: Managing Virtual Machines
4. Notice that the “You are here” pointer is the only object that appears. This confirms
that all snapshots have been removed. Click the Done button.
5. Right-click VM2-1 and select Open Remote Console.
6. If the file manager window is not already opened, click on Activities and click the
Files icon. Navigate to the Documents directory.
7. Notice that TestFile only appears. Close the virtual machine console.
8. The lab is now complete; you may end the reservation.
4/17/2019 Copyright © 2019 Network Development Group, Inc. www.netdevgroup.com Page 32