Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intrasite rep with mor than 1 store is not working #2

Open
sun3047 opened this issue Oct 27, 2017 · 6 comments
Open

intrasite rep with mor than 1 store is not working #2

sun3047 opened this issue Oct 27, 2017 · 6 comments

Comments

@sun3047
Copy link

sun3047 commented Oct 27, 2017

I tried to use the Script for an Intrasite replication. However, it is not working and will cancel with the following Output:
Get-PvsStore : Cannot bind parameter 'StoreId'. Cannot convert value "System.Object[]" to type "System.Guid". Error: "Guid should contain 32 digits with 4 dashes

In my case, this line returns more than one store back and this is not supported
$IS_storeID = (Get-PvsServerStore -ServerName $IS_srcServer.Split('.')[0]).StoreID[0].ToString()

@ryanchauvin
Copy link

I'm having the same issue

@Andymannen
Copy link

Exactly the same problem here...

@korbinianthiel
Copy link

I fixed this issue with only small code changes:

$IS_storeIDs = (Get-PvsServerStore -ServerName $IS_srcServer.Split('.')[0]).StoreID
foreach ($IS_StoreID in $IS_StoreIDs) {
	...
}

@tjglaser1s
Copy link

Hello...first I apologize because I'm a complete powershell novice. I copied your line into the v2 script and replaced line 410/411. I get an error that says "..." is not is not the name of a cmdlet.
image

@korbinianthiel
Copy link

"..." was only a placeholder for the code ;) Here is the full version:

$IS_storeIDs = (Get-PvsServerStore -ServerName $IS_srcServer.Split('.')[0]).StoreID
foreach ($IS_StoreID in $IS_StoreIDs) {
    $IS_storePath = (Get-PvsStore -StoreId $IS_storeID).Path
    $IS_dstServers = @()
    foreach($s in (Get-PvsServer -SiteName $IS_site.SiteName | Select-Object -ExpandProperty ServerFQDN)){
    if($s -notlike $IS_srcServer){
        $IS_dstServers += $s
        }
    }
    ##CHECK VDISKS
    if($vDisksToExport.Length -ne 0){
        $exportMsg = Validate-ExportList -server $srcServer -list $vDisksToExport
        if($exportMsg -notlike ""){
                Write-Host $exportMSG -BackgroundColor Black -ForegroundColor Red
                $exportMsg += ".  Script Terminated."
                Write-EventLog -LogName Application -Source $replication -EventId 5 -EntryType Error -Message $exportMsg -Category 0
                exit
        }
    }
    else{
        $exportMsg = "No list of vDisks to export found.  Exporting ALL vDisks found on $IS_srcServer."
        Write-EventLog -LogName Application -Source $replication -EventId 6 -EntryType Warning -Message $exportMsg -Category 0
        $IS_vDisksToExport = Get-PvsDiskLocator -StoreID $IS_StoreID -SiteName $IS_Site.SiteName | Select-Object -ExpandProperty DiskLocatorName
    }
    $IS_StorePath = $IS_StorePath -replace ':','$'
    $IS_srcPath = "\\$IS_srcServer\$IS_StorePath"
    $cred = Get-Credential
    foreach($s in $IS_dstServers){
        $IS_dstPath = "\\$s\$IS_StorePath"
        foreach($vdisk in $IS_vDisksToExport){
            Start-ISRobocopy -server $s -srcPath $IS_srcPath -dstPath $IS_dstPath -disk $vdisk -cred $cred -eventLog $replication
        }
    }
    Wait-Job -State Running
    Write-Host DONE
}

Would be nice if you can give a short feedback if it also works for you. If so I will make a pull request.

@tjglaser1s
Copy link

Well the error is gone but I still can't get the vdisk to replicate. It's like the robocopy just isn't moving the files. I can go FROM farm1/server1 TO farm2/server1 but I can't go FROM farm2/server1 TO farm1/server1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants