VMware Cloud Community
jonponton2
Contributor
Contributor

Snapshots and NFS

Hi All,

I would like to know if it is possible with ESX to take a snapshot of a running VM, which runs for a SAN, straight to a NFS folder which is currently connected to the ESX host.

At the moment, the snapshot just stays on the SAN LUN on which it currently runs from.

Cheers,

Jon.

0 Kudos
8 Replies
jonponton2
Contributor
Contributor

Hi Guys,

Any help regarding this would be very much appreciated!

Regards,

Jon.

0 Kudos
opbz
Hot Shot
Hot Shot

hi

From my experience with snapshots you will not be able to do what you want.

ussually what happens is that all the snapshots are kept within the folder where the vmx file is. To be honest it is lmost a bug in the way it works it does not really give you any options as to where to store them much less the option to specify a nfs or any other sort of storage location

0 Kudos
jonponton2
Contributor
Contributor

Hi opbz,

Thanks for your reply. From my testing the closest thing to what I am looking for is to shutdown the VM, then clone the VM - storing it's vhd files on the NAS storage.

0 Kudos
mike_laspina
Champion
Champion

Hello,

You can run a script that shapshots the VM and then copies the files to a NFS store.

e.g.

#!/bin/sh

vmware-cmd <vm-path-and-cfg-file.vmx> createsnapshot "name" "desc" 0 0

cp vm-file.vmdk /nfsstore

cp all files but the *delta.vmdk, *-00000?.vmdk, vswp

..

vmware-cmd <vm-path-and-cfg-file.vmx> removesnapshots

done

You can invoke it with cron or what ever.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
dsanders
Expert
Expert

What are you trying to accomplish or why do you want to store the snapshots in a different location?

The running virtual machine accesses all of the snapshot files. The virtual machine would crash if lost contact with the snapshot files. I think that is probably why VMWare makes the snapshots stay with the virtual disk file.

0 Kudos
jonponton2
Contributor
Contributor

I want the snapshots in a different location for redundancy, and so they can be picked up by our existing backup infrastructure.

0 Kudos
dsanders
Expert
Expert

First, moving the snapshots will not increase redundancy.

I think what you want to do is create a snapshot to free up the base vmdk, copy the vmdk and then commit the snapshot. I use this http://www.xtravirt.com/index.php?option=com_remository&Itemid=75&func=fileinfo&id=7 to do exactly that.

You do not want to keep snapshots around any longer than neccessary. The snapshot files continue to grow risking filling up your partition. Additionally, whenever your virtual machine accesses the virtual disk it must search through all of the snapshot files and the base vmdk. As a result performance will suffer as well.

0 Kudos
opbz
Hot Shot
Hot Shot

Hi

I do not think what you are trying to do will work. Basically when you create snapshot it closes the original vmdk and then continues to use the snapshot for the changes to data in the virtual disks. This is why VCB uses snapshots when it does backups. It is then ale to use a closed file, the oiginal vmdk and back that up while the mv ontinues to work of the snapshot.

So if you plan to copy move the snapshots you are not really gainning anything. Firstly it needs the original vmdk to make sense and secondlyif you do move it your vm will get all confused.

I think if you do want to do what you are saying do the following

1: create snapshot...

2: copy orignial disk to your nfs for your backup redundacy

3: delete snaphot to consolidate changes back to disk

hope it makes sense

0 Kudos