From e8495ac0c68fede0746ce104df0b03af246a9915 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Wed, 22 Apr 2015 08:54:45 +0300 Subject: [PATCH] wsp-10329 Adding hyper-v replica to HyperV Provider. WebPortal Part 2. --- .../VirtualizationErrorCodes.cs | 10 +- .../VirtualizationServerProxy2012.cs | 560 +++++++++++++++++- .../VirtualizationServerController2012.cs | 192 +++++- .../esVirtualizationServer2012.asmx.cs | 48 +- .../WebsitePanel_SharedResources.ascx.resx | 32 + .../HyperV2012R2_Settings.ascx | 4 +- .../HyperV2012R2_Settings.ascx.cs | 21 +- .../VpsDetailsReplications.ascx.resx | 134 +++-- .../App_LocalResources/ServerTabs.ascx.resx | 3 + .../VPS2012/UserControls/ServerTabs.ascx.cs | 7 +- .../VPS2012/VpsDetailsReplications.ascx | 255 +++++--- .../VPS2012/VpsDetailsReplications.ascx.cs | 313 +++++----- .../VpsDetailsReplications.ascx.designer.cs | 280 ++++++++- .../WebsitePanel.Portal.Modules.csproj | 4 +- 14 files changed, 1472 insertions(+), 391 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs index 4e51f34e..d7f37e80 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs @@ -114,9 +114,13 @@ public const string EJECT_DVD_DISK_ERROR = "VPS_EJECT_DVD_DISK_ERROR"; // Replication - public const string SET_REPLICA_SERVER_ERROR = "SET_REPLICA_SERVER_ERROR"; - public const string SET_NO_REPLICA_SERVER_ERROR = "SET_NO_REPLICA_SERVER_ERROR"; - public const string SET_SET_REPLICATION_ERROR = "SET_SET_REPLICATION_ERROR"; + public const string SET_REPLICA_SERVER_ERROR = "VPS_SET_REPLICA_SERVER_ERROR"; + public const string UNSET_REPLICA_SERVER_ERROR = "VPS_UNSET_REPLICA_SERVER_ERROR"; + public const string NO_REPLICA_SERVER_ERROR = "VPS_NO_REPLICA_SERVER_ERROR"; + public const string SET_REPLICATION_ERROR = "VPS_SET_REPLICATION_ERROR"; + public const string DISABLE_REPLICATION_ERROR = "VPS_DISABLE_REPLICATION_ERROR"; + public const string PAUSE_REPLICATION_ERROR = "VPS_PAUSE_REPLICATION_ERROR"; + public const string RESUME_REPLICATION_ERROR = "VPS_RESUME_REPLICATION_ERROR"; public const string HOST_NAMER_IS_ALREADY_USED = "HOST_NAMER_IS_ALREADY_USED"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs index b52ec841..4a093ead 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs @@ -148,7 +148,21 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback SetReplicaServerOperationCompleted; - private System.Threading.SendOrPostCallback IsReplicaServerOperationCompleted; + private System.Threading.SendOrPostCallback UnsetReplicaServerOperationCompleted; + + private System.Threading.SendOrPostCallback GetReplicaServerOperationCompleted; + + private System.Threading.SendOrPostCallback GetReplicationOperationCompleted; + + private System.Threading.SendOrPostCallback GetReplicationInfoOperationCompleted; + + private System.Threading.SendOrPostCallback SetVmReplicationOperationCompleted; + + private System.Threading.SendOrPostCallback DisableVmReplicationOperationCompleted; + + private System.Threading.SendOrPostCallback PauseReplicationOperationCompleted; + + private System.Threading.SendOrPostCallback ResumeReplicationOperationCompleted; /// public esVirtualizationServer2012() { @@ -327,7 +341,28 @@ namespace WebsitePanel.EnterpriseServer { public event SetReplicaServerCompletedEventHandler SetReplicaServerCompleted; /// - public event IsReplicaServerCompletedEventHandler IsReplicaServerCompleted; + public event UnsetReplicaServerCompletedEventHandler UnsetReplicaServerCompleted; + + /// + public event GetReplicaServerCompletedEventHandler GetReplicaServerCompleted; + + /// + public event GetReplicationCompletedEventHandler GetReplicationCompleted; + + /// + public event GetReplicationInfoCompletedEventHandler GetReplicationInfoCompleted; + + /// + public event SetVmReplicationCompletedEventHandler SetVmReplicationCompleted; + + /// + public event DisableVmReplicationCompletedEventHandler DisableVmReplicationCompleted; + + /// + public event PauseReplicationCompletedEventHandler PauseReplicationCompleted; + + /// + public event ResumeReplicationCompletedEventHandler ResumeReplicationCompleted; /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachines", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -3234,46 +3269,339 @@ namespace WebsitePanel.EnterpriseServer { } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/IsReplicaServer", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool IsReplicaServer(int serviceId, string remoteServer) { - object[] results = this.Invoke("IsReplicaServer", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UnsetReplicaServer", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject UnsetReplicaServer(int serviceId, string remoteServer) { + object[] results = this.Invoke("UnsetReplicaServer", new object[] { serviceId, remoteServer}); - return ((bool)(results[0])); + return ((ResultObject)(results[0])); } /// - public System.IAsyncResult BeginIsReplicaServer(int serviceId, string remoteServer, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("IsReplicaServer", new object[] { + public System.IAsyncResult BeginUnsetReplicaServer(int serviceId, string remoteServer, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UnsetReplicaServer", new object[] { serviceId, remoteServer}, callback, asyncState); } /// - public bool EndIsReplicaServer(System.IAsyncResult asyncResult) { + public ResultObject EndUnsetReplicaServer(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); - return ((bool)(results[0])); + return ((ResultObject)(results[0])); } /// - public void IsReplicaServerAsync(int serviceId, string remoteServer) { - this.IsReplicaServerAsync(serviceId, remoteServer, null); + public void UnsetReplicaServerAsync(int serviceId, string remoteServer) { + this.UnsetReplicaServerAsync(serviceId, remoteServer, null); } /// - public void IsReplicaServerAsync(int serviceId, string remoteServer, object userState) { - if ((this.IsReplicaServerOperationCompleted == null)) { - this.IsReplicaServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsReplicaServerOperationCompleted); + public void UnsetReplicaServerAsync(int serviceId, string remoteServer, object userState) { + if ((this.UnsetReplicaServerOperationCompleted == null)) { + this.UnsetReplicaServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUnsetReplicaServerOperationCompleted); } - this.InvokeAsync("IsReplicaServer", new object[] { + this.InvokeAsync("UnsetReplicaServer", new object[] { serviceId, - remoteServer}, this.IsReplicaServerOperationCompleted, userState); + remoteServer}, this.UnsetReplicaServerOperationCompleted, userState); } - private void OnIsReplicaServerOperationCompleted(object arg) { - if ((this.IsReplicaServerCompleted != null)) { + private void OnUnsetReplicaServerOperationCompleted(object arg) { + if ((this.UnsetReplicaServerCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.IsReplicaServerCompleted(this, new IsReplicaServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.UnsetReplicaServerCompleted(this, new UnsetReplicaServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetReplicaServer", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ReplicationServerInfo GetReplicaServer(int serviceId, string remoteServer) { + object[] results = this.Invoke("GetReplicaServer", new object[] { + serviceId, + remoteServer}); + return ((ReplicationServerInfo)(results[0])); + } + + /// + public System.IAsyncResult BeginGetReplicaServer(int serviceId, string remoteServer, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetReplicaServer", new object[] { + serviceId, + remoteServer}, callback, asyncState); + } + + /// + public ReplicationServerInfo EndGetReplicaServer(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ReplicationServerInfo)(results[0])); + } + + /// + public void GetReplicaServerAsync(int serviceId, string remoteServer) { + this.GetReplicaServerAsync(serviceId, remoteServer, null); + } + + /// + public void GetReplicaServerAsync(int serviceId, string remoteServer, object userState) { + if ((this.GetReplicaServerOperationCompleted == null)) { + this.GetReplicaServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetReplicaServerOperationCompleted); + } + this.InvokeAsync("GetReplicaServer", new object[] { + serviceId, + remoteServer}, this.GetReplicaServerOperationCompleted, userState); + } + + private void OnGetReplicaServerOperationCompleted(object arg) { + if ((this.GetReplicaServerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetReplicaServerCompleted(this, new GetReplicaServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetReplication", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VmReplication GetReplication(int itemId) { + object[] results = this.Invoke("GetReplication", new object[] { + itemId}); + return ((VmReplication)(results[0])); + } + + /// + public System.IAsyncResult BeginGetReplication(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetReplication", new object[] { + itemId}, callback, asyncState); + } + + /// + public VmReplication EndGetReplication(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VmReplication)(results[0])); + } + + /// + public void GetReplicationAsync(int itemId) { + this.GetReplicationAsync(itemId, null); + } + + /// + public void GetReplicationAsync(int itemId, object userState) { + if ((this.GetReplicationOperationCompleted == null)) { + this.GetReplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetReplicationOperationCompleted); + } + this.InvokeAsync("GetReplication", new object[] { + itemId}, this.GetReplicationOperationCompleted, userState); + } + + private void OnGetReplicationOperationCompleted(object arg) { + if ((this.GetReplicationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetReplicationCompleted(this, new GetReplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetReplicationInfo", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ReplicationDetailInfo GetReplicationInfo(int itemId) { + object[] results = this.Invoke("GetReplicationInfo", new object[] { + itemId}); + return ((ReplicationDetailInfo)(results[0])); + } + + /// + public System.IAsyncResult BeginGetReplicationInfo(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetReplicationInfo", new object[] { + itemId}, callback, asyncState); + } + + /// + public ReplicationDetailInfo EndGetReplicationInfo(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ReplicationDetailInfo)(results[0])); + } + + /// + public void GetReplicationInfoAsync(int itemId) { + this.GetReplicationInfoAsync(itemId, null); + } + + /// + public void GetReplicationInfoAsync(int itemId, object userState) { + if ((this.GetReplicationInfoOperationCompleted == null)) { + this.GetReplicationInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetReplicationInfoOperationCompleted); + } + this.InvokeAsync("GetReplicationInfo", new object[] { + itemId}, this.GetReplicationInfoOperationCompleted, userState); + } + + private void OnGetReplicationInfoOperationCompleted(object arg) { + if ((this.GetReplicationInfoCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetReplicationInfoCompleted(this, new GetReplicationInfoCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetVmReplication", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SetVmReplication(int itemId, VmReplication replication) { + object[] results = this.Invoke("SetVmReplication", new object[] { + itemId, + replication}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSetVmReplication(int itemId, VmReplication replication, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetVmReplication", new object[] { + itemId, + replication}, callback, asyncState); + } + + /// + public ResultObject EndSetVmReplication(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SetVmReplicationAsync(int itemId, VmReplication replication) { + this.SetVmReplicationAsync(itemId, replication, null); + } + + /// + public void SetVmReplicationAsync(int itemId, VmReplication replication, object userState) { + if ((this.SetVmReplicationOperationCompleted == null)) { + this.SetVmReplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetVmReplicationOperationCompleted); + } + this.InvokeAsync("SetVmReplication", new object[] { + itemId, + replication}, this.SetVmReplicationOperationCompleted, userState); + } + + private void OnSetVmReplicationOperationCompleted(object arg) { + if ((this.SetVmReplicationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetVmReplicationCompleted(this, new SetVmReplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DisableVmReplication", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DisableVmReplication(int itemId) { + object[] results = this.Invoke("DisableVmReplication", new object[] { + itemId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDisableVmReplication(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DisableVmReplication", new object[] { + itemId}, callback, asyncState); + } + + /// + public ResultObject EndDisableVmReplication(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DisableVmReplicationAsync(int itemId) { + this.DisableVmReplicationAsync(itemId, null); + } + + /// + public void DisableVmReplicationAsync(int itemId, object userState) { + if ((this.DisableVmReplicationOperationCompleted == null)) { + this.DisableVmReplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDisableVmReplicationOperationCompleted); + } + this.InvokeAsync("DisableVmReplication", new object[] { + itemId}, this.DisableVmReplicationOperationCompleted, userState); + } + + private void OnDisableVmReplicationOperationCompleted(object arg) { + if ((this.DisableVmReplicationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DisableVmReplicationCompleted(this, new DisableVmReplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/PauseReplication", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject PauseReplication(int itemId) { + object[] results = this.Invoke("PauseReplication", new object[] { + itemId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginPauseReplication(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("PauseReplication", new object[] { + itemId}, callback, asyncState); + } + + /// + public ResultObject EndPauseReplication(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void PauseReplicationAsync(int itemId) { + this.PauseReplicationAsync(itemId, null); + } + + /// + public void PauseReplicationAsync(int itemId, object userState) { + if ((this.PauseReplicationOperationCompleted == null)) { + this.PauseReplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPauseReplicationOperationCompleted); + } + this.InvokeAsync("PauseReplication", new object[] { + itemId}, this.PauseReplicationOperationCompleted, userState); + } + + private void OnPauseReplicationOperationCompleted(object arg) { + if ((this.PauseReplicationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.PauseReplicationCompleted(this, new PauseReplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ResumeReplication", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject ResumeReplication(int itemId) { + object[] results = this.Invoke("ResumeReplication", new object[] { + itemId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginResumeReplication(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ResumeReplication", new object[] { + itemId}, callback, asyncState); + } + + /// + public ResultObject EndResumeReplication(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void ResumeReplicationAsync(int itemId) { + this.ResumeReplicationAsync(itemId, null); + } + + /// + public void ResumeReplicationAsync(int itemId, object userState) { + if ((this.ResumeReplicationOperationCompleted == null)) { + this.ResumeReplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnResumeReplicationOperationCompleted); + } + this.InvokeAsync("ResumeReplication", new object[] { + itemId}, this.ResumeReplicationOperationCompleted, userState); + } + + private void OnResumeReplicationOperationCompleted(object arg) { + if ((this.ResumeReplicationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ResumeReplicationCompleted(this, new ResumeReplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -4767,26 +5095,208 @@ namespace WebsitePanel.EnterpriseServer { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void IsReplicaServerCompletedEventHandler(object sender, IsReplicaServerCompletedEventArgs e); + public delegate void UnsetReplicaServerCompletedEventHandler(object sender, UnsetReplicaServerCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class IsReplicaServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class UnsetReplicaServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal IsReplicaServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal UnsetReplicaServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// - public bool Result { + public ResultObject Result { get { this.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetReplicaServerCompletedEventHandler(object sender, GetReplicaServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetReplicaServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetReplicaServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ReplicationServerInfo Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ReplicationServerInfo)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetReplicationCompletedEventHandler(object sender, GetReplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetReplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetReplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VmReplication Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VmReplication)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetReplicationInfoCompletedEventHandler(object sender, GetReplicationInfoCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetReplicationInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetReplicationInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ReplicationDetailInfo Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ReplicationDetailInfo)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetVmReplicationCompletedEventHandler(object sender, SetVmReplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetVmReplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetVmReplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DisableVmReplicationCompletedEventHandler(object sender, DisableVmReplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DisableVmReplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DisableVmReplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void PauseReplicationCompletedEventHandler(object sender, PauseReplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class PauseReplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal PauseReplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ResumeReplicationCompletedEventHandler(object sender, ResumeReplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ResumeReplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ResumeReplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs index f84f9849..df25e2bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs @@ -3720,6 +3720,8 @@ namespace WebsitePanel.EnterpriseServer #region Replication + #region IsReplicaServer Part + public static CertificateInfo[] GetCertificates(int serviceId, string remoteServer) { VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId); @@ -3745,12 +3747,30 @@ namespace WebsitePanel.EnterpriseServer return result; } - public static bool IsReplicaServer(int serviceId, string remoteServer) + public static ResultObject UnsetReplicaServer(int serviceId, string remoteServer) + { + ResultObject result = new ResultObject(); + try + { + VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId); + vs.UnsetReplicaServer(remoteServer); + result.IsSuccess = true; + } + catch (Exception ex) + { + result.AddError(VirtualizationErrorCodes.UNSET_REPLICA_SERVER_ERROR, ex); + } + return result; + } + + public static ReplicationServerInfo GetReplicaServer(int serviceId, string remoteServer) { VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId); - return vs.IsReplicaServer(remoteServer); + return vs.GetReplicaServer(remoteServer); } + #endregion + public static VmReplication GetReplication(int itemId) { VirtualMachine vm = GetVirtualMachineByItemId(itemId); @@ -3758,7 +3778,14 @@ namespace WebsitePanel.EnterpriseServer return vs.GetReplication(vm.VirtualMachineId); } - public static ResultObject SetVmReplication(int itemId, string replicaServer, VmReplication replication) + public static ReplicationDetailInfo GetReplicationInfo(int itemId) + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + return vs.GetReplicationInfo(vm.VirtualMachineId); + } + + public static ResultObject SetVmReplication(int itemId, VmReplication replication) { ResultObject result = new ResultObject(); try @@ -3766,35 +3793,156 @@ namespace WebsitePanel.EnterpriseServer VirtualMachine vm = GetVirtualMachineByItemId(itemId); VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); - // Get replica server name - StringDictionary vsSesstings = ServerController.GetServiceSettings(vm.ServiceId); - string replicaServiceId = vsSesstings["ReplicaServerId"]; - - if (string.IsNullOrEmpty(replicaServiceId)) - { - result.ErrorCodes.Add(VirtualizationErrorCodes.SET_NO_REPLICA_SERVER_ERROR); + // Get replica server + var replicaServerInfo = GetReplicaInfoForService(vm.ServiceId, ref result); + if (result.ErrorCodes.Count > 0) return result; + + // We should use enable replication or set replication? + var vmReplica = vs.GetReplication(vm.VirtualMachineId); + if (vmReplica == null) // need enable + { + vs.EnableVmReplication(vm.VirtualMachineId, replicaServerInfo.ComputerName, replication); + vs.StartInitialReplication(vm.VirtualMachineId); + } + else // need set + { + vs.SetVmReplication(vm.VirtualMachineId, replicaServerInfo.ComputerName, replication); } - - //StringDictionary vsSesstings = ServerController.GetServiceSettings(vm.replicaServiceId); - //string replicaServiceId = vsSesstings["ReplicaServerId"]; - - //if (string.IsNullOrEmpty(replicaServiceId)) - //{ - // result.ErrorCodes.Add(VirtualizationErrorCodes.SET_NO_REPLICA_SERVER_ERROR); - // return result; - //} - - vs.SetVmReplication(vm.VirtualMachineId, replicaServer, replication); result.IsSuccess = true; } catch (Exception ex) { - result.AddError(VirtualizationErrorCodes.SET_SET_REPLICATION_ERROR, ex); + result.AddError(VirtualizationErrorCodes.SET_REPLICATION_ERROR, ex); } return result; } + public static ResultObject DisableVmReplication(int itemId) + { + ResultObject result = new ResultObject(); + try + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + vs.DisableVmReplication(vm.VirtualMachineId, null); + + CleanUpReplicaServer(vm); + + result.IsSuccess = true; + } + catch (Exception ex) + { + result.AddError(VirtualizationErrorCodes.DISABLE_REPLICATION_ERROR, ex); + } + return result; + } + + public static ResultObject PauseReplication(int itemId) + { + ResultObject result = new ResultObject(); + try + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + vs.PauseReplication(vm.VirtualMachineId); + + result.IsSuccess = true; + } + catch (Exception ex) + { + result.AddError(VirtualizationErrorCodes.PAUSE_REPLICATION_ERROR, ex); + } + return result; + } + + public static ResultObject ResumeReplication(int itemId) + { + ResultObject result = new ResultObject(); + try + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + vs.ResumeReplication(vm.VirtualMachineId); + + result.IsSuccess = true; + } + catch (Exception ex) + { + result.AddError(VirtualizationErrorCodes.RESUME_REPLICATION_ERROR, ex); + } + return result; + } + + #region Private methods + + private static void CleanUpReplicaServer(VirtualMachine originalVm) + { + try + { + ResultObject result = new ResultObject(); + + // Get replica server + var replicaServer = GetReplicaForService(originalVm.ServiceId, ref result); + + // Clean up replica server + var replicaVm = replicaServer.GetVirtualMachines().FirstOrDefault(m => m.Name == originalVm.Name); + + if (replicaVm != null) + { + replicaServer.DisableVmReplication(replicaVm.VirtualMachineId, null); + replicaServer.ShutDownVirtualMachine(replicaVm.VirtualMachineId, true, "ReplicaDelete"); + replicaServer.DeleteVirtualMachine(replicaVm.VirtualMachineId); + } + } + catch { /* skip */ } + } + + private static ReplicationServerInfo GetReplicaInfoForService(int serviceId, ref ResultObject result) + { + // Get service id of replica server + StringDictionary vsSesstings = ServerController.GetServiceSettings(serviceId); + string replicaServiceId = vsSesstings["ReplicaServerId"]; + + if (string.IsNullOrEmpty(replicaServiceId)) + { + result.ErrorCodes.Add(VirtualizationErrorCodes.NO_REPLICA_SERVER_ERROR); + return null; + } + + // get replica server info for replica service id + VirtualizationServer2012 vsReplica = GetVirtualizationProxy(Convert.ToInt32(replicaServiceId)); + StringDictionary vsReplicaSesstings = ServerController.GetServiceSettings(Convert.ToInt32(replicaServiceId)); + string computerName = vsReplicaSesstings["ServerName"]; + var replicaServerInfo = vsReplica.GetReplicaServer(computerName); + + if (!replicaServerInfo.Enabled) + { + result.ErrorCodes.Add(VirtualizationErrorCodes.NO_REPLICA_SERVER_ERROR); + return null; + } + + return replicaServerInfo; + } + + private static VirtualizationServer2012 GetReplicaForService(int serviceId, ref ResultObject result) + { + // Get service id of replica server + StringDictionary vsSesstings = ServerController.GetServiceSettings(serviceId); + string replicaServiceId = vsSesstings["ReplicaServerId"]; + + if (string.IsNullOrEmpty(replicaServiceId)) + { + result.ErrorCodes.Add(VirtualizationErrorCodes.NO_REPLICA_SERVER_ERROR); + return null; + } + + // get replica server for replica service id + return GetVirtualizationProxy(Convert.ToInt32(replicaServiceId)); + } + + #endregion + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs index 2d8275d2..cf1b1f40 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs @@ -488,12 +488,54 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public bool IsReplicaServer(int serviceId, string remoteServer) + public ResultObject UnsetReplicaServer(int serviceId, string remoteServer) { - return VirtualizationServerController2012.IsReplicaServer(serviceId, remoteServer); + return VirtualizationServerController2012.UnsetReplicaServer(serviceId, remoteServer); + } + + [WebMethod] + public ReplicationServerInfo GetReplicaServer(int serviceId, string remoteServer) + { + return VirtualizationServerController2012.GetReplicaServer(serviceId, remoteServer); + } + + [WebMethod] + public VmReplication GetReplication(int itemId) + { + return VirtualizationServerController2012.GetReplication(itemId); + } + + [WebMethod] + public ReplicationDetailInfo GetReplicationInfo(int itemId) + { + return VirtualizationServerController2012.GetReplicationInfo(itemId); + } + + [WebMethod] + public ResultObject SetVmReplication(int itemId, VmReplication replication) + { + return VirtualizationServerController2012.SetVmReplication(itemId, replication); + } + + [WebMethod] + public ResultObject DisableVmReplication(int itemId) + { + return VirtualizationServerController2012.DisableVmReplication(itemId); + } + + [WebMethod] + public ResultObject PauseReplication(int itemId) + { + return VirtualizationServerController2012.PauseReplication(itemId); + } + + [WebMethod] + public ResultObject ResumeReplication(int itemId) + { + return VirtualizationServerController2012.PauseReplication(itemId); } #endregion - } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index f2ae3863..92663fa5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -4073,6 +4073,38 @@ Cannot take virtual machine snapshot + + Cannot enable/set replication for the virtual machine + + + Cannot disable replication for the virtual machine + + + Cannot get replication for the virtual machine + + + + Cannot set replication for the server + + + Cannot unset replication for the server + + + Cannot find replication server + + + Cannot enable\set replication for the virtual machine + + + Cannot disable replication for the virtual machine + + + Cannot pause replication for the virtual machine + + + Cannot resume replication for the virtual machine + + Job execution failed with the following code: {1} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx index a1c3b68a..0cad3806 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx @@ -157,8 +157,8 @@ - No Hyper-v Replication - Enable Hyper-V Replication + No Hyper-v Replication + Enable Hyper-V Replication This is a Replica Server diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs index 2734e9eb..dc710b28 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs @@ -47,8 +47,8 @@ namespace WebsitePanel.Portal.ProviderControls public bool IsRemoteServer { get { return radioServer.SelectedIndex > 0; } } public string RemoteServerName { get { return IsRemoteServer ? txtServerName.Text.Trim() : ""; } } public string CertificateThumbprint { get { return IsRemoteServer ? txtCertThumbnail.Text.Trim() : ddlCertThumbnail.SelectedValue; } } - public bool IsReplicaServer { get { return ReplicationModeList.SelectedValue == "IsReplicaServer"; } } - public bool EnabledReplica { get { return ReplicationModeList.SelectedValue == "Enable"; } } + public bool IsReplicaServer { get { return ReplicationModeList.SelectedValue == ReplicaMode.IsReplicaServer.ToString(); } } + public bool EnabledReplica { get { return ReplicationModeList.SelectedValue == ReplicaMode.ReplicationEnabled.ToString(); } } public string ReplicaServerId { get; set; } void IHostingServiceProviderSettings.BindSettings(StringDictionary settings) @@ -106,7 +106,7 @@ namespace WebsitePanel.Portal.ProviderControls radioStopAction.SelectedValue = settings["StopAction"]; // replica - ReplicationModeList.SelectedValue = settings["ReplicaMode"] ?? "Disabled"; + ReplicationModeList.SelectedValue = settings["ReplicaMode"] ?? ReplicaMode.None.ToString(); txtReplicaPath.Text = settings["ReplicaServerPath"]; ReplicaServerId = settings["ReplicaServerId"]; @@ -115,12 +115,13 @@ namespace WebsitePanel.Portal.ProviderControls // replica txtCertThumbnail.Text = settings["ReplicaServerThumbprint"]; ddlCertThumbnail.SelectedValue = settings["ReplicaServerThumbprint"]; + ddlReplicaServer.SelectedValue = settings["ReplicaServerId"]; if (IsReplicaServer) { - var serverIsRealReplica = ES.Services.VPS2012.IsReplicaServer(PanelRequest.ServiceId, RemoteServerName); + var realReplica = ES.Services.VPS2012.GetReplicaServer(PanelRequest.ServiceId, RemoteServerName); - if (!serverIsRealReplica) + if (realReplica == null) ReplicaErrorTr.Visible = true; } } @@ -181,7 +182,7 @@ namespace WebsitePanel.Portal.ProviderControls settings["ReplicaServerPath"] = txtReplicaPath.Text; settings["ReplicaServerThumbprint"] = CertificateThumbprint; - SetReplication(); + SetUnsetReplication(); } private void BindNetworksList() @@ -261,7 +262,6 @@ namespace WebsitePanel.Portal.ProviderControls list.Add(serviceInfo); } - return list; } @@ -331,13 +331,16 @@ namespace WebsitePanel.Portal.ProviderControls protected void btnSetReplicaServer_Click(object sender, EventArgs e) { ToggleControls(); - SetReplication(); + SetUnsetReplication(); } - private void SetReplication() + private void SetUnsetReplication() { if (!IsReplicaServer) + { + ES.Services.VPS2012.UnsetReplicaServer(PanelRequest.ServiceId, RemoteServerName); return; + } if (txtReplicaPath.Text == "") { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx index 3b106beb..beba1420 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx @@ -112,63 +112,93 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - if(this.disabled) return false;if(!confirm('Do you want to apply selected snapshot to VPS?')) return false;ShowProgressDialog('Applying snapshot...'); + + ShowProgressDialog('Gathering detailed information...', 'DetailModal'); - - if(this.disabled) return false;if(!confirm('Do you want to completely delete selected snapshot?')) return false;ShowProgressDialog('Deleting snapshot...'); - - - if(!confirm('Do you want to completely delete selected snapshot and all its sub-tree?')) return false;ShowProgressDialog('Deleting snapshot sub-tree...'); - - - ShowProgressDialog('Renaming snapshot...', 'RenameSnapshotModal'); - - - ShowProgressDialog('Taking snapshot...'); - - - Now - - - This virtual server has no snapshots. - - - Apply - - - Cancel - - - Delete - - - Delete Subtree - - - Rename - - - Rename - - - <p>To take a <b>snapshot</b> is much like to take a picture of current VPS state: its configuration, memory and hard disk.</p><p>Snapshots maybe used as backup/restore points when installing new software or using VPS for development or testing purposes. If something has gone wrong there is an ability to roll-back and <b>"Apply"</b> a snapshot with good configuration.</p><p><b>"Rename"</b> button allows renaming snapshot and giving it some informative name, for example "Before applying service pack".</p> - - - Created: - - - Number of Snapshots: - - - Rename Snapshot + + ShowProgressDialog('Updating VM replication...'); - Snapshots + Replication + + + Details + + + Update + + + Enable replication + + + Volume Shadow Copy Service (VSS) snapshot frequency (in hours): + + + 15 minutes + + + 30 seconds + + + 5 minutes + + + SSL ceritficate: + + + Replication Frequency + + + Last synchronized at: + + + Primary Server: + + + Additional Recovery Points: + + + Coverage provided by additional recovery points (in hours): + + + Replica Server: + + + Choose Replication VHDs: + + + Create additional hourly recovery points + + + Maintain only the latest recovery point + + + Replication Configuration + + + Health + + + SSL certificate is required + + + chbVSS + + + Additional recovery points cannot be empty + + + VSS snapshot frequency range is 1-12 + + + VSS snapshot frequency cannot be empty + + + Please select at least one VHD \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx index eaf0db7c..2fc90195 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx @@ -144,6 +144,9 @@ Snapshots + + Replication + Tools diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs index f5b51d3a..ebdf4a57 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs @@ -133,12 +133,15 @@ namespace WebsitePanel.Portal.VPS2012.UserControls if ((vm.ExternalNetworkEnabled || vm.PrivateNetworkEnabled) && !createError) tabsList.Add(CreateTab("vps_network", "Tab.Network")); + if (!createError) + tabsList.Add(CreateTab("vps_replication", "Tab.Replication")); + //tabsList.Add(CreateTab("vps_permissions", "Tab.Permissions")); //tabsList.Add(CreateTab("vps_tools", "Tab.Tools")); tabsList.Add(CreateTab("vps_audit_log", "Tab.AuditLog")); - if (!createError) - tabsList.Add(CreateTab("vps_help", "Tab.Help")); + //if (!createError) + // tabsList.Add(CreateTab("vps_help", "Tab.Help")); // find selected menu item diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx index b66cb332..bb2bc8fe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx @@ -4,11 +4,34 @@ <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> -<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> + + +
@@ -23,83 +46,165 @@
- - -
-
- - + + +
+
+ + - - - - - - -
- -
- -
-
- - - - - - - - -
- -
- -
-
- -     - - -
- -

- - -

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
- -
-
+ -
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + +
+ + + +
+ + +
+ + +
+
+ + +
+
+ + + + 30seconds + 5minutes + 15minutes + +
+ + + + Maintain only the latest recovery point + Create additional hourly recovery points + + + + + + + + + + + +
+ + + + + + +
+ + +
+ + + + +
+
+
+
+ +
+
+
+
+ + -