Parameters

parentContent: This contains the name of the parent type.

parentVersion: This contains the version of the parent to be created. Usually the current date.

credential: The credentials that will be used to perform the remote operations and establishing remote sessions during the process.

targetSQLServerName: The name of the server to which the SQL Server database will be restored to. If not specified, the value is retrieved from the environment configuration.

dataSizeInGB: The estimated size of the database(s) to be restored. This is used to determine the maximum size of the VHDX parent disk. The estimated data size is multiplied by 3 to determine the maximum size.

leaveDatabaseInRestoreState: Specifies if the database(s) restored should be left in Restore mode to allow additional transaction logs to be applied.

notificationEmailAddresses: The email address to send a notification to upon completion of the process. This requires the SMTP server to be configured in PowerShell for it to work properly.

dpmServerName: The name of the DPM server to connect to initiate the restore job. If not specified, the value is retrieved from the environment configuration.

hyperVClusterName: The name of the Hyper-V cluster on which the target VM resides. If not specified, the value is retrieved from the environment configuration.

useDefaultCSV: If specified, this will take the CSV volume name from the environment configuration.
selectedCSVName: The name of the CSV volume to use to create the new parent disk.

Typical usage example

1) Logon the target SQL Server (not tested remotely, may work)
2) Go to the directory <Path to library>\VHDXSQLRefresh\
3) With a PowerShell prompt with Administrative privileges, run the following command:

.\Create-SQLDataParent.ps1 -parentContent Contoso -parentVersion 2013-11-27 -credential (Get-Credential) -dataSizeInGB 150 -selectedCSVName CSV-VOL-001

4) If you need to perform specific operations on the databases, simply reattach them to the SQL instance and detach them when done.
5) Once the parent disk is in its final state, run Detach-Master.ps1

Last edited Nov 28, 2013 at 4:38 PM by misabel_gem, version 7