vCenter and Veeam replication to DR site

VMware specific discussions

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Wed Apr 05, 2017 5:01 pm

I looked through the VeeamPSSnapin site... could you suggest a methodology to do so?
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Wed Apr 05, 2017 6:10 pm

Hmmm... if I execute $sync = Sync-VBRBackupRepository -repository $repo then $sync | Get-Member I get:
TypeName: Veeam.Backup.Core.CBaseSession

Code: Select all
   TypeName: Veeam.Backup.Core.CBaseSession

Name                         MemberType Definition
----                         ---------- ----------
AbortSession                 Method     void AbortSession()
CalcBaseSessionResult        Method     Veeam.Backup.Model.CBaseSessionInfo+EResult CalcBaseSessionResult()
CheckStop                    Method     void CheckStop()
CompleteBase                 Method     void CompleteBase()
CompleteWithFailure          Method     void CompleteWithFailure()
CompleteWithResult           Method     void CompleteWithResult(Veeam.Backup.Model.CBaseSessionInfo+EResult result, ...
CompleteWithSuccess          Method     void CompleteWithSuccess()
CompleteWithWarning          Method     void CompleteWithWarning()
Equals                       Method     bool Equals(System.Object obj)
FindSessionStarterInfo       Method     Veeam.Backup.Model.CSessionStarterInfo FindSessionStarterInfo()
GetHashCode                  Method     int GetHashCode()
GetType                      Method     type GetType()
IsSessionNotHeldByJobProcess Method     bool IsSessionNotHeldByJobProcess()
IsStoped                     Method     bool IsStoped([ref] string stopDetails), bool IsStoped()
LogAndSetOperation           Method     void LogAndSetOperation(string format, Params string[] args)
SetAuxData                   Method     void SetAuxData(string auxData)
SetLeaseId                   Method     void SetLeaseId(guid leaseId)
SetOperation                 Method     void SetOperation(string format, Params System.Object[] args), void SetOpera...
SetProgress                  Method     void SetProgress(int progress)
SetResult                    Method     void SetResult(Veeam.Backup.Model.CBaseSessionInfo+EResult result), void Set...
SetSpec                      Method     void SetSpec(string spec)
SetState                     Method     void SetState(Veeam.Backup.Model.CBaseSessionInfo+EState state), void IBaseS...
ToString                     Method     string ToString()
UpdateSessionStarterInfo     Method     void UpdateSessionStarterInfo(Veeam.Backup.Model.CSessionStarterInfo starter...
AuxData                      Property   string AuxData {get;}
BaseProgress                 Property   int BaseProgress {get;}
CreationTime                 Property   datetime CreationTime {get;}
CreationTimeUTC              Property   datetime CreationTimeUTC {get;}
Description                  Property   string Description {get;}
EndTime                      Property   datetime EndTime {get;}
EndTimeUTC                   Property   datetime EndTimeUTC {get;}
Id                           Property   guid Id {get;}
IsCompleted                  Property   bool IsCompleted {get;}
IsLowerAgentPriority         Property   bool IsLowerAgentPriority {get;}
IsPostprocessing             Property   bool IsPostprocessing {get;}
IsStarting                   Property   bool IsStarting {get;}
IsWorking                    Property   bool IsWorking {get;}
JobId                        Property   guid JobId {get;}
JobName                      Property   string JobName {get;}
JobSpec                      Property   string JobSpec {get;}
JobType                      Property   Veeam.Backup.Model.EDbJobType JobType {get;}
JobTypeString                Property   string JobTypeString {get;}
LeaseId                      Property   guid LeaseId {get;}
Logger                       Property   Veeam.Backup.Core.IXmlLogger Logger {get;}
LogName                      Property   string LogName {get;}
LogsSubFolder                Property   string LogsSubFolder {get;}
Name                         Property   string Name {get;}
Operation                    Property   string Operation {get;}
Result                       Property   Veeam.Backup.Model.CBaseSessionInfo+EResult Result {get;}
SessionInfo                  Property   Veeam.Backup.Model.CBaseSessionInfo SessionInfo {get;}
State                        Property   Veeam.Backup.Model.CBaseSessionInfo+EState State {get;}
Tracer                       Property   Veeam.Backup.Core.ILogTracer Tracer {get;}


Any idea how I would get IsCompleted to update? I'm a PowerShell n00b...
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Wed Apr 05, 2017 7:18 pm

OK, so maybe not so n00b... This works... I understand that I'd need to take out the Write-Output "Waiting..." statement

Code: Select all
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer
$repo = Get-VBRBackupRepository -name "Production Repository"
$sync = Sync-VBRBackupRepository -repository $repo

while ( $sync.IsCompleted -ne $True ) {
  start-sleep -s 5
  Write-Output "Waiting..."
  $sync.CheckStop()
   }

Write-Output "Done" $sync.IsCompleted
Disconnect-VBRServer


so if I have a Scaleout repository at my client's site, I would use the -ScaleOut switch as well in the Get-VBRBackupRepository command...
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Thu Apr 06, 2017 1:02 pm

Well, that didn't work so well... I left this running over night... and it was still running this morning... Suggestions?? how do I get the session to report that it is done?
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby v.Eremin » Thu Apr 06, 2017 5:47 pm

IsCompleted is a static property that gets never updated in your script, thus, the cycle runs infinitely.

Try to utilize isStoped dynamic method instead and see whether it makes any difference.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Thu Apr 06, 2017 7:52 pm

Do I also have to update the status with CheckStop() ? using IsStoped([ref]$stopDetails) did nothing either...
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby v.Eremin » Fri Apr 07, 2017 10:17 am

I have tested it briefly and there does not seem to be a way to check the status of sync session dynamically (none of the available method returns anything valuable). So, it might be worth inputting such sleeping interval within which a session can definitely finish, say, 10 minutes or so. Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Fri Apr 07, 2017 11:44 am

Thanks!! I guess instead of doing this as the pre-job script I'll have to do it on the scheduler... the only problem is that I won't have a guaranteed refresh... le sigh...

NEw and improved Windows Scheduler script...
Code: Select all
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer
$repo = Get-VBRBackupRepository -name "Production Repository"
$sync = Sync-VBRBackupRepository -repository $repo
Start-Sleep -s 600
Disconnect-VBRServer


Thanks!

Roger
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby v.Eremin » Fri Apr 07, 2017 12:35 pm

If you do it via Windows Scheduler, sleep interval is not needed - just make a task start ten minutes earlier. :) Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: vCenter and Veeam replication to DR site

Veeam Logoby rogerdu » Mon Apr 10, 2017 1:03 pm

Would the Disconnect-VBRServer not stop the Sync?
rogerdu
Expert
 
Posts: 108
Liked: 7 times
Joined: Tue Aug 20, 2013 1:16 pm
Full Name: Roger Dufour

Re: vCenter and Veeam replication to DR site

Veeam Logoby v.Eremin » Mon Apr 10, 2017 1:35 pm 1 person likes this post

Nope, disconnecting PS session doesn't stop commands already placed on a backup server.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to VMware vSphere



Who is online

Users browsing this forum: btmaus and 16 guests