Lab 15: Managing Virtual Machines

In this lab, I am going to demonstrate how to manage several virtual Machine management tasks.

The tasks list for lab 15:

  • Unregister a Virtual Machine in the vCenter Server Inventory
  • Register a Virtual Machine in the vCenter Server Inventory
  • Unregister and Delete Virtual Machines from Disk
  • Take a Snapshots of a Virtual Machine
  • Revert to a snapshot
  • Delete an Individual Snapshot
  • Use the Delete all function in a Snapshot manager

Prerequisites:

  • Log in the VMware vSphere web client portal: https://vCenter Server Appliance Name.domainname:9443/vshpere-client/# or VMware vSphere Client via root user and password.

Steps for the task: Unregister a Virtual Machine in the vCenter Server Inventory

When you unregistering a VM from the inventory, It eventually registers from the host, VMware vCenter Server inventory, But it does not delete from the datastore.

Step 1: Go to the vCenter -> Virtual Machines1.jpg

Step2: Click VM that one you want to unregister. Click Summary tab for checking Hostname. I am going to unregister momatj02-1 and it belongs to host 1. vesxi01.momataj.local. Location: PrivateVMFS-03042.jpg

or you can check the datastore name from the “Related Objects” and “Datastore”

3.jpg

Step 3: Shutdown the Guest OS before removing VM from inventory4.jpg5.jpg

Step 4:  Right-click on your VM. Go to the All vCenter Actions -> Remove from Inventory Note: If you select ” Delete from Disk”, The operation will not be recoverable]6.jpg

Press “Yes” for confirmation7.jpg

Step 5: Select Home -> vCenter -> Datastores8.jpg

Step 6: Select the VMware vSphere VMFS datastore from the objects list

9.jpg

Click on the datastore that the VM location which you deleted from inventory. Click on the datastore to browse the contains in it.10.jpg

Click on the VM that you deleted ” Hot-Clone 02″ in my case. [ My name is slightly different because Hot-Clone 02 is the original VM name, I renamed this name for performing previous lab activity. Datastore files always contains the Original name]11.jpg

Leave the folder open for the next task!12.jpg

Steps for the task: Register a Virtual Machine in the vCenter Server Inventory

If you delete a VM from the vCenter Server inventory but you did not delete it from the disk. You can back it again to the vCenter Server inventory by register it with the vCenter Server.

In this task, I will demonstrate how to return a VM after deleting from the inventory

Step 1: After clicking on the VM folder, You will see a list of the file. Right-Click “your VM.vmx” file . In my case, It is “Hot-Clone02.vmx” and Select “Register VM13.jpg

Step 2: After clicked the Register VM, A Register Virtual Machine wizard has appeared.

Now you need to perform the following action to register a VM from the Datastore.

Option1: Name and Location: I gave name: MomatajHot-Clone02 [ You can use any appropriate name]

Location: LabVMs14.jpg

Option 2: Select the hostname/cluster. I selected to host one to register a new VM15.jpg

Option 3: Ready to Go and Click Finish.16

Step 3: Verify the virtual machine is placed in the inventory from the Home ->vCenter-> VMs and Templates. Now you can see my newly registered VM in the inventory list under LabVMs.17.jpg

Steps for the task: Unregister and Delete Virtual Machines from Disk 

When you delete the virtual machine from the disk, it removes all files related to that virtual machine from the vCenter Server inventory and also from the datastore. You can not able to return it again. The delete from Disk is permanent delete operation.

Step 1: select a VM that you want to unregister and Delete. Click the Summary tab18.jpg

Step 2: Go to the related Objects -> Datastore. Keep the record of the datastore. After delete operation, we will check location for verifying if VM file exists there or not.19.jpg

Step 3: Right click on the VM -> All vCenter Actions -> Delete from Disk20.jpg

Press “Yes” for giving Delete confirmation.21.jpg

Step 4: Verification: Now you can see that VM is not in the inventory list.22.jpg

Go to the Home ->vCenter -> Datastores23.jpg

Select the VMFS datastore on which that deleted VM location was. Click Navigate to the datastore file browser icon.24.jpg

Now you can see there is no files exist for deleted VM25.jpg

Steps for the task: Take Snapshots of a Virtual Machine

Snapshots enable to preserve the state of the Virtual machine at the point in where you can return to the same state repeatedly. It is very useful in the real environment. If you update or test any software or application system in your virtual production environment, And something goes wrong, you can immediately return without that changes.

It is very useful when you must revert repeatedly to the same VM state but you do not want to create multiple VMs in your system.

