2.9. Managing LUN Snapshots

You can create and manage snapshots of specific LUNs. To create a snapshot of the entire target, you need to create snapshots of each LUN within it.

2.9.1. Creating LUN Snapshots

To create a snapshot of a LUN in an iSCSI target, use the vstorage-iscsi snapshot-create command. For example, for LUN 1 on target iqn.2014-04.com.vstorage:test1:

# vstorage-iscsi snapshot-create -t iqn.2014-04.com.vstorage:test1 -l 1
Snapshot a1f54314-bc06-40c6-a587-965feb9d85bb successfully created.

Note

To generate a UUID manually, use uuidgen.

2.9.2. Listing LUN Snapshots

To list snapshots for the specified LUN, use the vstorage-iscsi snapshot-list command. For example, for LUN 1 on target iqn.2014-04.com.vstorage:test1:

# vstorage-iscsi snapshot-list -t iqn.2014-04.com.vstorage:stor4 -l 1
CREATED             C UUID                                 PARENT_UUID
2014-04-11 13:16:51   a1f54314-bc06-40c6-a587-{...} 00000000-0000-0000-{...}
2014-04-11 13:16:57 * 9c98b442-7482-4fd0-9c45-{...} a1f54314-bc06-40c6-{...}

In the output above, the asterisk in the column C indicates the current snapshot, while the column PARENT_UUID shows snapshot dependency or history.

2.9.3. Switching Between LUN Snapshots

To switch to the specified LUN snapshot, use the vstorage-iscsi snapshot-switch command. For example:

# vstorage-iscsi snapshot-switch -u a1f54314-bc06-40c6-a587-965feb9d85bb

After you switch to a snapshot, the current LUN image will be removed.

Note

You can only switch between snapshots, if the LUN is offline.

2.9.4. Viewing LUN Snapshot Information

To view information about the specified snapshot, use the vstorage-iscsi snapshot-info command. For example:

# vstorage-iscsi snapshot-info -u 9c98b442-7482-4fd0-9c45-9259374ca84e
Target: iqn.2014-04.com.vstorage:stor4
LUN: 1
Created: 2014-04-11 13:16:57
Parent: 00000000-0000-0000-0000-000000000000}
{a1f54314-bc06-40c6-a587-965feb9d85bb}
{9c98b442-7482-4fd0-9c45-9259374ca84e
Description: None

2.9.5. Deleting LUN Snapshots

To delete the specifed LUN snapshot, use the vstorage-iscsi snapshot-delete command. For example:

# vstorage-iscsi snapshot-delete -u a1f54314-bc06-40c6-a587-965feb9d85bb

If the snapshot has no any children, it will be deleted. If the snapshot has a single child, it will be merged to that child.

Note

  1. You can only delete offline snapshots.
  2. Deleting a snapshot that has multiple children is currently not supported.