Skip to content

Commit c0e6379

Browse files
committed
Move PiTR-VMFS script into VMFS-VMDK Snapshot folder; combine READMEs; update main README
1 parent f42abb3 commit c0e6379

4 files changed

Lines changed: 56 additions & 73 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ Array-based snapshots are used to decouple database operations from the size of
4343

4444
| Demo | Description | | |
4545
| ----------- | ----------- | ----------- | ----------- |
46-
| **Volume Database Refresh on VMDK Virtual Disks** | Refresh a database from Volume snapshot where all of the databases's files are using a VMware VMDK Virtual Disk type on a single VMFS Datastore on the same Volume on the same FlashArray. | [More Info](./demos-sdk2/VMFS-VMDK%20Snapshot/) | [Sample Code](./demos-sdk2/VMFS-VMDK%20Snapshot/VMFS-VMDK%20Snapshot.ps1) |
46+
| **Volume Database Refresh on VMDK Virtual Disks** | Refresh a database from a Volume snapshot where all of the databases's files are using a VMware VMDK Virtual Disk type on a single VMFS Datastore on the same Volume on the same FlashArray. | [More Info](./demos-sdk2/VMFS-VMDK%20Snapshot/) | [Sample Code](./demos-sdk2/VMFS-VMDK%20Snapshot/VMFS-VMDK%20Snapshot.ps1) |
47+
| **Point in Time Recovery on VMDK Virtual Disks** | Combine a FlashArray snapshot with SQL Server 2022 T-SQL Snapshot Backup on a VMFS datastore for application-consistent snapshots and point-in-time recovery. | [More Info](./demos-sdk2/VMFS-VMDK%20Snapshot/) | [Sample Code](./demos-sdk2/VMFS-VMDK%20Snapshot/Point%20in%20Time%20Recovery%20-%20VMFS.ps1) |
4748

4849

4950
## Using Snapshots for Databases on Hyper-V Cluster Shared Volumes (CSV)

demos-sdk2/Point in Time Recovery - VMFS/README.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

demos-sdk2/Point in Time Recovery - VMFS/Point in Time Recovery - VMFS.ps1 renamed to demos-sdk2/VMFS-VMDK Snapshot/Point in Time Recovery - VMFS.ps1

File renamed without changes.
Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,62 @@
1-
# Refresh VMFS VMDK(s) with Snapshot Demo
2-
<!-- wp:separator -->
3-
<hr class="wp-block-separator"/>
4-
<!-- /wp:separator -->
5-
6-
# Scenario:
7-
This example is for a repeatable refresh scenario, such as a nightly refresh of a production database on
8-
another non-production SQL Server.
9-
<BR><BR>
10-
Production SQL Server & database(s) reside on a VMFS datastore. Non-production SQL Server resides on
11-
a different VMFS datastore. User database(s) data and log files reside on two different VMDK disks
12-
in each datastore. This workflow is intended to only be impact select Windows Disks/VMDKs that contain user
13-
databases. Each datastore also resides on a different FlashArray, to demonstrate use of async snapshot
14-
replication.
15-
<BR><BR>
16-
This example's workflow takes an on-demand snapshot of the Production datastore and async replicates it to
17-
the second FlashArray. Then the snapshot is cloned as a new temporary volume/datastore. The VMDKs with the
18-
production database files, residing on the temporary cloned datastore are attached to the target SQL Server,
19-
replacing the prior VMDKs that stored the database files previously. Finally Storage vMotion is used to
20-
migrate the VMDKs to the non-production datastore, then the temporary cloned datastore is discarded.
21-
<BR><BR>
22-
23-
24-
# Disclaimer:
25-
This example script is provided AS-IS and is meant to be a building block to be adapted to fit an individual organization's infrastructure.
26-
<BR><BR>
27-
_PLEASE_ do not save your passwords in cleartext here.
28-
Use NTFS secured, encrypted files or whatever else -- never cleartext!
29-
<BR><BR>
1+
# VMFS-VMDK Snapshot Scripts for SQL Server
2+
3+
This folder contains scripts for managing SQL Server databases on VMware VMFS datastores using Pure Storage FlashArray snapshots.
4+
5+
**Files:**
6+
- `VMFS-VMDK Snapshot.ps1` — repeatable database refresh from a FlashArray snapshot across two VMFS datastores
7+
- `Point in Time Recovery - VMFS.ps1` — SQL Server 2022 T-SQL Snapshot Backup with point-in-time recovery on VMFS/VMDK
8+
9+
---
10+
11+
## VMFS-VMDK Snapshot.ps1
12+
13+
**Scenario:**
14+
15+
This script is for a repeatable refresh scenario, such as a nightly refresh of a production database onto a non-production SQL Server. Production SQL Server databases reside on a VMFS datastore on one FlashArray. The non-production SQL Server resides on a different VMFS datastore on a second FlashArray.
16+
17+
The workflow takes an on-demand snapshot of the production datastore and async replicates it to the second FlashArray. The snapshot is then cloned as a new temporary volume/datastore. The VMDKs containing the production database files are attached to the target SQL Server, replacing the prior VMDKs. Finally, Storage vMotion migrates the VMDKs to the non-production datastore and the temporary cloned datastore is discarded.
18+
19+
**Prerequisites:**
20+
21+
1. PowerShell Modules: `dbatools` & `PureStoragePowerShellSDK2`
22+
2. VMware PowerCLI must be installed.
23+
3. Async replication must be configured between the source and target FlashArrays.
24+
25+
---
26+
27+
## Point in Time Recovery - VMFS.ps1
28+
29+
**Scenario:**
30+
31+
This script performs a point-in-time restore using SQL Server 2022's T-SQL Snapshot Backup feature with a FlashArray snapshot as the base, followed by restoring a native SQL Server log backup.
32+
33+
**Important Note:**
34+
35+
This script is built for a single database spanned across two VMDK files from a single datastore. The granularity of this workflow is a VMDK file and the entirety of its contents — everything in the VMDK, including files for other databases, will be impacted and overwritten. This script will need to be adapted to support multiple databases on the same VMDK(s).
36+
37+
**Prerequisites:**
38+
39+
1. PowerShell Modules: `dbatools` & `PureStoragePowerShellSDK2`
40+
2. VMware PowerCLI must be installed.
41+
3. SQL Server 2022 or later is required for T-SQL Snapshot Backup support.
42+
43+
**Usage Notes:**
44+
45+
Each section of the script is meant to be run one after the other. The script is not meant to be executed all at once.
46+
47+
---
48+
49+
## Disclaimer
50+
51+
This example script is provided AS-IS and is meant to be a building block to be adapted to fit an individual organization's infrastructure.
52+
3053
We encourage the modification and expansion of these scripts by the community. Although not necessary, please issue a Pull Request (PR) if you wish to request merging your modified code in to this repository.
3154

32-
<!-- wp:separator -->
33-
<hr class="wp-block-separator"/>
34-
<!-- /wp:separator -->
55+
---
3556

3657
_The contents of the repository are intended as examples only and should be modified to work in your individual environments. No script examples should be used in a production environment without fully testing them in a development or lab environment. There are no expressed or implied warranties or liability for the use of these example scripts and templates presented by Pure Storage and/or their creators._
3758

3859

3960

4061

62+

0 commit comments

Comments
 (0)