After a first article about the Synology DS412+, which details the configuration of iSCSI in a vSphere 5 environment, it’s now time to play with one of the more advanced features of DSM 4.2: LUN snapshotting. This article will discuss the snapshotting feature in a vSphere enviroment.
The snapshot feature is available as part of the DSM storage manager and available for iSCSI volumes. Select the LUN you want to snapshot and select the snapshot option:
A snapshot will snap the current state of the iSCSI volume for example backup purposes and enabled you to go back to this snapshot state. A red message appears suggesting to stop all iSCSI session because of possible data inconsistency. Although this message is true, stopping all your virtual machines is not strictly required. The snapshot process will execute seamlessly, so virtual machines will continue to run. The data will be in crash consistent state tough:
The state of disks equivalent to what would be found following a catastrophic failure that abruptly shuts down the system. A restore from such a shadow copy set would be equivalent to a reboot following an abrupt shutdown. This is the default state of data that has been shadow copied without the support of writers.
Practically this means that it’s not 100% guaranteed that all your applications will restart without any problem. There’s a chance for data corruption. This issue can be solved by using VSS (for Microsoft OSes), but this technology is not part of the Synology snapshot feature. VSS is part of most VMware integrated backup options.
Create a Synology Snapshot
Just let’s go and take a snapshot, this process will complete in less then a minute most of the time. After a taking a snapshot you use the snapshot manager to:
- Clone the snapshot which actually means a new LUN will be created based on the snapshot.
- Remove the snapshot, no explanation needed I guess.
- Restore the snapshot which means you will go back to a point in time. Notice that you will loose the current status of the volume so be very careful with this option. Also first shutdown the virtual machines that run on the volume to be restored preventing unexpected behavior.
- Edit the snapshot, you can change the name of the snapshot.
Clone a snapshot and add a copy to vSphere
I will now run the following steps:
- Snapshot an iSCSI LUN containing one or more virtual machines;
- Create a clone of this LUN;
- Link it to my ESXi hosts;
- Add the lun to vSphere;
- Add the cloned virtual machine(s) to vSphere and run them.
Ok let’s first take a snapshot of a VMFS LUN, then select the snapshot in the snapshot manager and select clone:
Choose a descriptive name, link the correct iSCSI target mapping and click OK to start the cloning process. After a short while (depending on the size of the LUN) a second cloned LUN (based on the snapshot) is available. Note: Of course you can also directly clone a LUN, this will skip the snapshot step.
Now add the snapshot to vSphere, vSphere will ask you for a VMFS mount option:
- Keep the existing signature – Mount the volume without changing the signature.
- Assign a new signature – Retain the existing data and mount the VMFS volume on the disk.
- Format the disk – Create a new datastore (and thus loose all the snapshot data!).
Option 2 is the option we’re looking for:
The snapshot will appear as a snapshotted LUN in your inventory:
The last step is to add the virtual machine(s) that is on the snapshotted LUN to the inventory. This can be achieved by browsing the datastore and right click the .vmx file. Choose the option “add to inventory” and you’re all set:
When you start the virtual machine for the first time, vSphere will ask you a question about this new virtual machine. Because you copied the virtual machine, you eventually have to choose “I copied it!”.
Happy snapshotting!
Important: When you want to remove the snapshot to forget to follow the procedure outlined in this article.
1 Comments
Brendan
How does this fit in with backup\replication? Are snapshots saved in LUN backups?
I assume this doesn’t change the fact that LUN backups are in a backup image file format that would need to be restored before a VMWare datastore created. In which case, can snapshotting be used with Shared Folders, the replication of which is of the original files?