VMware Cloud Community
Wajeeh
Enthusiast
Enthusiast

Virtual machine snapshots delete correct way

Dear Experts,

We started working on a project few months back and deployed a virtual machine for it based on Win 2008 64 bit R2. Installed our HP application on top of it. About a month ago patch update was required for the HP application. Just to be on safe side and not to loose all our efforts of customizing the application we took snapshot of machine.

Applied the patch and till date working on machine after we took snapshot before patch. Now all recent customizations are NOT available in the snapshot because after applying patch we continued our project.

We now see that our application of HP is working as we wanted , now in this case what I need to do, I mean virtual machine is still running on 000002. vmdk and not the base vmdk which is omw.vmdk but as we are satisfied with every thing how we can go back to base vmdk? so that I also save space on my datastore.

Please assist me for this, I have attached for your better understanding the pictures of the virtual machine showing snapshot and state of files in datastore.

Kind Regards,

0 Kudos
18 Replies
onoski
Enthusiast
Enthusiast

Move your OMW-SnapShot.vmsn file and the log file to a different drive to free up space on your current VM. If you were to delete the current snapshot from the snapshot manager screen for the current VM this would not work unless you have a enough space left on the VM disk.

Best wishes and lets know if this helped in answering your question.

0 Kudos
a_p_
Leadership
Leadership

According to one of your other posts you are running ESXi 4.1. In this case - if the VM's current state is what you want to keep - you can safely run "Delete All" from the Snapshot Manager, if you want to commit all current snapshots to the base disks. This may require up to ~3.5 GB additional disk space if the OMW.vmdk is thin provisioned, what I assume from its file size!?

I mean virtual machine is still running on 000002. vmdk and not the  base vmdk which is omw.vmdk but as we are satisfied with every thing how  we can go back to base vmdk

Snapshots in VMware products work like chains. If you take a snapshot, only changes are written to the snapshot file, but the base file is still in use to read from. Please take a look at http://kb.vmware.com/kb/1015180 for details.

Caution: Going back to a previous snapshot or to the base disk would mean you revert the VM to an older state (i.e. delete all current changes)!!


André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

This VM is running on host with 4.0.0 build 208167 and not 4.1, this will make any difference to what you explained 'safely delete all from snapshot manager'

Yes, original omw.vmdk is thin provisioned. But if I want to keep current state of my VM why I need to commit all snapshots to basic disk because those snapshots are not useful for me now but only Current state of machine is what I needed to be saved to base disk.

Thankyou for your support.

Regards,

0 Kudos
sparrowangelste
Virtuoso
Virtuoso

with 4.0 you need to make sure you would have enough space toconsiildate before hitting delete all.

the reason you want to commit alll the snaps is because the current running snap is different from each snapshot iteration.

like you said those snaps arent useful, so you wnt to commit chagnes to the base disk.

your current snap is a subsnap of the snap above it.

so if the above snap isnt commited to the base then this one wont be either.

--------------------- Sparrowangelstechnology : Vmware lover http://sparrowangelstechnology.blogspot.com
0 Kudos
a_p_
Leadership
Leadership

This VM is running on host with 4.0.0 build 208167 and not 4.1, this  will make any difference to what you explained 'safely delete all from  snapshot manager'

Yes. With ESXi 4.0 Update 2 (you are currently running Update 1) VMware changed the logic for "Delete All". However, due to the two snapshots and their sizes you may temporarily need ~7GB disk space. I assume this shouldn't be a problem.

But if I want to keep current  state of my VM why I need to commit all snapshots ...

That's what I tried to explain to you in my previous post. When you create a new snapshot, ESXi will only create a new delta file and store all subsequent disk changes to this file (the base disk will not be modified as long as this delta file exists). So, if you want to keep the current changes, you need to commit them to the base virtual disk. Please take a look at the picture at the end of the KB I linked to.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Dear Mr. Andr'e,

Many thanks for your usual support to me.

Yes, on this Esxi host it is 4.0.0 build 208167 (U1). Now today we had meeting and confirmed that we need to delete snapshots for this OMW machine what I attached in my post yesterday. Now it will be going live production, so I can safely click 'Delete All' button to write current state of machine to base omw.vmdk file.

Attached is the datastore image on which this OMW is residing, it is on SAN and other machines as well. The image shows 122GB is free on this datastore. Your reply says using "delete all" require 7GB space temporarily, so Can I go ahead safely?

Also temporarily means what, means after the snap shots are merged to base disk 7GB is back to datastore ?

