wsp-10329 Adding hyper-v replica to HyperV Provider. Enterprise Part 2.

This commit is contained in:
Alexander Trofimov 2015-04-16 22:21:20 +03:00
parent 9685e61e7e
commit 27155ddc5e
8 changed files with 508 additions and 29 deletions

View file

@ -3726,6 +3726,30 @@ namespace WebsitePanel.EnterpriseServer
return vs.GetCertificates(remoteServer);
}
public static ResultObject SetReplicaServer(int serviceId, string remoteServer, string thumbprint, string storagePath)
{
ResultObject result = new ResultObject();
try
{
if (string.IsNullOrEmpty(storagePath))
throw new Exception("Please enter replication path");
VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId);
vs.SetReplicaServer(remoteServer, thumbprint, storagePath);
}
catch (Exception ex)
{
result.AddError(VirtualizationErrorCodes.SET_REPLICA_SERVER_ERROR, ex);
}
return result;
}
public static bool IsReplicaServer(int serviceId, string remoteServer)
{
VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId);
return vs.IsReplicaServer(remoteServer);
}
#endregion
}
}