Learn how to take a vSphere snapshot, and revert to it.
- [Instructor] In this video, I'll demonstrate how to take snapshots of a running virtual machine. Here I am in my live environment using VMware Workstation, and this is an Autolab vSphere six lab deployment. If you'd like to build your own lab like this, check out the up and running with vSphere six course, that's also in the Lynda library, by Brandon Neal. It'll walk you through the complete step-by-step process required to create your own home lab. So here in my lab kit, I'm going to go ahead and open a console window for my vCenter Virtual machine.
And I'll send a control alt delete and log in. And I'm going to go ahead and launch the vSphere web client. I'll do that by double clicking on the autolab portal, and choosing the link for vSphere web client. Now that the vSphere web client is loaded up, I'm going to log in as firstname.lastname@example.org, password is Vmware, one exclamation point, and this will just take a moment to log in, and what I get and I'm going to go to hosts and clusters, and I'm going to pick out a running virtual machine and take a snapshot of it.
Now what happens when you take a snapshot of a virtual machine is you are essentially capturing the contents of memory at that moment. You're also freezing the contents of the virtual disk exactly as they are, and this gives us a restore point that we can come back to later on. It's really useful if you're performing some sort of update or making some sort of change to a VM, and you're worried that it might have unintended consequences. This gives us a way to back out from those sorts of changes.
So let's go to hosts and clusters, and here's my ESXI host that I currently have powered on called host1.lab.local, and I've got a few virtual machines running. I'm going to go ahead and choose this test vm. I'm going to right click it and as I right click it, I have a menu here for snapshots. So this is where I can go ahead and take a snapshot of this virtual machine. I can also manage the existing snapshots, so if any snapshots currently exist on this VM, I can look at them here, I can delete them, I can consolidate them, so let's open the snapshot manager and take a look.
Test VM currently has no snapshots. So I'm going to go ahead and close this snapshot manager screen. And take my first snapshot of test VM. And notice right now test VM is powered off. So when I go to take a snapshot of it, it's not going to allow me to snapshot the virtual machine's memory because there currently is nothing in memory. Virtual machine is powered off. It's also not going to allow me to quiesce the guest operating system because the virtual machine is powered off.
So I'm going to call my snapshot snap1-poweredoff. Hit okay. And now my snapshot will be created. Now when I took that snapshot, you may have noticed that my recent tasks pane is missing from the bottom of the vSphere web client. I've done that intentionally to give myself a little more room to work with. But if you want to see those recent tasks, you can just click on the drop-down menu here next to the username that you've logged in as, go to layout settings, and here we can see the recent tasks that I've completed.
And so here we see the create virtual machine snapshot task for test VM. That has been successfully completed. Now that I've taken one snapshot, I'm going to go ahead and power on this virtual machine. And as the virtual machine powers on, once it starts booting I'm going to take another snapshot, and this time my snapshot will be of a powered-on VM, so I'll have the opportunity to capture the contents of memory at that moment.
Now I'm going to go ahead and hide my recent tasks menu one more time, just to give myself a little bit more room here, and while this virtual machine is in the process of booting, I'm going to go ahead and open a console of it. And then we'll take a snapshot, so I'll right click the VM, I'll choose open console. As the console's opening, we might see some warning messages in the bottom of Internet Explorer just due to the security settings here in my lab environment. I'll just dismiss those as they open up. But what I want to do is take a snapshot of this VM while it's in the middle of booting, so we'll click on continue to this website, I'll just dismiss this message and notice at the bottom it says automatic boot in one second and it's in the middle of the boot-up process.
I want to show you that prior to taking this snapshot. So let's take another snapshot. Now this snapshot, I'm going to call it snap2booting, is going to capture the virtual machine's memory at that exact state that that VM is in right now. So right now, the VM says automatic boot in one second and it's at this particular spot carrying out some specific task. We want to capture this VM in the exact state that it's in at this moment in time.
That's what our snapshot's going to give us. So at this point I've taken two snapshots of my virtual machine, I'm going to right click it one more time. Go to snapshots, and go to manage snapshots, and now we can see the two snapshots that we've taken. Snap two was a point in time picture that we took as the VM was in the middle of booting, and since then, things may have changed. So we are here. That's the status of my virtual machine right now, and as time goes on, it may continue to change more and more, but we can always go back to the way things were because we have snapshots created.
Now let's walk through reverting to a snapshot. Remember, I have a snapshot called snap1poweredoff. This is my virtual machine in a powered-off state, and I'm going to go ahead and revert to that snapshot. Now what it's warning me about here is that the current state of the virtual machine will be lost unless it's saved in a snapshot, meaning everything that's happened since I took snap two is going to be abandoned. I'm going to go ahead and hit yes. And now that my revert operation is complete, you can see my little you are here target has moved down below snap one.
Let's close this snapshot manager and take a look at our VM, and notice that it's currently powered off. I can also go back to snapshot manager, manage snapshots one more time, and I'm going to revert to my snap two booting snapshot, which should force the virtual machine to power back on and bring it back to that exact same state it was in. Again it's giving me that same warning, the current state of the virtual machine will be lost. I'm going to go ahead and confirm.
And now we see our target has moved down below the snap two booting snapshot, so I'm going to go ahead here and hit close, and let's take a look at our virtual machine console. The console's been disconnected, we'll have to reconnect because the virtual machine powered off. So let's open this console window once more and again we'll get these little warnings here at the bottom due to the configuration of our lab environment, but notice where the virtual machine is at right now. It's going through that boot process exactly as it was when we took that other snapshot, so brought that virtual machine back to the exact same state that it was in.
- Deploying a vSphere Replication virtual appliance
- Configuring VR jobs
- Installing and configuring vSphere Data Protection
- Creating a vSphere DP backup
- Taking, deleting, and consolidating snapshots