0 Kudos
a_p_
Leadership
Leadership

With 122GB free disk space, you can safely run "Delete All". Due to how ESXi 4.0 Update 1 works when deleting snasphots, the data in snaphot 2 will first be merged into snapshot 1 and then snapshot 1 will be merged into the base disk. Depending on the changes after creating the first snapshot, the thin provisioned base disk may grow. However, after deleting the snapshots, the snapshot files (-00000x.vmdk) as well as the .vmsn files will be deleted from the datastore.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Many thanks for detailed information and clearing picture to me.

One last small thing need to know, I can run "Delete All" while the OMW virtual machine is running powered on, right?

Regards,
Wajeeh

0 Kudos
a_p_
Leadership
Leadership

Yes, deleting snapshots can be done online.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Dear Andr'e,

Thanks, I completed it now, attached is the picture after removing the snapshots, the picture of vmdk files, also before the space on Data Store was 122GB, it is now 130GB, also viewable in picture. In picture omw1.vmdk is Mapped Raw lun in OMW of 15GB on SAN

This is just for your update.

Please tell me if I want to take snapshot and I first turn off machine and take snap shot, this will be also OK? what is best practice?

Kind Regards,

0 Kudos
a_p_
Leadership
Leadership

Please tell me if I want to take snapshot and I first turn off machine  and take snap shot, this will be also OK? what is best practice?

It depends on the purpose for the snapshot. If there's a need to revert to a specific state, I prefer to take the snapshots with the VM powered off. This ensures a clean state of the VM and also saves disk space, since the active memory does not have to be stored in the .vmsn file.

In case of snapshots for backup purposes, where the snasphot is committed right after finishing the snapshot it may not make sense to power off the VM and have downtime.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Dear Andr'e,

The OMW VM is running on host with 4.0.0 build 208167 as I explained you it is now acting as production and we will not be doing anymore testing on it and thats why I deleted all snapshots after checking with you for my confusions,

BUT yes we want to have another identical machine same specifications, as 4.0.0 build 208167 is free version, is there a way I can have second OMW machine, the main reason to have it is because we want to avoid all time consuming process of installing Operations Manager for Windows 9.0 software of HP from scratch.

Please share if this is possible....

Kind Regards,

Wajeeh

0 Kudos
a_p_
Leadership
Leadership

How do you currently do your backups? Do you have a backup application in place which offers bare metal restore?

With the free ESXi edition your options to use a commercial image based backup like vRanger or Veeam are limited. However, if you are looking for a one-time backup of the VM's currents state, it may be an option for you to export the VM to an OVF file through the vSphere Client's "File" menu. To do this the VM has to be cleanly shut down though.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Currently we use HP data protector only to backup  selected folders, directories and we do not make bacup of complete VM's. We decide selected folders/ directories from feedback of our application developers team.

I was reading on internet , some people say they have done it by copying the .vmx and .vmdk files from datastore , and created another folder on data store, paste the original copied files there, add the machine to inventory and it is DONE, this will work ? In this case for copy operation of file machine has to be turned off ?

Also my present OMW machine is having thin disk provisioning, this will not make any problem with above method ?

Kind Regards,

0 Kudos
a_p_
Leadership
Leadership

Although copying the VM's folder (with the VM powered off) may work, it doesn't help you in case of a hardware failure of the host, That's why I would go with the OFV export. Copying may make sense if you expect to crash the system often and need to be online again real quick.

André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

dear Andr'e,

i tried expprt to ovf template for one of my other vm today and not for omw. this other machine is testing machine having windows 2003 server having hard disk 20gb thin, 4gb RAM.

i will share here, first i observed it took long time then my expectation to export to ovf and similarly took longer time to import from ovf. i am not saying abnormal time but i mean i was expecting very less time for such small machine. other thing i noticed that after restoring machine, the hard disk came as 20gb thick and not thin which means it will occupy 20gb right away on my datastore even if actual data is very little.

omw hard disk is 60gb thin. i assume this will take very long time for exporting also the resulting machine will be 60gb thick. do you think this is fine taking long time? what about disk provisioning?

0 Kudos
a_p_
Leadership
Leadership

I can't tell you how long it will take. This may depend on the network speed. However, you should have the option to select whether you want the VM thin or thick provisioned in the OVF deployment wizard.


André

0 Kudos
Wajeeh
Enthusiast
Enthusiast

Thanks,

I will check again for thin provisioning choice.

kind regards,

0 Kudos