IF you want try the follow powershell
Get-Module –ListAvailable VM* | Import-Module
function sendMail{
param([string]$errorMessage)
Write-Host "Sending Email"
#SMTP server name
$smtpServer = ""
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
#Email structure
$msg.From = ""
$msg.To.Add("")
$msg.subject = "Error Syncing Appvolumes"
$msg.body = $errorMessage
#Sending email
$smtp.Send($msg)
}
function Recusive2VcenterDSCopy
{
param([string]$ItemPath,
[string]$TargetPath)
$datastoreitems = Get-ChildItem -path $ItemPath
foreach ($dsItem in $datastoreitems )
{
if($dsItem.ItemType -eq "Folder")
{
$foldername=$ItemPath+"\"+$dsItem.Name
$targetfoldername=$TargetPath+"\"+$dsItem.Name
$localname="C:\Scripts\appvolsync\"+$dsItem.Name
Write-Host "Looking in " $foldername " for things to copy"
if(!(Test-Path $TargetPath))
{
try{
Copy-DatastoreItem -Item $foldername -Destination $localname -ErrorAction Stop
}catch{
switch -wildcard ($error[0].Exception.ToString().ToLower())
{
"*already exists*" {Write-Output "File Already Exists"}
default {
sendMail($error[0].Exception.ToString().ToLower())
}
}
}
try{
Copy-DatastoreItem -Item $localname -Destination $TargetPath -ErrorAction Stop
}catch{
switch -wildcard ($error[0].Exception.ToString().ToLower())
{
"*already exists*" {Write-Output "File Already Exists"}
default {
sendMail($error[0].Exception.ToString().ToLower())
}
}
}
Remove-Item $localname -recurse
}
Recusive2VcenterDSCopy -ItemPath $foldername -TargetPath $targetfoldername
}else{
$foldername=$ItemPath+"\"+$dsItem.Name
$targetfoldername=$TargetPath+"\"+$dsItem.Name
$localname="C:\Scripts\appvolsync\"+$dsItem.Name
$remoteFile=$TargetPath+"\"+$dsItem.Name
if(!(Test-Path $remoteFile))
{
Write-Host $remoteFile "Does not Exist"
try{
Copy-DatastoreItem -Item $foldername -Destination C:\Scripts\appvolsync\ -ErrorAction Stop
}catch{
switch -wildcard ($error[0].Exception.ToString().ToLower())
{
"*already exists*" {Write-Output "File Already Exists"}
default {
sendMail($error[0].Exception.ToString().ToLower())
}
}
}
try{
Copy-DatastoreItem -Item $localname -Destination $TargetPath -ErrorAction Stop
}catch{
switch -wildcard ($error[0].Exception.ToString().ToLower())
{
"*already exists*" {Write-Output "File Already Exists"}
default {
sendMail($error[0].Exception.ToString().ToLower())
}
}
}
Remove-Item $localname -recurse
}
}
}
}
$productionVCenter=Connect-VIServer -Server sourcevcenter
$recoveryVCenter=Connect-VIServer -Server destvcenter
Import-Csv "C:\scripts\appvolsync\appvolsynccfg.csv" -UseCulture | %{
$productionDatastore=Get-Datastore -Server $productionVCenter -Name $_."PDC"
$recoveryDatastore=Get-Datastore -Server $recoverVCenter -Name $_."SDC"
if(!(Test-Path pds:\))
{
New-PSDrive -Location $productionDatastore -Name pds -PSProvider VimDatastore -Root "\"
}
if(!(Test-Path rds:\))
{
New-PSDrive -Location $recoveryDatastore -Name rds -PSProvider VimDatastore -Root "\"
}
Recusive2VcenterDSCopy -ItemPath "pds:\cloudvolumes" -TargetPath "rds:\cloudvolumes"
remove-psdrive -name pds
remove-psdrive -name rds
}
sendMail("Completed Appvolumes Sync")
Disconnect-VIServer -Server $productionVCenter
Disconnect-VIServer -Server $recoveryVCenter
and then create a csv with the first column being the source datastore and the second one being the destination datastore. This will copy everything and not need the nfs datastores which we decided not to use. Its the only reliable way I could think of to replicate the VMs without using the storage groups like other people mentioned.