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
- 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 Machines
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-0304
or you can check the datastore name from the “Related Objects” and “Datastore”
Step 3: Shutdown the Guest OS before removing VM from inventory
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]
Press “Yes” for confirmation
Step 5: Select Home -> vCenter -> Datastores
Step 6: Select the VMware vSphere VMFS datastore from the objects list
Click on the datastore that the VM location which you deleted from inventory. Click on the datastore to browse the contains in it.
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]
Leave the folder open for the next task!
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 VM“
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]
Option 2: Select the hostname/cluster. I selected to host one to register a new VM
Option 3: Ready to Go and Click Finish.
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.
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 tab
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.
Step 3: Right click on the VM -> All vCenter Actions -> Delete from Disk
Press “Yes” for giving Delete confirmation.
Step 4: Verification: Now you can see that VM is not in the inventory list.
Go to the Home ->vCenter -> Datastores
Select the VMFS datastore on which that deleted VM location was. Click Navigate to the datastore file browser icon.
Now you can see there is no files exist for deleted VM
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 Machines
Step 2: Open your machine console or open with VMRC
Step 3: Log in you Virtual Machine.
Step4: Drag the “iometer.exe file to the Recycle Bin
Step 5: Empty your Recycle Bin and Leave you VM console open
Step 6: Right-click on your VM and select “Take Snapshot“
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 deselected
Step 8: Move you “CPU busy” file to the Recycle bin
Make the Recycle bin empty. Right-click and Select “Empty Recycle Bin”
Step 9: Right-Click again and take a snapshot again.
Step 10: Name: Without “iometer and cpubusy”
Description : deleted cpubusy.vbs
Step 11: added “cpubusy.vbs” on the virtual machine desktop
Step 12: Unmount the Removable Devices ” CD/DVD Drive 1″
Step 13: Take a snapshot again
Name: With CPU BUSY
Description: Added CPU busy.vbs
Step 14: Right-Click on Your VM and Select ” Manage Snapshots“
Step 15: You should see the three snapshot. As I can see my three snapshots in the manage VM Snapshots wizard
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”
Press “Yes” to confirm Revert to Snapshot
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.
Now Power on your Virtual Machine. And Login as an Administrator user and password
Did you See either of iometer.exe or cpubusy.vbs on the desktop? In my case, It is not displayed on the desktop
Go to the Manage Snapshot again
Now Revert the snapshot with CPU Busy
If you go to the Virtual machine desktop, you will able to see “Cpubusy.vbs”. Close the Snapshot manager Wizard.
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”
Step 2: You will see that You are here Pointer after the with CPU busy snapshot. Select “Without iometer and cpubusy” and Click “Delete”
Step 3: You can monitor the Remove Snapshot from the “Recent tasks“
Step 4: Now delete the “without iometer” snapshot
Step 5: You can see the “cpubusy.vbs” still on the VM desktop because “You are Here pointer ” after with Cpu Busy snapshot.
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 Snapshot“
Step 2: Press “Yes” to confirm Delete
Step 3: You can monitor the delete operation from the ” Recent tasks” tab.
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.
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 🙂