- A snapshot (4-SQL-Data-Log.SNAP-1), and new volume copy (Demo-4-SQL-Data-Log-Copy-Vol-1) will be created
- The new copy volume (Demo-4-SQL-Data-Log-Copy-Vol-1) will be connected to a host (MARK-HOST-04)
- A Windows Volume copy will be renamed (4-SQL-Data-Log-Copy-1 )
- The SQL Server database clone will be created, named (tpce-copy-1), and attached to a SQL Server instance
STEP 1: Install Everpure PowerShell SDK
- Ensure PowerShell is installed with a PSversion value of 3.0 or higher using this command for verification.
$PSVersionTable - Locate the Everpure PowerShell SDK by searching at Microsoft’s PowerShell Gallery site for installation.
- Install the Everpure PowerShell SDK module per the instructions listed on the PowerShell Gallery site.
STEP 2: Setup FlashArray Connectivity
- Import the Everpure PowerShell SDK module
- Create credentials, connect to the FlashArray, and enter required credentials
- PowerShell Cmdlets used
# Import Modules
Import-Module PureStoragePowerShellSDK
# Create Credentials
$Creds = Get-Credential
# Create FlashArray object, endpoint, and use credentials
# Connect to the FlashArray
$FlashArray = New-PfaArray -Endpoint 10.21.88.234 -Credentials $Creds -IgnoreCertificateError
STEP 3: Reference Host Disk Number and Volume Letter
- Retrieve current Windows Disk number and volume letter for reference
- Import the Everpure PowerShell SDK module
- Create credentials, connect to the FlashArray, and enter required credentials
- PowerShell Cmdlets used
# Retrieve current Pure FlashArray Disk Number
Get-Disk | Where-Object FriendlyName -like "PURE*"
# Retrieve current Pure FlashArray Volume Letters
Get-Volume | Select-Object DriveLetter, FileSystemLabel, FileSystem
STEP 4: Create Snapshot and Connect to Host
- Take Snapshot of the source FlashArray volume
- Create a new FlashArray volume from source snapshot
- Connect the new FlashArray volume to the host
- PowerShell cmdlets used
# Take snapshot of the specific volume
New-PfaVolumeSnapshots -Array $FlashArray -Sources '4-SQL-Data-Log' -suffix 'SNAP-1'
# Create a new volume from the snapshot
New-PfaVolume -Array $FlashArray -Source '4-SQL-Data-Log.SNAP-1' -VolumeName 'Demo-4-SQL-Data-Log-Copy-Vol-1'
# Connect new volume copy to host
New-PfaHostVolumeConnection -HostName 'MARK-HOST-04' -Array $FlashArray -VolumeName 'Demo-4-SQL-Data-Log-Copy-Vol-1'
STEP 5: Bring Disk, Windows Volume Copy Online at Host
- Scan and online disks
- Check driver letter Windows used for new Windows volume copy for reference
- Using the Windows drive letter (example D), rename the new Windows volume copy label
- PowerShell Cmdlets used
# Rescan Disks to ensure all are available in Windows
Update-HostStorageCache
# Online Disks
Get-Disk | ? IsOffline | Set-Disk -IsOffline:$false
# Rescan Disks to ensure all are available in Windows
Update-HostStorageCache
# Rename volume copies
Set-Volume -DriveLetter D -NewFileSystemLabel '4-SQL-Data-Log-Copy-1'
STEP 6: Verify Disk, Windows Volume Copy
- Verify the Windows volume copy
- PowerShell and Windows Disk Manager Examples
- Windows volume D: has been added
STEP 7: Attach Database Clone Files to SQL Server Instance
- Locate the database clone files on the new Windows volume copy
- Attach the clone database to the SQL Server instance with a new name
- SQL Server T-SQL example using the attach feature
In some cases when attaching a SQL Server database to a different host SQL Server instance, the SQL Server engine service account permissions may need to be modified (Windows ACL) on the corresponding database Windows volume and file directory for the service account accessibility.
STEP 8: Verify SQL Server Database Copy
- SQL Server Management Studio example to verify the database copy exists
Availability Groups databases cannot be used as a FlashArray snapshot source, and you cannot seed Availability Group Replicas from a database created by a FlashArray snapshot. FlashArray snapshots are crash consistent snapshots. SQL Server data and log files are preserved however uncommitted transactional data is lost.
Cloned SQL Server database files from FlashArray snapshots can be attached to a SQL Server instance creating a database copy. During the attach process SQL Server automatically will perform its own crash recovery to either persist committed transactions, or not persist uncommitted transactions to storage.