VMware Cloud Community
CBrienen
Contributor
Contributor

Restore single file from Snapshot

Hi all,

In our environment we have several Virtual machines that are being snapshot. Snapshots are going wel, just like the restore of a snapshot.

On one virtual machine some files became corrupted. We can do a full restore of a snapshot but it is not preffered because of multiple appliactions running on the VM.

Is it possible to restore a single file from a snapshot? Our snapshots are being made in 2GB parts.

Thanks for the help.

0 Kudos
8 Replies
AndreTheGiant
Immortal
Immortal

I suppose that you are using VI/vSphere.

You can clone the VM, go back to the snap on the cloned VM, power on the VM with network disable, change name and IP, and connect the network again.

So you can copy the needed file from the cloned VM to the original one.

But remember that snap are NOT a backup tools.

You can have performance issues with big snap.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
Texiwill
Leadership
Leadership

Hello,

What product are you using: Workstation, ESX, ESXi, Server, Fusion?

In our environment we have several Virtual machines that are being snapshot. Snapshots are going wel, just like the restore of a snapshot.

You can move around the snapshot tree and run from any existing snapshot. It is NOT a restore.

On one virtual machine some files became corrupted. We can do a full restore of a snapshot but it is not preffered because of multiple appliactions running on the VM.

Snapshots ARE NOT backup files. They are changes in blocks from the previous snapshot/virtual disk. They are NOT backups. They are used to create backups but are not backups.

Is it possible to restore a single file from a snapshot? Our snapshots are being made in 2GB parts.

No, because they are NOT backup files just changes in blocks from previous snapshots or vmdk files.


Best regards,

Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009, Virtualization Practice Analyst[/url]
Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security: Securing the Virtual Environment'[/url]
Also available 'VMWare ESX Server in the Enterprise'[/url]
[url=http://www.astroarch.com/wiki/index.php/Blog_Roll]SearchVMware Pro[/url]|Blue Gears[/url]|Top Virtualization Security Links[/url]|Virtualization Security Round Table Podcast[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
continuum
Immortal
Immortal

Is it possible to restore a single file from a snapshot? Our snapshots are being made in 2GB parts.

Yes - if the file is completely inside the snapshot then it is possible. But it is not reliable ... it "may work" only.

It is a little bit more tricky with split snapshots than with monolithic snapshots but I can confirm successful recovery of single files from split snapshots.

Read about Plan B at my site > vm-sickbay

___________________________________

VMX-parameters- VMware-liveCD - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Texiwill
Leadership
Leadership

Hello,

You would do this by moving to a previous snapshot and running the VM from there. So you are using a different set of changed blocks. Thereby allowing you to copy a file from the VM to some remote storage.

When you move to the later snapshot you can copy from that remote storage to the VM once more. You will need some form of fileserver to do this. You can not extract direct from a snapshot but can move around the snapshot tree.


Best regards,

Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009, Virtualization Practice Analyst[/url]
Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security: Securing the Virtual Environment'[/url]
Also available 'VMWare ESX Server in the Enterprise'[/url]
[url=http://www.astroarch.com/wiki/index.php/Blog_Roll]SearchVMware Pro[/url]|Blue Gears[/url]|Top Virtualization Security Links[/url]|Virtualization Security Round Table Podcast[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
continuum
Immortal
Immortal

Edward - I am not sure what you are exactly talking about.

All I wanted to say that I have restored single files from snapshot delta files in several occasions.

Most of the times the users with the corrupted VMs did not believe in this technic but later on they were happy that they asked me to do it.

Its not in the books but its possible

___________________________________

VMX-parameters- VMware-liveCD - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CBrienen
Contributor
Contributor

Thanks alll for the replies.

I am Running VC 2.5 with 2 ESXi 3.5 servers and 1 ESX 3.5 server. The concerning VM is on one of the ESXi.

I could do the cloning method, but the server can't be turned off if it is not really necessary. Because this server is accessed 24 hours world wide. But it could be a solution.

The method that continuum is suggesting, sounds just to risky. I am not an expert so I can't take the risk of messing something up. We don't have any test environment so everything has to be done in Production environment.

I solved the problem by using the VMware diskmount utility (despite continuum discouraging advice on his website 😛 ) I copied the snapshot from our NFS to my local machine and mounted it via the utility. It didn't work when I mapped a network drive to the NFS location and tried to mount it from there. Still investigating that because copying 20 GB + takes a while.

Any further tips are welcome.

0 Kudos
continuum
Immortal
Immortal

The method that continuum is suggesting, sounds just to risky.

There is no risk involved at all - as dead vmdks don't ask questions Smiley Wink

Really this approach is only good as a last resort - when nothing else works.

Do you know that Workstation can mount ESX-snapshots ? - but to do this you need the whole tree of course.

___________________________________

VMX-parameters- VMware-liveCD - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CBrienen
Contributor
Contributor

Andre,

Sorry for the late reaction, but I went on holliday. I am using Virtual Center 2.5. The snapshots are not being made via Virtual Center but via a script. The script places the snapshots on an NAS device.

Snapshots are being made in parts of 2GB. When I clone a VM and try to add a hard disk via the wizard by browsing to the NFS it does not see any .vmdk file, but they are right there. So I can't select the .vmdk. When I make 1 big "flat" snapshot file, it does see a .vmdk file. But I don't have the time and space for flat snapshots.

The strange thing is that when I browse trough the datastore via VC, it sees the 2gb .vmdk files as one big .vmdk file :S Why?

So now I have to convert the 2GB snapshot parts with VMware converter to 1 big .vmdk file and then I can finally add it to a VM in VC. Is there a better way?

0 Kudos