Skip to content

Commit bd577bf

Browse files
committed
removed alias where
and updated scripts to have independent source/target FAs.
1 parent f54537a commit bd577bf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

demos-backupsdk/Protection Group Database Refresh/Protection Group Database Refresh physical BackupSDK.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ $Snapshot = Invoke-PsbSnapshotJob -FlashArrayAddress $ArrayName -FlashArrayCrede
5858

5959

6060
# Find the existing mounted snapshot so it can be dismounted
61-
$FindMount = Get-PsbSnapshotSetMountHistory -FlashArrayAddress $ArrayName -FlashArrayCredential $FlashArrayCredential | where {($_.Computer -contains $TargetSQLServer -and $_.HistoryId -match $VolumeSet)}
61+
$FindMount = Get-PsbSnapshotSetMountHistory -FlashArrayAddress $ArrayName -FlashArrayCredential $FlashArrayCredential | Where-Object {($_.Computer -contains $TargetSQLServer -and $_.HistoryId -match $VolumeSet)}
6262

6363

6464

demos-backupsdk/Protection Group Database Refresh/Protection Group Database Refresh vVol BackupSDK.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ Invoke-Sqlcmd -ServerInstance $TargetSQLServer -Database master -Query $Query
5555

5656

5757
# Create a new snapshot of the Protection Group
58-
$Snapshot = Invoke-PsbSnapshotJob -vcenteraddress $vcenteraddress -VcenterCredential $vcentercredential -vmname $sourceVMName -FlashArrayAddress $ArrayName -FlashArrayCredential $FlashArrayCredential -VolumeSetName $VolumeSet -VolumeType $VolumeType -ComputerAddress $SourceSQLServer -ComputerCredential $SQLServerCredential -Path $SourcePath -pgroupname $ProtectionGroupName -ReplicateNow
58+
$Snapshot = Invoke-PsbSnapshotJob -vcenteraddress $vcenteraddress -VcenterCredential $vcentercredential -vmname $sourceVMName -FlashArrayAddress $SourceArrayName -FlashArrayCredential $FlashArrayCredential -VolumeSetName $VolumeSet -VolumeType $VolumeType -ComputerAddress $SourceSQLServer -ComputerCredential $SQLServerCredential -Path $SourcePath -pgroupname $ProtectionGroupName -ReplicateNow
5959

6060

6161

6262
# Find the existing mounted snapshot so it can be dismounted
63-
$FindMount = Get-PsbSnapshotSetMountHistory -FlashArrayAddress $ArrayName -FlashArrayCredential $FlashArrayCredential | where {($_.Computer -contains $TargetSQLServer -and $_.HistoryId -match $VolumeSet)}
63+
$FindMount = Get-PsbSnapshotSetMountHistory -FlashArrayAddress $TargetArrayName -FlashArrayCredential $FlashArrayCredential | Where-Object {($_.Computer -contains $TargetSQLServer -and $_.HistoryId -match $VolumeSet)}
6464

6565

6666

6767
# Dismount the snapshot
68-
Dismount-PsbSnapshotSet -flasharrayaddress $ArrayName -flasharraycredential $FlashArrayCredential -mountid $FindMount[0].mountid -computeraddress $TargetSQLServer -computercredential $SQLServerCredential
68+
Dismount-PsbSnapshotSet -flasharrayaddress $TargetArrayName -flasharraycredential $FlashArrayCredential -mountid $FindMount[0].mountid -computeraddress $TargetSQLServer -computercredential $SQLServerCredential -vcenteraddress $vcenteraddress -vcentercredential $vcentercredential
6969

7070

7171

7272
# Mount the newer snapshot
73-
Mount-PsbSnapshotSet -HistoryId $Snapshot.HistoryId -FlashArrayAddress $ArrayName -flasharraycredential $FlashArrayCredential -computeraddress $TargetSQLServer -computercredential $SQLServerCredential -Path $TargetPath -VMName $targetvmname -VCenterAddress $vCenterAddress -VCenterCredential $vCenterCredential
73+
Mount-PsbSnapshotSet -HistoryId $Snapshot.HistoryId -FlashArrayAddress $TargetArrayName -flasharraycredential $FlashArrayCredential -computeraddress $TargetSQLServer -computercredential $SQLServerCredential -Path $TargetPath -VMName $targetvmname -VCenterAddress $vCenterAddress -VCenterCredential $vCenterCredential
7474

7575

7676

0 commit comments

Comments
 (0)