Step1:  Go to the Home ->vCenter-> Virtual Machines26.jpg

Step 2: Open your machine console or open with VMRC27.jpg

Step 3: Log in you Virtual Machine.

28.jpg

Step4: Drag the “iometer.exe file to the Recycle Bin29.jpg30.jpg

Step 5: Empty your Recycle Bin and Leave you VM console open31.jpg

Step 6: Right-click on your VM and select “Take Snapshot32.jpg

Step 7: Now you need to perform the following action in the Virtual machine Snapshot Wizard that I showed on the Screenshot.

Name: Without iometer and cpubusy

Description: Delete “iometer.exe”

Remaining setup: leave both of option deselected33.jpg

Step 8: Move you “CPU busy” file to the Recycle bin 34.jpg

Make the Recycle bin empty. Right-click and Select “Empty Recycle Bin”35.jpg

Step 9: Right-Click again and take a snapshot again. 36.jpg

Step 10: Name: Without “iometer and cpubusy”

Description : deleted cpubusy.vbs

37

Step 11: added “cpubusy.vbs” on the virtual machine desktop38.jpg

Step 12: Unmount the Removable Devices ” CD/DVD Drive 1″39.jpg

Step 13: Take a snapshot again40.jpg

Name:  With CPU BUSY

Description: Added CPU busy.vbs41.jpg

Step 14: Right-Click on Your VM and Select ” Manage Snapshots42.jpg

Step 15: You should see the three snapshot. As I can see my three snapshots in the manage VM Snapshots wizard43

Steps for the task: Revert to a Snapshot

Reverts to the snapshot so the virtual machine always starts in the same state; reverting to the snapshot discards changes.

Step1: From the Snapshot manager, Select the without iometer  and Click “Revert To”44.jpg

Press “Yes” to confirm Revert to Snapshot45.jpg

You will see the virtual machine is Powered off, because of the setting revert at power off, the virtual machine to revert automatically to the parent snapshot any time it is powered off.46.jpg

Now Power on your Virtual Machine. And Login as an Administrator user and password47.jpg48.jpg

Did you See either of iometer.exe or cpubusy.vbs on the desktop? In my case, It is not displayed on the desktop49.jpg

Go to the Manage Snapshot again50.jpg

Now Revert the snapshot with CPU Busy55.jpg

If you go to the Virtual machine desktop, you will able to see “Cpubusy.vbs”. Close the Snapshot manager Wizard.56.jpg

Steps for the task: Delete an Individual Snapshot

After deleting the snapshot, It will be deleted from the Snapshot Manager. The snapshot files are written to the parent snapshot disk as a consolidated file.

Step1: Right click on your VM and Select “Manage Snapshots”1.jpg

Step 2: You will see that You are here Pointer after the with CPU busy snapshot. Select “Without iometer and cpubusy” and Click “Delete”2.jpg

Step 3: You can monitor the Remove Snapshot from the “Recent tasks3.jpg4.jpg5.jpg

Step 4: Now delete the “without iometer” snapshot6.jpg7.jpg

Step 5: You can see the “cpubusy.vbs”  still on the VM desktop because “You are Here pointer ” after with Cpu Busy snapshot. 8.jpg

If you delete a snapshot one or more level above. You are Here pointer, pointed that the snapshot point-in-time moment is deleted and you can not return to the previous state.

Steps for the task: Use the Delete All Function in Snapshot Manager

Delete all commits all the intermediate snapshots before the current-state icon. You are here!  Delete all consolidates and writes changes to the parent disk from snapshots and previous delta disk state that contains the information about deleted snapshot. When you delete the base parent snapshot, all immediate change merge with VMDK.

Step 1: Right Click on Your Virtual Machine and select the ” Manage Snapshot9.jpg

Step 2: Press “Yes” to confirm Delete10.jpg

Step 3: You can monitor the delete operation from the ” Recent tasks” tab.11

All snapshot will be removed after ” Delete All Snapshot operation”. You will able to see the “Cpubusy.vbs” on the desktop because it is base disk snapshot. And You are here committed all the way up to the base disk.12.jpg

The Delete-all- snapshots method uses storage space efficiently, it does not increase the size of the base disk. It just overwrites the changed block in the base disk.

What Is Captured by the Snapshot?
The snapshot captures the full state of the virtual machine at the time when you take the snapshot such as:

  • The state of all the virtual machine’s disks
  • The contents of the virtual machine’s memory
  • The virtual machine settings

Thank you 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s