diff --git a/XenAdmin/Alerts/Types/MessageAlert.cs b/XenAdmin/Alerts/Types/MessageAlert.cs index 351f1cdf9..96146ab7f 100644 --- a/XenAdmin/Alerts/Types/MessageAlert.cs +++ b/XenAdmin/Alerts/Types/MessageAlert.cs @@ -229,22 +229,6 @@ namespace XenAdmin.Alerts } break; - //these here do not need the object - case Message.MessageType.VMPP_ARCHIVE_FAILED_0: - case Message.MessageType.VMPP_ARCHIVE_LOCK_FAILED: - case Message.MessageType.VMPP_ARCHIVE_MISSED_EVENT: - case Message.MessageType.VMPP_ARCHIVE_SUCCEEDED: - case Message.MessageType.VMPP_ARCHIVE_TARGET_MOUNT_FAILED: - case Message.MessageType.VMPP_ARCHIVE_TARGET_UNMOUNT_FAILED: - case Message.MessageType.VMPP_SNAPSHOT_ARCHIVE_ALREADY_EXISTS: - case Message.MessageType.VMPP_SNAPSHOT_FAILED: - case Message.MessageType.VMPP_SNAPSHOT_LOCK_FAILED: - case Message.MessageType.VMPP_SNAPSHOT_MISSED_EVENT: - case Message.MessageType.VMPP_SNAPSHOT_SUCCEEDED: - case Message.MessageType.VMPP_LICENSE_ERROR: - case Message.MessageType.VMPP_XAPI_LOGON_FAILURE: - var policyAlert = new PolicyAlert(Message.Connection, Message.body); - return policyAlert.Text; case Message.MessageType.VMSS_SNAPSHOT_MISSED_EVENT: case Message.MessageType.VMSS_XAPI_LOGON_FAILURE: case Message.MessageType.VMSS_LICENSE_ERROR: diff --git a/XenAdmin/Commands/Controls/AssignVMGroupToolStripMenuItem.cs b/XenAdmin/Commands/Controls/AssignVMGroupToolStripMenuItem.cs index 774cf1fdb..d76b08368 100644 --- a/XenAdmin/Commands/Controls/AssignVMGroupToolStripMenuItem.cs +++ b/XenAdmin/Commands/Controls/AssignVMGroupToolStripMenuItem.cs @@ -34,17 +34,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Windows.Forms; -using XenAdmin.Actions; using XenAdmin.Core; -using XenAdmin.Wizards.NewPolicyWizard; using XenAPI; using XenAdmin.Dialogs; using System.Drawing; -using XenAdmin.Wizards; -using XenAdmin.Network; -using XenAdmin.Wizards.NewVMApplianceWizard; - namespace XenAdmin.Commands { /// @@ -85,7 +79,7 @@ namespace XenAdmin.Commands /* do not add unsupported policies to the drop down for VMSS */ XenAPI.VMSS policy = group as VMSS; - if (policy != null && policy.policy_type == policy_backup_type.snapshot_with_quiesce) + if (policy != null && policy.type == vmss_type.snapshot_with_quiesce) { List vms = Command.GetSelection().AsXenObjects(); bool doNotInclude = vms.Any(vm => !vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce)); @@ -306,12 +300,6 @@ namespace XenAdmin.Commands } } - /// - /// Class used for the benefit of visual studio's form designer which has trouble with generic controls - /// - internal sealed class AssignGroupToolStripMenuItemVMPP : AssignGroupToolStripMenuItem - { } - /// /// Class used for the benefit of visual studio's form designer which has trouble with generic controls /// diff --git a/XenAdmin/Commands/Controls/ContextMenuBuilder.cs b/XenAdmin/Commands/Controls/ContextMenuBuilder.cs index 42b916803..7fc905ee5 100644 --- a/XenAdmin/Commands/Controls/ContextMenuBuilder.cs +++ b/XenAdmin/Commands/Controls/ContextMenuBuilder.cs @@ -707,7 +707,6 @@ namespace XenAdmin.Commands items.AddSeparator(); if (selection.FirstAsXenObject != null ) items.Add(new HACommand(mainWindow, selection)); - items.AddIfEnabled(new VMGroupCommand(mainWindow, selection)); items.AddIfEnabled(new VMGroupCommand(mainWindow, selection)); items.AddIfEnabled(new VMGroupCommand(mainWindow, selection)); @@ -889,7 +888,6 @@ namespace XenAdmin.Commands items.AddIfEnabled(new ExportCommand(mainWindow, selection)); items.AddIfEnabled(new TakeSnapshotCommand(mainWindow, selection)); items.AddIfEnabled(new ConvertVMToTemplateCommand(mainWindow, selection)); - items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddSeparator(); @@ -1084,7 +1082,6 @@ namespace XenAdmin.Commands items.AddIfEnabled(new ResumeVMOnHostToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new MigrateVMToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new ExportCommand(mainWindow, selection)); - items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddIfEnabled(new AssignGroupToolStripMenuItem(mainWindow, selection, true)); items.AddSeparator(); diff --git a/XenAdmin/Commands/VMGroupCommand.cs b/XenAdmin/Commands/VMGroupCommand.cs index 19597b001..3a7f6d3d9 100644 --- a/XenAdmin/Commands/VMGroupCommand.cs +++ b/XenAdmin/Commands/VMGroupCommand.cs @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Windows.Forms; using XenAdmin.Core; using XenAdmin.Dialogs; @@ -90,11 +88,7 @@ namespace XenAdmin.Commands protected override bool CanExecuteCore(SelectedItemCollection selection) { - if (typeof(T) == typeof(VMPP) && selection.Any(s => Helpers.ClearwaterOrGreater(s.Connection))) - { - return false; - } - else if (typeof(T) == typeof(VMSS) && selection.Any(s => !Helpers.DundeeOrGreater(s.Connection))) + if (typeof(T) == typeof(VMSS) && selection.Any(s => !Helpers.FalconOrGreater(s.Connection))) { return false; } @@ -121,12 +115,6 @@ namespace XenAdmin.Commands } } - /// - /// Class used for the benefit of visual studio's form designer which has trouble with generic controls - /// - internal sealed class VMGroupCommandVMPP : VMGroupCommand - { } - /// /// Class used for the benefit of visual studio's form designer which has trouble with generic controls /// diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/DataGridViewTextAndImageCell.cs b/XenAdmin/Controls/DataGridViewTextAndImageCell.cs similarity index 96% rename from XenAdmin/Dialogs/VMProtectionRecovery/DataGridViewTextAndImageCell.cs rename to XenAdmin/Controls/DataGridViewTextAndImageCell.cs index 915061cfe..2628f11a3 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/DataGridViewTextAndImageCell.cs +++ b/XenAdmin/Controls/DataGridViewTextAndImageCell.cs @@ -35,7 +35,7 @@ using System.Text; using System.Windows.Forms; using System.Drawing; -namespace XenAdmin.Dialogs.VMProtectionRecovery +namespace XenAdmin.Controls { public class DataGridViewTextAndImageCell : DataGridViewTextBoxCell { diff --git a/XenAdmin/Core/Registry.cs b/XenAdmin/Core/Registry.cs index a805de329..8b6a350f7 100644 --- a/XenAdmin/Core/Registry.cs +++ b/XenAdmin/Core/Registry.cs @@ -48,14 +48,6 @@ namespace XenAdmin.Core } } - internal static bool VMPRFeatureEnabled - { - get - { - return ReadBool(VMPR_ENABLED, true); - } - } - internal static bool DisablePlugins { get @@ -390,7 +382,6 @@ namespace XenAdmin.Core private const string ALLOW_CREDENTIAL_SAVE = "AllowCredentialSave"; private const string FORCE_SYSTEM_FONTS = "ForceSystemFonts"; private const string DISABLE_PLUGINS = "DisablePlugins"; - private const string VMPR_ENABLED = "VMPREnabled"; private const string DONT_SUDO = "DontSudo"; private const string XENCENTER_LOCAL_KEYS = @"SOFTWARE\" + Branding.COMPANY_NAME_SHORT + @"\" + Branding.BRAND_CONSOLE; private const string PSConsoleKey = @"Software\" + Branding.COMPANY_NAME_SHORT + @"\XenServerPSSnapIn"; diff --git a/XenAdmin/Core/VMGroup.cs b/XenAdmin/Core/VMGroup.cs index 82ad8421f..cf13fc96f 100644 --- a/XenAdmin/Core/VMGroup.cs +++ b/XenAdmin/Core/VMGroup.cs @@ -31,10 +31,9 @@ using System; using System.Collections.Generic; -using System.Text; using XenAdmin.Actions; using XenAdmin.Dialogs; -using XenAdmin.Dialogs.VMPolicies; +using XenAdmin.Dialogs.ScheduledSnapshots; using XenAdmin.Dialogs.VMAppliances; using XenAdmin.Network; using XenAdmin.Wizards; @@ -46,7 +45,7 @@ using XenAPI; namespace XenAdmin.Core { /// - /// A helper class for dealing with a group of VMs (currently either a VMPP, VMSS or a vApp); + /// A helper class for dealing with a group of VMs (currently either a VMSS or a vApp); /// it contains all the functions necessary to abstract away what type of group it is. /// /// In C++, we would use template specialization for this, but C# generics don't have that, so we @@ -59,87 +58,87 @@ namespace XenAdmin.Core internal static T[] GroupsInCache(ICache cache) { - return typeof(T) == typeof(VMPP) ? cache.VMPPs as T[] : (typeof(T) == typeof(VMSS)? cache.VMSSs as T[] : cache.VM_appliances as T[]); + return typeof(T) == typeof(VMSS)? cache.VMSSs as T[] : cache.VM_appliances as T[]; } internal static XenRef VmToGroup(VM vm) { - return typeof(T) == typeof(VMPP) ? vm.protection_policy as XenRef : (typeof(T) == typeof(VMSS) ? vm.snapshot_schedule as XenRef : vm.appliance as XenRef); + return typeof(T) == typeof(VMSS) ? vm.snapshot_schedule as XenRef : vm.appliance as XenRef; } internal static List> GroupToVMs(T group) { - return typeof(T) == typeof(VMPP) ? (group as VMPP).VMs : (typeof(T) == typeof(VMSS) ? (group as VMSS).VMs : (group as VM_appliance).VMs); + return typeof(T) == typeof(VMSS) ? (group as VMSS).VMs : (group as VM_appliance).VMs; } internal static string ChangeOneWarningString { - get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICY_WARNING : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VM_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCE_WARNING); } + get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VM_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCE_WARNING; } } internal static string ChangeMultipleWarningString { - get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICIES_WARNING : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMS_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCES_WARNING); } + get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMS_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCES_WARNING; } } internal static string NewGroupString { - get { return typeof(T) == typeof(VMPP) ? Messages.NEW_POLICY : (typeof(T) == typeof(VMSS) ? Messages.NEW_SCHEDULE : Messages.NEW_VM_APPLIANCE); } + get { return typeof(T) == typeof(VMSS) ? Messages.NEW_SCHEDULE : Messages.NEW_VM_APPLIANCE; } } internal static string ChangeVMsGroupString { - get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICY : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMSS_POLICY : Messages.CHANGE_VMS_APPLIANCE); } + get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMSS_POLICY : Messages.CHANGE_VMS_APPLIANCE; } } internal static string AssignMainMenuString { - get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY : (typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY : Messages.ASSIGN_VM_APPLIANCE); } + get { return typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY : Messages.ASSIGN_VM_APPLIANCE; } } internal static string AssignContextMenuString { - get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY_CONTEXT_MENU : (typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY_CONTEXT_MENU : Messages.ASSIGN_VM_APPLIANCE); } + get { return typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY_CONTEXT_MENU : Messages.ASSIGN_VM_APPLIANCE; } } internal static string ManageMainMenuString { - get { return typeof(T) == typeof(VMPP) ? Messages.VM_PROTECTION_MAIN_MENU : (typeof(T) == typeof(VMSS) ? Messages.VMSS_MAIN_MENU : Messages.VM_APPLIANCES_MENU); } + get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_MAIN_MENU : Messages.VM_APPLIANCES_MENU; } } internal static string ManageContextMenuString { - get { return typeof(T) == typeof(VMPP) ? Messages.VM_PROTECTION_CONTEXT_MENU : (typeof(T) == typeof(VMSS) ? Messages.VMSS_CONTEXT_MENU : Messages.VM_APPLIANCES_MENU); } + get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_CONTEXT_MENU : Messages.VM_APPLIANCES_MENU; } } internal static string ChooseVMsPage_Text { - get { return typeof(T) == typeof(VMPP) ? Messages.PROTECTED_VMS : (typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS : Messages.NEWVMAPPLIANCE_VMSPAGE_TEXT); } + get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS : Messages.NEWVMAPPLIANCE_VMSPAGE_TEXT; } } internal static string ChooseVMsPage_Title { - get { return typeof(T) == typeof(VMPP) ? Messages.PROTECTED_VMS_TITLE : (typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS_TITLE : Messages.NEWVMAPPLIANCE_VMSPAGE_TITLE); } + get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS_TITLE : Messages.NEWVMAPPLIANCE_VMSPAGE_TITLE; } } internal static string ChooseVMsPage_Rubric { - get { return typeof(T) == typeof(VMPP) ? Messages.CHOOSE_VMS_VMPP_RUBRIC : (typeof(T) == typeof(VMSS) ? Messages.CHOOSE_VMS_VMSS_RUBRIC : Messages.CHOOSE_VMS_VAPP_RUBRIC); } + get { return typeof(T) == typeof(VMSS) ? Messages.CHOOSE_VMS_VMSS_RUBRIC : Messages.CHOOSE_VMS_VAPP_RUBRIC; } } internal static string ChooseVMsPage_CurrentGroup { - get { return typeof(T) == typeof(VMPP) ? Messages.CURRENT_POLICY : (typeof(T) == typeof(VMSS) ? Messages.CURRENT_SCHEDULE : Messages.CURRENT_VAPP); } + get { return typeof(T) == typeof(VMSS) ? Messages.CURRENT_SCHEDULE : Messages.CURRENT_VAPP; } } internal static string VMPolicyTypeName { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_TYPE : Messages.VMSS_TYPE; } + get { return Messages.VMSS_TYPE; } } internal static string ChooseVMsPage_HelpID { - get { return typeof(T) == typeof(VMPP) ? "VirtualMachines" : "VMs"; } // these are only different for historical reasons + get { return "VMs"; } } internal static string UpsellBlurb @@ -147,220 +146,62 @@ namespace XenAdmin.Core get { if (HiddenFeatures.LinkLabelHidden) - return typeof(T) == typeof(VMPP) ? Messages.UPSELL_BLURB_VM_PROTECTION : (typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS : Messages.UPSELL_BLURB_VM_APPLIANCES); + return typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS : Messages.UPSELL_BLURB_VM_APPLIANCES; else - return typeof(T) == typeof(VMPP) ? Messages.UPSELL_BLURB_VM_PROTECTION + Messages.UPSELL_BLURB_VM_PROTECTION_MORE : (typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS + Messages.UPSELL_BLURB_VMSS_MORE : Messages.UPSELL_BLURB_VM_APPLIANCES + Messages.UPSELL_BLURB_VM_APPLIANCES_MORE); + return typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS + Messages.UPSELL_BLURB_VMSS_MORE : Messages.UPSELL_BLURB_VM_APPLIANCES + Messages.UPSELL_BLURB_VM_APPLIANCES_MORE; } } internal static string UpsellLearnMoreUrl { - get { return typeof(T) == typeof(VMPP) ? InvisibleMessages.UPSELL_LEARNMOREURL_VM_PROTECTION : (typeof(T) == typeof(VMSS) ? InvisibleMessages.UPSELL_LEARNMOREURL_VMSS : InvisibleMessages.UPSELL_LEARNMOREURL_VM_APPLIANCES); } + get { return typeof(T) == typeof(VMSS) ? InvisibleMessages.UPSELL_LEARNMOREURL_VMSS : InvisibleMessages.UPSELL_LEARNMOREURL_VM_APPLIANCES; } } internal static AsyncAction AssignVMsToGroupAction(T group, List> vms, bool suppressHistory) { - return typeof(T) == typeof(VMPP) ? - (AsyncAction)(new AssignVMsToPolicyAction(group as VMPP, vms, suppressHistory)) : - (typeof(T) == typeof(VMSS) ? (AsyncAction)(new AssignVMsToPolicyAction(group as VMSS, vms, suppressHistory)) : - (AsyncAction)(new AssignVMsToVMApplianceAction(group as VM_appliance, vms, suppressHistory))); + return typeof(T) == typeof(VMSS) ? (AsyncAction)(new AssignVMsToPolicyAction(group as VMSS, vms, suppressHistory)) : + (AsyncAction)(new AssignVMsToVMApplianceAction(group as VM_appliance, vms, suppressHistory)); } internal static AsyncAction RemoveVMsFromGroupAction(T group, List> vms) { - return typeof(T) == typeof(VMPP) ? - (AsyncAction)(new RemoveVMsFromPolicyAction(group as VMPP, vms)) : - (typeof(T) == typeof(VMSS) ? (AsyncAction)(new RemoveVMsFromPolicyAction(group as VMSS, vms)) : - (AsyncAction)(new RemoveVMsFromVMApplianceAction(group as VM_appliance, vms))); + return typeof(T) == typeof(VMSS) ? (AsyncAction)(new RemoveVMsFromPolicyAction(group as VMSS, vms)) : + (AsyncAction)(new RemoveVMsFromVMApplianceAction(group as VM_appliance, vms)); } internal static XenWizardBase NewGroupWizard(Pool pool) { - return typeof(T) == typeof(VMPP) ? (XenWizardBase)(new NewPolicyWizardSpecific(pool)) : (typeof(T) == typeof(VMSS) ? (XenWizardBase)(new NewPolicyWizardSpecific(pool)) : (XenWizardBase)(new NewVMApplianceWizard(pool))); + return typeof(T) == typeof(VMSS) ? (XenWizardBase) new NewPolicyWizard(pool) : new NewVMApplianceWizard(pool); } internal static XenWizardBase NewGroupWizard(Pool pool, List vms) { - return typeof(T) == typeof(VMPP) ? (XenWizardBase)(new NewPolicyWizardSpecific(pool, vms)) : (typeof(T) == typeof(VMSS) ? (XenWizardBase)(new NewPolicyWizardSpecific(pool, vms)) : (XenWizardBase)(new NewVMApplianceWizard(pool, vms))); + return typeof(T) == typeof(VMSS) ? new NewPolicyWizard(pool, vms) : (XenWizardBase)new NewVMApplianceWizard(pool, vms); } internal static XenDialogBase ManageGroupsDialog(Pool pool) { - return typeof(T) == typeof(VMPP) ? (XenDialogBase)(new VMPoliciesDialogSpecific(pool)) : (typeof(T) == typeof(VMSS) ? (XenDialogBase)(new VMPoliciesDialogSpecific(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool))); + return typeof(T) == typeof(VMSS) ? (XenDialogBase)(new ScheduledSnapshotsDialog(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool)); } internal static bool FeaturePossible(IXenConnection connection) { - if (typeof(T) == typeof(VMPP) && (Helpers.ClearwaterOrGreater(connection))) - return false; //VMSS is enabled Falcon onwards if ((typeof(T) == typeof(VMSS)) && !Helpers.FalconOrGreater(connection)) return false; - return typeof(T) == typeof(VMPP) ? - Registry.VMPRFeatureEnabled : - true; + return true; } internal static Predicate FeatureRestricted { - get { return typeof(T) == typeof(VMPP) ? (Predicate)Host.RestrictVMProtection : (typeof(T) == typeof(VMSS) ? ((Predicate)Host.RestrictVMSnapshotSchedule) : (Predicate)Host.RestrictVMAppliances); } - } - - internal static string VMPolicyDialogTitle - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_DIALOG_TITLE : Messages.VMSS_DIALOG_TITLE; } - } - - internal static string VMPolicyDialogText - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_DIALOG_TEXT : Messages.VMSS_DIALOG_TEXT; } - } - - internal static string VMPolicyDialogSchedulesInPool - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL : Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL; } - } - - internal static string VMPolicyDialogSchedulesInServer - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER : Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER; } - } - - internal static IVMPolicy[] VMPolicies (ICache cache) - { - if (typeof(T) == typeof(VMPP)) - return cache.VMPPs; - else - return cache.VMSSs; + get { return typeof(T) == typeof(VMSS) ? ((Predicate)Host.RestrictVMSnapshotSchedule) : (Predicate)Host.RestrictVMAppliances; } } internal static bool isQuescingSupported { - get { return typeof(T) == typeof(VMPP) ? false : true; } - } - - internal static string VMPolicyNamePageText - { - get { return typeof(T) == typeof(VMPP) ? Messages.NEW_VMPP_PAGE_TEXT : Messages.NEW_VMSS_PAGE_TEXT; } - } - - internal static string VMPolicyNamePageTextMore - { - get { return typeof(T) == typeof(VMPP) ? Messages.NEW_VMPP_PAGE_TEXT_MORE : Messages.NEW_VMSS_PAGE_TEXT_MORE; } - } - - internal static string VMPolicyNamePageTabName - { - get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME : Messages.VMSS_NAME; } - } - - internal static string VMPolicyNamePageTabText - { - get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME_TITLE : Messages.VMSS_NAME_TITLE; } - } - - internal static string VMPolicyNamePageNameFieldText - { - get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME_FIELD_TEXT : Messages.VMSS_NAME_FIELD_TEXT; } - } - - internal static string VMPolicyFinishPageText - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_PAGE_TEXT : Messages.VMSS_FINISH_PAGE_TEXT; } - } - - internal static string VMPolicyFinishPageTitle - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_TITLE : Messages.VMSS_FINISH_TITLE; } - } - - internal static string VMPolicyFinishPageCheckboxText - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_PAGE_CHECKBOX_TEXT : Messages.VMSS_FINISH_PAGE_CHECKBOX_TEXT; } - } - - internal static string VMPolicyRBACWarning - { - get { return typeof(T) == typeof(VMPP) ? Messages.RBAC_WARNING_VMPP : Messages.RBAC_WARNING_VMSS; } - } - - internal static string VMPolicyRBACapiCheck - { - get { return typeof(T) == typeof(VMPP) ? "VMPP.async_create" : "VMSS.async_create"; } - } - - internal static string VMPolicyWizardTitle - { - get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_WIZARD_TITLE : Messages.VMSS_WIZARD_TITLE; } - } - - internal static bool isVMPolicyVMPP - { - get { return typeof(T) == typeof(VMPP) ? true : false; } - } - - internal static string VMAssigningPolicy - { - get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGNING_PROTECTION_POLICY : Messages.ASSIGNING_VMSS_POLICY; } - } - - internal static AsyncAction VMCreateObjectAction( - string _name_label, - string _name_description, - policy_backup_type _backup_type, - policy_frequency _backup_frequency, - Dictionary _backup_schedule, - long _backup_retention_value, - vmpp_archive_frequency _archive_frequency, - Dictionary _archive_target_config, - vmpp_archive_target_type _archive_target_type, - Dictionary _archive_schedule, - bool _is_alarm_enabled, - Dictionary _alarm_config, - bool _is_policy_enabled, - List vms, - bool runNow, - IXenConnection _connection) - { - if (typeof(T) == typeof(VMPP)) - { - var vmpp = new VMPP - { - name_label = _name_label, - name_description = _name_description, - backup_type = (vmpp_backup_type)_backup_type, - backup_frequency = (vmpp_backup_frequency)_backup_frequency, - backup_schedule = _backup_schedule, - backup_retention_value = _backup_retention_value, - archive_frequency = _archive_frequency, - archive_target_config = _archive_target_config, - archive_target_type = _archive_target_type, - archive_schedule = _archive_schedule, - is_alarm_enabled = _is_alarm_enabled, - alarm_config = _alarm_config, - is_policy_enabled = _is_policy_enabled, - Connection = _connection - }; - return new CreateVMPolicy(vmpp, vms, runNow); - } - else - { - var vmss = new VMSS - { - name_label = _name_label, - name_description = _name_description, - type = (vmss_type)_backup_type, - frequency = (vmss_frequency)_backup_frequency, - schedule = _backup_schedule, - retained_snapshots = _backup_retention_value, - enabled = _is_policy_enabled, - Connection = _connection - }; - - return new CreateVMPolicy(vmss, vms, runNow); - } + get { return typeof(T) == typeof(VMSS); } } } } diff --git a/XenAdmin/Dialogs/DRConfigureDialog.cs b/XenAdmin/Dialogs/DRConfigureDialog.cs index 1616c09a1..cb02ab702 100644 --- a/XenAdmin/Dialogs/DRConfigureDialog.cs +++ b/XenAdmin/Dialogs/DRConfigureDialog.cs @@ -34,7 +34,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -using XenAdmin.Dialogs.VMProtectionRecovery; +using XenAdmin.Controls; using XenAPI; diff --git a/XenAdmin/Dialogs/HealthCheck/HealthCheckOverviewDialog.cs b/XenAdmin/Dialogs/HealthCheck/HealthCheckOverviewDialog.cs index 0c381a87d..69d66808f 100644 --- a/XenAdmin/Dialogs/HealthCheck/HealthCheckOverviewDialog.cs +++ b/XenAdmin/Dialogs/HealthCheck/HealthCheckOverviewDialog.cs @@ -37,7 +37,7 @@ using System.Linq; using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Core; -using XenAdmin.Dialogs.VMProtectionRecovery; +using XenAdmin.Controls; using XenAdmin.Model; using XenAdmin.Network; using XenAPI; diff --git a/XenAdmin/Dialogs/PropertiesDialog.cs b/XenAdmin/Dialogs/PropertiesDialog.cs index e2d93122a..da1624989 100644 --- a/XenAdmin/Dialogs/PropertiesDialog.cs +++ b/XenAdmin/Dialogs/PropertiesDialog.cs @@ -67,11 +67,7 @@ namespace XenAdmin.Dialogs private HostPowerONEditPage HostPowerONEditPage; private PoolPowerONEditPage PoolPowerONEditPage; private NewPolicySnapshotFrequencyPage newPolicySnapshotFrequencyPage1; - private NewPolicySnapshotTypePageSpecific newPolicySnapshotTypePage1; - private NewPolicySnapshotTypePageSpecific newPolicyVMSSTypePage1; - private NewPolicyArchivePage newPolicyArchivePage1; - private NewPolicyEmailPage newPolicyEmailPage1; - private NewVMGroupVMsPage newPolicyVMsPage1; + private NewPolicySnapshotTypePage newPolicyVMSSTypePage1; private NewVMGroupVMsPage newVMSSVMsPage1; private NewVMGroupVMsPage newVMApplianceVMsPage1; private NewVMApplianceVMOrderAndDelaysPage newVmApplianceVmOrderAndDelaysPage1; @@ -131,8 +127,6 @@ namespace XenAdmin.Dialogs bool wlb_enabled = (Helpers.WlbEnabledAndConfigured(xenObjectCopy.Connection)); - bool is_VMPP = xenObjectCopy is VMPP; - bool is_VM_appliance = xenObjectCopy is VM_appliance; bool is_VMSS = xenObjectCopy is VMSS; @@ -146,7 +140,7 @@ namespace XenAdmin.Dialogs ShowTab(GeneralEditPage = new GeneralEditPage()); - if (!is_VMPP && !is_VM_appliance) + if (!is_VM_appliance) ShowTab(CustomFieldsEditPage = new CustomFieldsDisplayPage {AutoScroll = true}); if (is_vm) @@ -240,19 +234,10 @@ namespace XenAdmin.Dialogs if (is_vm && Helpers.ContainerCapability(xenObject.Connection) && ((VM)xenObjectCopy).CanHaveCloudConfigDrive) ShowTab(CloudConfigParametersPage = new Page_CloudConfigParameters()); - if (is_VMPP) - { - ShowTab(newPolicyVMsPage1 = new NewVMGroupVMsPage {Pool = pool}); - ShowTab(newPolicySnapshotTypePage1 = new NewPolicySnapshotTypePageSpecific()); - ShowTab(newPolicySnapshotFrequencyPage1 = new NewPolicySnapshotFrequencyPage {Pool = pool}); - ShowTab(newPolicyArchivePage1 = new NewPolicyArchivePage {Pool = pool, PropertiesDialog = this}); - ShowTab(newPolicyEmailPage1 = new NewPolicyEmailPage() {PropertiesDialog = this}); - } - if(is_VMSS) { ShowTab(newVMSSVMsPage1 = new NewVMGroupVMsPage {Pool = pool}); - ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePageSpecific()); + ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePage()); ShowTab(newPolicySnapshotFrequencyPage1 = new NewPolicySnapshotFrequencyPage {Pool = pool}); } @@ -348,7 +333,7 @@ namespace XenAdmin.Dialogs if(xenObjectBefore is VMSS) { XenAPI.VMSS VMSSObj = xenObjectBefore as XenAPI.VMSS; - if (VMSSObj.policy_type == policy_backup_type.snapshot_with_quiesce) + if (VMSSObj.type == vmss_type.snapshot_with_quiesce) { actions.Insert(0, new SaveChangesAction(xenObjectCopy, xenObjectBefore, true)); } @@ -488,21 +473,13 @@ namespace XenAdmin.Dialogs private void verticalTabs_SelectedIndexChanged(object sender, EventArgs e) { - var snapshotTypePageSpecific = verticalTabs.SelectedItem as NewPolicySnapshotTypePageSpecific; - if (snapshotTypePageSpecific != null) + var snapshotTypePage = verticalTabs.SelectedItem as NewPolicySnapshotTypePage; + if (snapshotTypePage != null) { newPolicyVMSSTypePage1.ToggleQuiesceCheckBox(newVMSSVMsPage1.SelectedVMs); return; } - var selectedPage = verticalTabs.SelectedItem as NewPolicyArchivePage; - if (selectedPage != null) - { - if (newPolicySnapshotFrequencyPage1.ValidToSave) - selectedPage.SetXenObjects(null, null); - return; - } - var vmApplianceStartOrderPage = verticalTabs.SelectedItem as NewVMApplianceVMOrderAndDelaysPage; if (vmApplianceStartOrderPage != null && newVMApplianceVMsPage1 != null) { @@ -570,11 +547,6 @@ namespace XenAdmin.Dialogs SelectPage(PerfmonAlertEditPage); } - public void SelectNewPolicyArchivePage() - { - SelectPage(newPolicyArchivePage1); - } - public void SelectStartupOptionsEditPage() { SelectPage(StartupOptionsEditPage); diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.Designer.cs b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.Designer.cs similarity index 97% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.Designer.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.Designer.cs index 8700c67c9..5e1d8b752 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.Designer.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.Designer.cs @@ -1,6 +1,6 @@ using XenAdmin.Controls.DataGridViewEx; -namespace XenAdmin.Dialogs.VMProtectionRecovery +namespace XenAdmin.Dialogs.ScheduledSnapshots { partial class PolicyHistory { diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.cs similarity index 90% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.cs index a2d2b36bf..bbb85c55b 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.cs @@ -30,22 +30,20 @@ */ using System; -using System.Windows.Forms; -using XenAdmin.Alerts; -using XenAPI; -using XenAdmin.Properties; -using System.ComponentModel; -using XenAdmin.Actions; using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using XenAdmin.Actions; +using XenAdmin.Alerts; +using XenAdmin.Controls; using XenAdmin.Core; +using XenAdmin.Properties; +using XenAPI; - -namespace XenAdmin.Dialogs.VMProtectionRecovery +namespace XenAdmin.Dialogs.ScheduledSnapshots { public partial class PolicyHistory : UserControl { - public Pool pool; - public PolicyHistory() { InitializeComponent(); @@ -71,7 +69,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery } } - private IVMPolicy _policy; + private VMSS _policy; public void StartRefreshTab() { /* hoursFromNow has 3 possible values: @@ -92,12 +90,12 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery break; } - PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow); + PureAsyncAction action = new GetVMSSAlertsAction(_policy, hoursFromNow); action.Completed += action_Completed; action.RunAsync(); } - public void RefreshTab(IVMPolicy policy) + public void RefreshTab(VMSS policy) { _policy = policy; if (_policy == null) @@ -202,14 +200,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery Program.Invoke(Program.MainWindow, () => { panelLoading.Visible = false; - if (_policy._Type == typeof(VMPP)) - { - RefreshGrid(((GetVMPPAlertsAction)(action)).VMPP.Alerts); - } - else - { - RefreshGrid(((GetVMSSAlertsAction)(action)).VMSS.Alerts); - } + RefreshGrid(((GetVMSSAlertsAction)(action)).VMSS.Alerts); }); } diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.ja.resx b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.ja.resx similarity index 100% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.ja.resx rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.ja.resx diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.resx b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.resx similarity index 100% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.resx rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.resx diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.zh-CN.resx b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.zh-CN.resx similarity index 100% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.zh-CN.resx rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.zh-CN.resx diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.Designer.cs b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.Designer.cs similarity index 95% rename from XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.Designer.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.Designer.cs index 0ede70b4b..635c20c8b 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.Designer.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.Designer.cs @@ -1,10 +1,9 @@ using XenAdmin.Controls.DataGridViewEx; using XenAdmin.Wizards.NewPolicyWizard; -using XenAPI; -namespace XenAdmin.Dialogs.VMProtection_Recovery +namespace XenAdmin.Dialogs.ScheduledSnapshots { - partial class VMProtectionPoliciesDialog + partial class ScheduledSnapshotsDialog { /// /// Required designer variable. @@ -32,7 +31,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VMProtectionPoliciesDialog)); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScheduledSnapshotsDialog)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.dataGridView1 = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); this.NameColum = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -48,7 +47,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery this.buttonRunNow = new System.Windows.Forms.Button(); this.labelPolicyTitle = new System.Windows.Forms.Label(); this.buttonProperties = new System.Windows.Forms.Button(); - this.policyHistory1 = new XenAdmin.Dialogs.VMProtectionRecovery.PolicyHistory(); + this.policyHistory1 = new PolicyHistory(); this.label2 = new System.Windows.Forms.Label(); this.localServerTime1 = new XenAdmin.Wizards.NewPolicyWizard.LocalServerTime(); this.chevronButton1 = new XenAdmin.Controls.ChevronButton(); @@ -245,13 +244,13 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery this.tableLayoutPanel5.Controls.Add(this.tableLayoutPanel4, 0, 3); this.tableLayoutPanel5.Name = "tableLayoutPanel5"; // - // VMProtectionPoliciesDialog + // ScheduledSnapshotsDialog // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.CancelButton = this.buttonCancel; this.Controls.Add(this.tableLayoutPanel5); - this.Name = "VMProtectionPoliciesDialog"; + this.Name = "ScheduledSnapshotsDialog"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Load += new System.EventHandler(this.VMProtectionPoliciesDialog_Load); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.VMProtectionPoliciesDialog_FormClosed); @@ -279,7 +278,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery protected System.Windows.Forms.Button buttonRunNow; protected System.Windows.Forms.Label labelPolicyTitle; protected System.Windows.Forms.Button buttonProperties; - protected XenAdmin.Dialogs.VMProtectionRecovery.PolicyHistory policyHistory1; + protected PolicyHistory policyHistory1; protected System.Windows.Forms.Label label2; protected LocalServerTime localServerTime1; protected XenAdmin.Controls.ChevronButton chevronButton1; diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.cs similarity index 59% rename from XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.cs index a8a385f0e..9a9d37271 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.cs @@ -32,28 +32,23 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using System.Windows.Forms; using XenAdmin.Actions; +using XenAdmin.Alerts; using XenAdmin.Controls; +using XenAdmin.Core; using XenAdmin.Wizards.NewPolicyWizard; using XenAPI; -using System.ComponentModel; -using System.Threading; -using System.Diagnostics; -using XenAdmin.Core; -using XenAdmin.Dialogs.VMProtectionRecovery; -using XenCenterLib; -using XenAdmin.Alerts; -using System.Linq; -namespace XenAdmin.Dialogs.VMProtection_Recovery +namespace XenAdmin.Dialogs.ScheduledSnapshots { - public partial class VMProtectionPoliciesDialog: XenDialogBase + public partial class ScheduledSnapshotsDialog: XenDialogBase { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public readonly Pool Pool; - public VMProtectionPoliciesDialog(Pool pool) + public ScheduledSnapshotsDialog(Pool pool) : base(pool.Connection) { Pool = pool; @@ -62,24 +57,10 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery chevronButton1.Text = Messages.SHOW_RUN_HISTORY; chevronButton1.Image = Properties.Resources.PDChevronDown; policyHistory1.Visible = false; - policyHistory1.pool = pool; - + RefreshPoolTitle(pool); } - public VMProtectionPoliciesDialog() { } - - protected virtual void chevronButton1_KeyDown(object sender, KeyEventArgs e) {} - protected virtual void chevronButton1_ButtonClick(object sender, EventArgs e) { } - protected virtual void buttonProperties_Click(object sender, EventArgs e) { } - protected virtual void button1_Click(object sender, EventArgs e) { } - protected virtual void buttonEnable_Click(object sender, EventArgs e) { } - protected virtual void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e) { } - protected virtual void dataGridView1_SelectionChanged(object sender, EventArgs e) { } - protected virtual void VMProtectionPoliciesDialog_Load(object sender, EventArgs e) { } - protected virtual void buttonCancel_Click(object sender, System.EventArgs e) { } - protected virtual void buttonNew_Click(object sender, System.EventArgs e) { } - protected virtual void buttonDelete_Click(object sender, EventArgs e) { } + public ScheduledSnapshotsDialog() { } - public class PolicyRow : DataGridViewRow { private DataGridViewTextBoxCell _name = new DataGridViewTextBoxCell(); @@ -88,8 +69,8 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery private DataGridViewTextBoxCell _status = new DataGridViewTextBoxCell(); private DataGridViewTextBoxCell _nextArchiveRuntime = new DataGridViewTextBoxCell(); private DataGridViewTextAndImageCell _lastResult = new DataGridViewTextAndImageCell(); - public readonly IVMPolicy _policy; - public PolicyRow(IVMPolicy policy) + public readonly VMSS _policy; + public PolicyRow(VMSS policy) { Cells.Add(_name); Cells.Add(_status); @@ -118,14 +99,9 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery { _name.Value = _policy.Name; _numVMs.Value = _policy.VMs.FindAll(vm => _policy.Connection.Resolve(vm).is_a_real_vm).Count; - _status.Value = _policy.is_enabled ? Messages.ENABLED : Messages.DISABLED; + _status.Value = _policy.enabled ? Messages.ENABLED : Messages.DISABLED; if (_policy.is_running) _status.Value = Messages.RUNNING_SNAPSHOTS; - if (this._policy.hasArchive) - { - if (_policy.is_archiving) - _status.Value = Messages.RUNNING_ARCHIVE; - } _lastResult.Value = _policy.LastResult; if (_policy.LastResult == Messages.FAILED) _lastResult.Image = Properties.Resources._075_WarningRound_h32bit_16; @@ -138,37 +114,10 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery _nextRunTime.Value = nextRunTime.HasValue ? HelpersGUI.DateTimeToString(nextRunTime.Value, Messages.DATEFORMAT_DMY_HM, true) - : Messages.VM_PROTECTION_POLICY_HOST_NOT_LIVE; - if (this._policy.hasArchive) - { - DateTime? nextArchiveRuntime = GetVMPPDateTime(() => _policy.GetNextArchiveRunTime()); - _nextArchiveRuntime.Value = nextArchiveRuntime.HasValue - ? nextArchiveRuntime == DateTime.MinValue - ? Messages.NEVER - : HelpersGUI.DateTimeToString(nextArchiveRuntime.Value, - Messages.DATEFORMAT_DMY_HM, true) - : Messages.VM_PROTECTION_POLICY_HOST_NOT_LIVE; - } - + : Messages.VMSS_HOST_NOT_LIVE; } } - } -} - -namespace XenAdmin.Dialogs.VMPolicies -{ - public class VMPoliciesDialogSpecific : XenAdmin.Dialogs.VMProtection_Recovery.VMProtectionPoliciesDialog where T : XenObject - { - public VMPoliciesDialogSpecific() { } - public VMPoliciesDialogSpecific(Pool pool) - : base(pool) - { - RefreshPoolTitle(pool); - if (VMGroup.isVMPolicyVMPP) - SetupDeprecationBanner(); - - } private void RefreshPoolTitle(Pool pool) { int protectedVMs = 0; @@ -179,19 +128,19 @@ namespace XenAdmin.Dialogs.VMPolicies if (vm.is_a_real_vm && vm.Show(Properties.Settings.Default.ShowHiddenVMs)) { realVMs++; - if (vm.Connection.Resolve(VMGroup.VmToGroup(vm)) != null) + if (vm.Connection.Resolve(vm.snapshot_schedule) != null) protectedVMs++; } } - this.Text = VMGroup.VMPolicyDialogTitle; - label2.Text = VMGroup.VMPolicyDialogText; + this.Text = Messages.VMSS_DIALOG_TITLE; + label2.Text = Messages.VMSS_DIALOG_TEXT; labelPolicyTitle.Text = string.Format(Helpers.IsPool(pool.Connection) - ? VMGroup.VMPolicyDialogSchedulesInPool - : VMGroup.VMPolicyDialogSchedulesInServer, + ? Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL + : Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER, pool.Name.Ellipsise(45), protectedVMs, realVMs); } - void VMPPCollectionChanged(object sender, EventArgs e) + void VMSSCollectionChanged(object sender, EventArgs e) { LoadPolicies(); } @@ -201,12 +150,12 @@ namespace XenAdmin.Dialogs.VMPolicies dataGridView1.SuspendLayout(); var selectedPolicy = currentSelected; dataGridView1.Rows.Clear(); - var policyList = VMGroup.VMPolicies(Pool.Connection.Cache); + var policyList = Pool.Connection.Cache.VMSSs; /* creating a dictionary to hold (policy_uuid, message list) */ Dictionary> policyMessage = new Dictionary>(); - + /* populate the dictionary with policy uuid */ foreach (var policy in policyList) @@ -215,43 +164,41 @@ namespace XenAdmin.Dialogs.VMPolicies List messageList = new List(); policyMessage.Add(policy.uuid, messageList); } - + /* iterate through all messages and populate the dictionary with message list */ + var messages = Pool.Connection.Cache.Messages; + List value = new List(); - if (!VMGroup.isVMPolicyVMPP) + foreach (var message in messages) { - var messages = Pool.Connection.Cache.Messages; - List value = new List(); - - foreach (var message in messages) + if (message.cls == cls.VMSS) { - if (message.cls == cls.VMSS) + if (policyMessage.TryGetValue(message.obj_uuid, out value)) { - if (policyMessage.TryGetValue(message.obj_uuid, out value)) - { - value.Add(message); - } - + value.Add(message); } } } /* add only 10 messages for each policy and referesh the rows*/ - + foreach (var policy in policyList) { /* message list need not be always sorted */ - var messageListSorted = policyMessage[policy.uuid].OrderByDescending(message => message.timestamp).ToList(); + var messageListSorted = + policyMessage[policy.uuid].OrderByDescending(message => message.timestamp).ToList(); for (int messageCount = 0; messageCount < 10 && messageCount < messageListSorted.Count; messageCount++) { - policy.PolicyAlerts.Add(new PolicyAlert(messageListSorted[messageCount].priority, messageListSorted[messageCount].name, messageListSorted[messageCount].timestamp, messageListSorted[messageCount].body, policy.Name)); + policy.PolicyAlerts.Add(new PolicyAlert(messageListSorted[messageCount].priority, + messageListSorted[messageCount].name, messageListSorted[messageCount].timestamp, + messageListSorted[messageCount].body, policy.Name)); } if (dataGridView1.ColumnCount > 0) dataGridView1.Rows.Add(new PolicyRow(policy)); } - RefreshButtons(); + RefreshButtons(); if (selectedPolicy != null) { foreach (PolicyRow row in dataGridView1.Rows) @@ -269,31 +216,28 @@ namespace XenAdmin.Dialogs.VMPolicies } - - protected override void buttonNew_Click(object sender, System.EventArgs e) + private void buttonNew_Click(object sender, System.EventArgs e) { - new NewPolicyWizardSpecific(Pool).Show(this); + new NewPolicyWizard(Pool).Show(this); } - protected override void buttonCancel_Click(object sender, System.EventArgs e) + private void buttonCancel_Click(object sender, System.EventArgs e) { this.Close(); } - protected override void VMProtectionPoliciesDialog_Load(object sender, EventArgs e) + private void VMProtectionPoliciesDialog_Load(object sender, EventArgs e) { - if (!VMGroup.isVMPolicyVMPP) - { - this.dataGridView1.Columns["ColumnNextArchive"].Visible = false; - } + this.dataGridView1.Columns["ColumnNextArchive"].Visible = false; + LoadPolicies(); localServerTime1.GetServerTime(); - Pool.Connection.Cache.RegisterBatchCollectionChanged(VMPPCollectionChanged); + Pool.Connection.Cache.RegisterBatchCollectionChanged(VMSSCollectionChanged); } - protected override void buttonDelete_Click(object sender, EventArgs e) + private void buttonDelete_Click(object sender, EventArgs e) { - var selectedPolicies = new List(); + var selectedPolicies = new List(); int numberOfProtectedVMs = 0; foreach (DataGridViewRow row in dataGridView1.SelectedRows) { @@ -313,18 +257,18 @@ namespace XenAdmin.Dialogs.VMPolicies } using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Warning, text, Messages.DELETE_VM_PROTECTION_TITLE), + new ThreeButtonDialog.Details(SystemIcons.Warning, text, Messages.DELETE_VMSS_TITLE), ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo)) { if (dlg.ShowDialog(this) == DialogResult.Yes) - new DestroyPolicyAction(Pool.Connection, selectedPolicies).RunAsync(); + new DestroyPolicyAction(Pool.Connection, selectedPolicies).RunAsync(); } } - private IVMPolicy currentSelected = null; + private VMSS currentSelected = null; - protected override void dataGridView1_SelectionChanged(object sender, EventArgs e) + private void dataGridView1_SelectionChanged(object sender, EventArgs e) { RefreshButtons(); } @@ -334,10 +278,10 @@ namespace XenAdmin.Dialogs.VMPolicies if (dataGridView1.SelectedRows.Count == 1) { currentSelected = ((PolicyRow)dataGridView1.SelectedRows[0])._policy; - buttonEnable.Text = currentSelected.is_enabled? Messages.DISABLE : Messages.ENABLE; - buttonEnable.Enabled = currentSelected.VMs.Count == 0 && !currentSelected.is_enabled? false : true; + buttonEnable.Text = currentSelected.enabled? Messages.DISABLE : Messages.ENABLE; + buttonEnable.Enabled = currentSelected.VMs.Count == 0 && !currentSelected.enabled? false : true; buttonProperties.Enabled = true; - buttonRunNow.Enabled = currentSelected.is_enabled && !currentSelected.is_archiving && !currentSelected.is_running; + buttonRunNow.Enabled = currentSelected.enabled && !currentSelected.is_running; } else @@ -351,26 +295,26 @@ namespace XenAdmin.Dialogs.VMPolicies buttonDelete.Enabled = (dataGridView1.SelectedRows.Count != 0); } - protected override void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e) + private void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e) { - Pool.Connection.Cache.DeregisterBatchCollectionChanged(VMPPCollectionChanged); + Pool.Connection.Cache.DeregisterBatchCollectionChanged(VMSSCollectionChanged); } - protected override void buttonEnable_Click(object sender, EventArgs e) + private void buttonEnable_Click(object sender, EventArgs e) { if (currentSelected != null) { - var action = new ChangePolicyEnabledAction(currentSelected); + var action = new ChangePolicyEnabledAction(currentSelected); action.RunAsync(); } } - - protected override void button1_Click(object sender, EventArgs e) + + private void button1_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { var policy = ((PolicyRow)dataGridView1.SelectedRows[0])._policy; - var action = new RunPolicyNowAction(policy); + var action = new RunPolicyNowAction(policy); action.Completed += action_Completed; buttonRunNow.Enabled = false; action.RunAsync(); @@ -382,28 +326,16 @@ namespace XenAdmin.Dialogs.VMPolicies Program.Invoke(Program.MainWindow, RefreshButtons); } - private void SetupDeprecationBanner() + private void buttonProperties_Click(object sender, EventArgs e) { - if (deprecationBanner != null && !Helpers.ClearwaterOrGreater(Pool.Connection)) - { - deprecationBanner.AppliesToVersion = Messages.XENSERVER_6_2; - deprecationBanner.BannerType = DeprecationBanner.Type.Removal; - deprecationBanner.FeatureName = Messages.VMPP; - deprecationBanner.LinkUri = HiddenFeatures.LinkLabelHidden ? null : new Uri(InvisibleMessages.VMPR_DEPRECATION_URL); - deprecationBanner.Visible = true; - } - } - - protected override void buttonProperties_Click(object sender, EventArgs e) - { - using (PropertiesDialog propertiesDialog = new PropertiesDialog((T)currentSelected)) + using (PropertiesDialog propertiesDialog = new PropertiesDialog((VMSS)currentSelected)) { propertiesDialog.ShowDialog(this); } } - protected override void chevronButton1_ButtonClick(object sender, EventArgs e) + private void chevronButton1_ButtonClick(object sender, EventArgs e) { if (chevronButton1.Text == Messages.HIDE_RUN_HISTORY) { @@ -419,7 +351,7 @@ namespace XenAdmin.Dialogs.VMPolicies } } - protected override void chevronButton1_KeyDown(object sender, KeyEventArgs e) + private void chevronButton1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space) chevronButton1_ButtonClick(sender, e); @@ -429,11 +361,7 @@ namespace XenAdmin.Dialogs.VMPolicies { get { - if (!VMGroup.isVMPolicyVMPP) - { - return "VMSnapshotSchedulesDialog"; - } - return "VMProtectionPoliciesDialog"; + return "VMSnapshotSchedulesDialog"; } } diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.ja.resx b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.ja.resx similarity index 97% rename from XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.ja.resx rename to XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.ja.resx index 25707fb9c..f71b53bfe 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.ja.resx +++ b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.ja.resx @@ -829,7 +829,7 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - VMProtectionPoliciesDialog + ScheduledSnapshotsDialog XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null diff --git a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.resx b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.resx similarity index 97% rename from XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.resx rename to XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.resx index 998ff97b7..203f616a4 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.resx +++ b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.resx @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - True - - - - NoControl - - - - 3, 75 - - - 129, 18 - - - 3 - - - 毎週アーカイブする(&K) - - - radioButtonArchiveWeekly - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 3 - - - True - - - Fill - - - NoControl - - - 0, 0 - - - 128, 18 - - - 2 - - - 毎日アーカイブする(&L) - - - radioButtonArchiveDaily - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolTipContainer1 - - - 1 - - - True - - - NoControl - - - 3, 27 - - - 129, 18 - - - 1 - - - 毎回アーカイブする(&V) - - - radioButtonArchiveASAP - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 1 - - - True - - - 3, 3 - - - 115, 18 - - - 0 - - - アーカイブしない(&O) - - - radioButtonDoNotArchive - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 0 - - - True - - - GrowAndShrink - - - 4 - - - Left - - - True - - - 3, 6 - - - 131, 17 - - - 0 - - - CIFS または NFS 共有(&I): - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 0 - - - Left, Right - - - 114, 4 - - - 394, 20 - - - 1 - - - textBoxPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 1 - - - False - - - 514, 3 - - - 75, 23 - - - 2 - - - テスト(&E) - - - buttonTest - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 2 - - - Left - - - Segoe UI, 9pt - - - NoControl - - - 595, 6 - - - 16, 16 - - - 11 - - - False - - - pictureBoxTest - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 3 - - - Left - - - True - - - False - - - NoControl - - - 6, 38 - - - 6, 3, 3, 3 - - - 212, 18 - - - 5 - - - 異なる資格情報を使用する (CIFS)(&C) - - - checkBoxCredentials - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 4 - - - Top, Left, Right - - - True - - - GrowAndShrink - - - 5 - - - Left - - - True - - - NoControl - - - 18, 4 - - - 75, 17 - - - 0 - - - ユーザー名(&U): - - - MiddleLeft - - - labelUser - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 0 - - - Fill - - - 99, 3 - - - 160, 19 - - - 1 - - - textBoxUser - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 1 - - - Left - - - True - - - NoControl - - - 265, 4 - - - 71, 17 - - - 2 - - - パスワード(&D): - - - MiddleLeft - - - labelPassword - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 2 - - - Fill - - - 342, 3 - - - * - - - 160, 19 - - - 3 - - - textBoxPassword - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 3 - - - False - - - 3, 62 - - - 1 - - - 505, 25 - - - 6 - - - m_tlpCredentials - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelUser" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxUser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelPassword" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="textBoxPassword" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /></Controls><Columns Styles="Absolute,15,AutoSize,0,Percent,50,AutoSize,0,Percent,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> - - - True - - - Fill - - - 140, 32 - - - 368, 1 - - - 12 - - - 失敗しました。アプリケーション ログ ファイルを参照してください。 - - - m_labelError - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpDestination - - - 6 - - - Fill - - - 3, 138 - - - 4 - - - 614, 90 - - - 4 - - - m_tlpDestination - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxPath" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonTest" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pictureBoxTest" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="checkBoxCredentials" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="m_tlpCredentials" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="m_labelError" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0,Absolute,22" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - GrowAndShrink - - - 3, 51 - - - 128, 18 - - - 2 - - - toolTipContainer1 - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel5 - - - 2 - - - Fill - - - 135, 0 - - - 0, 0, 0, 0 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 3 - - - 5 - - - 137, 96 - - - 0 - - - tableLayoutPanel5 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="radioButtonDoNotArchive" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveASAP" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="toolTipContainer1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveWeekly" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelDivider" Row="0" RowSpan="4" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - 2, 96 - - - 4 - - - labelDivider - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 4 - - - Left - - - True - - - NoControl - - - 3, 4 - - - 137, 17 - - - 0 - - - 時刻を指定する (毎日)(&R): - - - labelRecurDaily - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 0 - - - HH:mm - - - 146, 3 - - - 72, 20 - - - 1 - - - dateTimePickerDaily - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 1 - - - True - - - GrowAndShrink - - - True - - - GrowAndShrink - - - 2 - - - Left - - - True - - - NoControl - - - 3, 30 - - - 101, 17 - - - 2 - - - 時刻を指定する(&R): - - - labelRecurWeekly - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 2 - - - HH:mm - - - 146, 29 - - - 72, 20 - - - 3 - - - dateTimePickerWeekly - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 3 - - - True - - - NoControl - - - 3, 52 - - - 159, 17 - - - 4 - - - 曜日を指定する (複数選択可): - - - labelDays - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 4 - - - Fill - - - 146, 3 - - - 4 - - - 465, 96 - - - 1 - - - m_tlpRecur - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelRecurDaily" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerDaily" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelRecurWeekly" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerWeekly" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelDays" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="daysWeekCheckboxes1" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - Fill - - - 3, 72 - - - 400, 80 - - - 0, 75 - - - 459, 21 - - - 5 - - - daysWeekCheckboxes1 - - - XenAdmin.Wizards.NewPolicyWizard.DaysWeekCheckboxes, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 5 - - - True - - - GrowAndShrink - - - Fill - - - 4, 12 - - - 4, 3, 3, 3 - - - 613, 1 - - - 2 - - - localServerTime1 - - - XenAdmin.Wizards.NewPolicyWizard.LocalServerTime, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 2 - - - 1 - - - True - - - Fill - - - 3, 3 - - - 0, 0, 0, 3 - - - 614, 3 - - - 0 - - - スケジュールにより作成されたスナップショットが自動的にアーカイブされるように設定できます。この機能では、指定した CIFS または NFS 共有に各スナップショットが単一の XVA ファイルとしてエクスポートされます。 - - - autoHeightLabel1 - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 0 - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - アーカイブ スケジュール - - - 0, 0, 0, 0 - - - 3, 18 - - - 0, 14 - - - 614, 0 - - - 1 - - - False - - - sectionLabelSchedule - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 1 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 24 - - - 1 - - - 614, 102 - - - 2 - - - tableLayoutPanel4 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 3 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel5" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpRecur" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - アーカイブ先 - - - 0, 0, 0, 0 - - - 3, 132 - - - 0, 14 - - - 614, 0 - - - 3 - - - False - - - sectionLabelDest - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 4 - - - Fill - - - 0, 0 - - - 7 - - - 620, 411 - - - 0 - - - tableLayoutPanel2 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelSchedule" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="localServerTime1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelDest" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpDestination" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - True - - - 96, 96 - - - GrowAndShrink - - - 620, 411 - - - NewPolicyArchivePage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - \ No newline at end of file diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.resx deleted file mode 100644 index 1b0f246eb..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.resx +++ /dev/null @@ -1,1194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - True - - - - NoControl - - - - 3, 72 - - - 200, 17 - - - 3 - - - Archive scheduled snapshots wee&kly - - - radioButtonArchiveWeekly - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 3 - - - True - - - Fill - - - NoControl - - - 0, 0 - - - 188, 17 - - - 2 - - - Archive scheduled snapshots dai&ly - - - radioButtonArchiveDaily - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolTipContainer1 - - - 1 - - - True - - - NoControl - - - 3, 26 - - - 212, 17 - - - 1 - - - Archive after e&very scheduled snapshot - - - radioButtonArchiveASAP - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 1 - - - True - - - 3, 3 - - - 198, 17 - - - 0 - - - Do n&ot archive scheduled snapshots - - - radioButtonDoNotArchive - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 0 - - - True - - - GrowAndShrink - - - 4 - - - Left - - - True - - - 3, 8 - - - 98, 13 - - - 0 - - - C&IFS or NFS share: - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 0 - - - Left, Right - - - 107, 4 - - - 401, 20 - - - 1 - - - textBoxPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 1 - - - False - - - 514, 3 - - - 75, 23 - - - 2 - - - T&est - - - buttonTest - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 2 - - - Left - - - Segoe UI, 9pt - - - NoControl - - - 595, 6 - - - 16, 16 - - - 11 - - - False - - - pictureBoxTest - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 3 - - - Left - - - True - - - False - - - NoControl - - - 6, 45 - - - 6, 3, 3, 3 - - - 195, 17 - - - 5 - - - Use different user &credentials (CIFS) - - - checkBoxCredentials - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 4 - - - Top, Left, Right - - - True - - - GrowAndShrink - - - 5 - - - Left - - - True - - - NoControl - - - 18, 6 - - - 58, 13 - - - 0 - - - &Username: - - - MiddleLeft - - - labelUser - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 0 - - - Fill - - - 82, 3 - - - 176, 20 - - - 1 - - - textBoxUser - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 1 - - - Left - - - True - - - NoControl - - - 264, 6 - - - 56, 13 - - - 2 - - - Passwor&d: - - - MiddleLeft - - - labelPassword - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 2 - - - Fill - - - 326, 3 - - - * - - - 176, 20 - - - 3 - - - textBoxPassword - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 3 - - - False - - - 3, 68 - - - 1 - - - 505, 26 - - - 6 - - - m_tlpCredentials - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelUser" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxUser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelPassword" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="textBoxPassword" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /></Controls><Columns Styles="Absolute,15,AutoSize,0,Percent,50,AutoSize,0,Percent,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> - - - True - - - Fill - - - 107, 29 - - - 401, 13 - - - 12 - - - Test failed. See the application log file for more information. - - - m_labelError - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpDestination - - - 6 - - - Fill - - - 3, 271 - - - 4 - - - 614, 97 - - - 4 - - - m_tlpDestination - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxPath" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonTest" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pictureBoxTest" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="checkBoxCredentials" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="m_tlpCredentials" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="m_labelError" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0,Absolute,22" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - GrowAndShrink - - - 3, 49 - - - 188, 17 - - - 2 - - - toolTipContainer1 - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel5 - - - 2 - - - Fill - - - 218, 0 - - - 0, 0, 0, 0 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 3 - - - 5 - - - 220, 146 - - - 0 - - - tableLayoutPanel5 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="radioButtonDoNotArchive" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveASAP" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="toolTipContainer1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveWeekly" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelDivider" Row="0" RowSpan="4" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - 2, 92 - - - 4 - - - labelDivider - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 4 - - - Left - - - True - - - NoControl - - - 3, 6 - - - 141, 13 - - - 0 - - - &Recur every day at this time: - - - labelRecurDaily - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 0 - - - HH:mm - - - 150, 3 - - - 72, 20 - - - 1 - - - dateTimePickerDaily - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 1 - - - True - - - GrowAndShrink - - - True - - - GrowAndShrink - - - 2 - - - Left - - - True - - - NoControl - - - 3, 32 - - - 92, 13 - - - 2 - - - &Recur at this time: - - - labelRecurWeekly - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 2 - - - HH:mm - - - 150, 29 - - - 72, 20 - - - 3 - - - dateTimePickerWeekly - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 3 - - - True - - - NoControl - - - 3, 52 - - - 174, 13 - - - 4 - - - On these days (select one or more): - - - labelDays - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 4 - - - Fill - - - 229, 3 - - - 4 - - - 382, 146 - - - 1 - - - m_tlpRecur - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelRecurDaily" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerDaily" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelRecurWeekly" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerWeekly" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelDays" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="daysWeekCheckboxes1" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - Fill - - - 3, 68 - - - 400, 80 - - - 0, 75 - - - 376, 75 - - - 5 - - - daysWeekCheckboxes1 - - - XenAdmin.Wizards.NewPolicyWizard.DaysWeekCheckboxes, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 5 - - - True - - - GrowAndShrink - - - Fill - - - 4, 45 - - - 4, 3, 3, 3 - - - 613, 22 - - - 2 - - - localServerTime1 - - - XenAdmin.Wizards.NewPolicyWizard.LocalServerTime, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 2 - - - 1 - - - True - - - Fill - - - 3, 0 - - - 0, 0, 0, 3 - - - 614, 42 - - - 0 - - - Scheduled snapshots can be automatically archived according to the schedule specified below at the time as set on the pool's master server. A complete copy of each snapshot will be exported and saved as a single XVA file in the CIFS or NFS share archive destination specified. - - - autoHeightLabel1 - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 0 - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - Archive schedule - - - 0, 0, 0, 0 - - - 3, 73 - - - 0, 14 - - - 614, 14 - - - 1 - - - False - - - sectionLabelSchedule - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 1 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 93 - - - 1 - - - 614, 152 - - - 2 - - - tableLayoutPanel4 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 3 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel5" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpRecur" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - Archive destination - - - 0, 0, 0, 0 - - - 3, 251 - - - 0, 14 - - - 614, 14 - - - 3 - - - False - - - sectionLabelDest - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 4 - - - Fill - - - 0, 0 - - - 7 - - - 620, 411 - - - 0 - - - tableLayoutPanel2 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelSchedule" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="localServerTime1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelDest" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpDestination" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - True - - - 96, 96 - - - GrowAndShrink - - - 620, 411 - - - NewPolicyArchivePage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - \ No newline at end of file diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.zh-CN.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.zh-CN.resx deleted file mode 100644 index c6885d72e..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.zh-CN.resx +++ /dev/null @@ -1,1194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - True - - - - NoControl - - - - 3, 72 - - - 200, 17 - - - 3 - - - 每周存档计划快照(&K) - - - radioButtonArchiveWeekly - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 3 - - - True - - - Fill - - - NoControl - - - 0, 0 - - - 188, 17 - - - 2 - - - 每天存档计划快照(&L) - - - radioButtonArchiveDaily - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolTipContainer1 - - - 1 - - - True - - - NoControl - - - 3, 26 - - - 212, 17 - - - 1 - - - 在生成每个计划快照后存档(&V) - - - radioButtonArchiveASAP - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 1 - - - True - - - 3, 3 - - - 198, 17 - - - 0 - - - 不存档计划快照(&O) - - - radioButtonDoNotArchive - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 0 - - - True - - - GrowAndShrink - - - 4 - - - Left - - - True - - - 3, 8 - - - 98, 13 - - - 0 - - - CIFS 或 NFS 共享(&I): - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 0 - - - Left, Right - - - 107, 4 - - - 401, 20 - - - 1 - - - textBoxPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 1 - - - False - - - 514, 3 - - - 75, 23 - - - 2 - - - 测试(&E) - - - buttonTest - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 2 - - - Left - - - Segoe UI, 9pt - - - NoControl - - - 595, 6 - - - 16, 16 - - - 11 - - - False - - - pictureBoxTest - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 3 - - - Left - - - True - - - False - - - NoControl - - - 6, 45 - - - 6, 3, 3, 3 - - - 195, 17 - - - 5 - - - 使用其他用户凭据(CIFS)(&C) - - - checkBoxCredentials - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 4 - - - Top, Left, Right - - - True - - - GrowAndShrink - - - 5 - - - Left - - - True - - - NoControl - - - 18, 6 - - - 61, 13 - - - 0 - - - 用户名(&U): - - - MiddleLeft - - - labelUser - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 0 - - - Fill - - - 85, 3 - - - 174, 20 - - - 1 - - - textBoxUser - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 1 - - - Left - - - True - - - NoControl - - - 265, 6 - - - 56, 13 - - - 2 - - - 密码(&D): - - - MiddleLeft - - - labelPassword - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 2 - - - Fill - - - 327, 3 - - - * - - - 175, 20 - - - 3 - - - textBoxPassword - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpCredentials - - - 3 - - - False - - - 3, 68 - - - 1 - - - 505, 26 - - - 6 - - - m_tlpCredentials - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpDestination - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelUser" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxUser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelPassword" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="textBoxPassword" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /></Controls><Columns Styles="Absolute,15,AutoSize,0,Percent,50,AutoSize,0,Percent,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> - - - True - - - Fill - - - 107, 29 - - - 401, 13 - - - 12 - - - 测试失败。有关详细信息,请参阅应用程序日志文件。 - - - m_labelError - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpDestination - - - 6 - - - Fill - - - 3, 267 - - - 4 - - - 614, 97 - - - 4 - - - m_tlpDestination - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxPath" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonTest" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pictureBoxTest" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="checkBoxCredentials" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="m_tlpCredentials" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="m_labelError" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0,Absolute,22" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - GrowAndShrink - - - 3, 49 - - - 188, 17 - - - 2 - - - toolTipContainer1 - - - XenAdmin.Controls.ToolTipContainer, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel5 - - - 2 - - - Fill - - - 218, 0 - - - 0, 0, 0, 0 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 3 - - - 5 - - - 220, 146 - - - 0 - - - tableLayoutPanel5 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="radioButtonDoNotArchive" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveASAP" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="toolTipContainer1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonArchiveWeekly" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelDivider" Row="0" RowSpan="4" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - 2, 92 - - - 4 - - - labelDivider - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel5 - - - 4 - - - Left - - - True - - - NoControl - - - 3, 6 - - - 141, 13 - - - 0 - - - 每天在此时间重复发生(&R): - - - labelRecurDaily - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 0 - - - HH:mm - - - 150, 3 - - - 72, 20 - - - 1 - - - dateTimePickerDaily - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 1 - - - True - - - GrowAndShrink - - - True - - - GrowAndShrink - - - 2 - - - Left - - - True - - - NoControl - - - 3, 32 - - - 92, 13 - - - 2 - - - 在此时间重复发生(&R): - - - labelRecurWeekly - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 2 - - - HH:mm - - - 150, 29 - - - 72, 20 - - - 3 - - - dateTimePickerWeekly - - - XenAdmin.Controls.DateTimeMinutes15, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 3 - - - True - - - NoControl - - - 3, 52 - - - 174, 13 - - - 4 - - - 在以下日期(选择一项或多项): - - - labelDays - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - m_tlpRecur - - - 4 - - - Fill - - - 229, 3 - - - 4 - - - 382, 146 - - - 1 - - - m_tlpRecur - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel4 - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelRecurDaily" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerDaily" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelRecurWeekly" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dateTimePickerWeekly" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelDays" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="daysWeekCheckboxes1" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - Fill - - - 3, 68 - - - 400, 80 - - - 0, 75 - - - 376, 75 - - - 5 - - - daysWeekCheckboxes1 - - - XenAdmin.Wizards.NewPolicyWizard.DaysWeekCheckboxes, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - m_tlpRecur - - - 5 - - - True - - - GrowAndShrink - - - Fill - - - 4, 45 - - - 4, 3, 3, 3 - - - 613, 18 - - - 2 - - - localServerTime1 - - - XenAdmin.Wizards.NewPolicyWizard.LocalServerTime, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 2 - - - 1 - - - True - - - Fill - - - 3, 0 - - - 0, 0, 0, 3 - - - 614, 42 - - - 0 - - - 计划快照可以根据下面指定的时间表在池主服务器上设定的时间自动存档。将导出每个快照的完整副本,并以单个 XVA 文件的形式保存在指定的 CIFS 或 NFS 共享存档目标位置中。 - - - autoHeightLabel1 - - - XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 0 - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - 存档计划 - - - 0, 0, 0, 0 - - - 3, 69 - - - 0, 14 - - - 614, 14 - - - 1 - - - False - - - sectionLabelSchedule - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 1 - - - True - - - GrowAndShrink - - - 2 - - - Fill - - - 3, 89 - - - 1 - - - 614, 152 - - - 2 - - - tableLayoutPanel4 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel2 - - - 3 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel5" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpRecur" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - True - - - Top - - - - - - Left - - - 0, 0, 0, 0 - - - 存档目标 - - - 0, 0, 0, 0 - - - 3, 247 - - - 0, 14 - - - 614, 14 - - - 3 - - - False - - - sectionLabelDest - - - XenAdmin.Controls.SectionHeaderLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel2 - - - 4 - - - Fill - - - 0, 0 - - - 7 - - - 620, 411 - - - 0 - - - tableLayoutPanel2 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelSchedule" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="localServerTime1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="sectionLabelDest" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_tlpDestination" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - True - - - 96, 96 - - - GrowAndShrink - - - 620, 411 - - - NewPolicyArchivePage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - \ No newline at end of file diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.Designer.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.Designer.cs deleted file mode 100644 index 62aba0ea0..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.Designer.cs +++ /dev/null @@ -1,169 +0,0 @@ -namespace XenAdmin.Wizards.NewPolicyWizard -{ - partial class NewPolicyEmailPage - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewPolicyEmailPage)); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.textBoxEmailAddress = new System.Windows.Forms.TextBox(); - this.textBoxSMTP = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.textBoxPort = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.errorPanel = new System.Windows.Forms.Panel(); - this.errorMessageLabel = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.groupBox1.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); - this.errorPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // groupBox1 - // - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Controls.Add(this.tableLayoutPanel1); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // - // tableLayoutPanel1 - // - resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.label3, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.textBoxEmailAddress, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.textBoxSMTP, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.label4, 2, 1); - this.tableLayoutPanel1.Controls.Add(this.textBoxPort, 3, 1); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; - // - // textBoxEmailAddress - // - this.tableLayoutPanel1.SetColumnSpan(this.textBoxEmailAddress, 3); - resources.ApplyResources(this.textBoxEmailAddress, "textBoxEmailAddress"); - this.textBoxEmailAddress.Name = "textBoxEmailAddress"; - // - // textBoxSMTP - // - resources.ApplyResources(this.textBoxSMTP, "textBoxSMTP"); - this.textBoxSMTP.Name = "textBoxSMTP"; - // - // label4 - // - resources.ApplyResources(this.label4, "label4"); - this.label4.Name = "label4"; - // - // textBoxPort - // - resources.ApplyResources(this.textBoxPort, "textBoxPort"); - this.textBoxPort.Name = "textBoxPort"; - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // checkBox1 - // - resources.ApplyResources(this.checkBox1, "checkBox1"); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.UseVisualStyleBackColor = true; - this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); - // - // errorPanel - // - this.errorPanel.Controls.Add(this.errorMessageLabel); - this.errorPanel.Controls.Add(this.pictureBox1); - resources.ApplyResources(this.errorPanel, "errorPanel"); - this.errorPanel.Name = "errorPanel"; - // - // errorMessageLabel - // - resources.ApplyResources(this.errorMessageLabel, "errorMessageLabel"); - this.errorMessageLabel.ForeColor = System.Drawing.Color.Red; - this.errorMessageLabel.Name = "errorMessageLabel"; - // - // pictureBox1 - // - this.pictureBox1.ErrorImage = null; - this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16; - resources.ApplyResources(this.pictureBox1, "pictureBox1"); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.TabStop = false; - // - // NewPolicyEmailPage - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.Controls.Add(this.errorPanel); - this.Controls.Add(this.checkBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.groupBox1); - this.Name = "NewPolicyEmailPage"; - this.groupBox1.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.errorPanel.ResumeLayout(false); - this.errorPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.CheckBox checkBox1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox textBoxEmailAddress; - private System.Windows.Forms.TextBox textBoxSMTP; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBoxPort; - private System.Windows.Forms.Panel errorPanel; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label errorMessageLabel; - } -} diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.cs deleted file mode 100644 index 3d54abed3..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.cs +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using XenAdmin.Actions; -using XenAdmin.Alerts; -using XenAdmin.Controls; -using XenAdmin.Core; -using XenAdmin.Dialogs; -using XenAdmin.SettingsPanels; -using XenAPI; -using XenCenterLib; - -namespace XenAdmin.Wizards.NewPolicyWizard -{ - public partial class NewPolicyEmailPage : XenTabPage, IEditPage - { - readonly EmailAddressValidator emailAddressValidator = new EmailAddressValidator(); - - public NewPolicyEmailPage() - { - InitializeComponent(); - textBoxPort.Text = 25.ToString(); - RegisterEvents(); - } - - private void RegisterEvents() - { - textBoxEmailAddress.LostFocus += UpdatePageAndEnableOK_EventHandler; - textBoxEmailAddress.TextChanged += UpdatePageAndEnableOKWhileInError_EventHandler; - - textBoxPort.TextChanged += UpdatePageAndEnableOK_EventHandler; - textBoxSMTP.TextChanged += UpdatePageAndEnableOK_EventHandler; - } - - private Pool _pool; - public Pool Pool - { - get { return _pool; } - set - { - _pool = value; - if (value != null) - { - var options = PerfmonOptionsDefinition.GetPerfmonOptionsDefinitions(_pool); - if (options != null) - { - textBoxSMTP.Text = PerfmonOptionsDefinition.GetSmtpServerAddress(options.MailHub); - textBoxPort.Text = PerfmonOptionsDefinition.GetSmtpPort(options.MailHub); - textBoxEmailAddress.Text = options.MailDestination; - } - } - } - } - - - public override string Text - { - get { return Messages.EMAIL_ALERTS; } - } - - public string SubText - { - get { return EmailEnabled ? Messages.ENABLED : Messages.DISABLED; } - } - - public override string HelpID - { - get { return "Emailalerts"; } - } - - public Image Image - { - get { return Properties.Resources._000_Email_h32bit_16; } - } - - public override string PageTitle - { - get - { - return Messages.EMAIL_ALERTS_TITLE; - } - } - - public Dictionary EmailSettings - { - get - { - var result = new Dictionary(); - if (checkBox1.Checked) - { - result.Add("email_address", textBoxEmailAddress.Text); - result.Add("smtp_server", textBoxSMTP.Text); - result.Add("smtp_port", textBoxPort.Text); - } - return result; - } - } - - public bool EmailEnabled - { - get { return checkBox1.Checked; } - } - - private void checkBox1_CheckedChanged(object sender, System.EventArgs e) - { - groupBox1.Enabled = checkBox1.Checked; - OnPageUpdated(); - EnableOkButton(); - } - - private void RefreshTab(VMPP vmpp) - { - checkBox1.Checked = vmpp.is_alarm_enabled; - if (vmpp.is_alarm_enabled) - { - textBoxSMTP.Text = vmpp.alarm_config_smtp_server; - textBoxPort.Text = vmpp.alarm_config_smtp_port; - textBoxEmailAddress.Text = vmpp.alarm_config_email_address; - } - } - - - private void EnableOkButton() - { - if (PropertiesDialog != null) - PropertiesDialog.okButton.Enabled = EnableNext(); - } - - public PropertiesDialog PropertiesDialog { private get; set; } - - public AsyncAction SaveSettings() - { - _clone.is_alarm_enabled = EmailEnabled; - _clone.alarm_config = EmailSettings; - return null; - } - - private VMPP _clone; - public void SetXenObjects(IXenObject orig, IXenObject clone) - { - _clone = (VMPP)clone; - Pool = Helpers.GetPoolOfOne(_clone.Connection); - RefreshTab(_clone); - } - - /// - /// Set the visibilty of the error warning message panel (picture and text) - /// - private bool ErrorWarningMessageIsVisible - { - set { errorPanel.Visible = value; } - get { return errorPanel.Visible; } - } - - public override bool EnableNext() - { - - ErrorWarningMessageIsVisible = false; - - //Display the email error warning? - - - if (checkBox1.Checked && !string.IsNullOrEmpty(textBoxEmailAddress.Text) && - !emailAddressValidator.IsValid(textBoxEmailAddress.Text)) - { - ErrorWarningMessageIsVisible = true; - return false; - } - - //Check all required boxes have text - if (checkBox1.Checked && - (string.IsNullOrEmpty(textBoxEmailAddress.Text) || string.IsNullOrEmpty(textBoxSMTP.Text) || string.IsNullOrEmpty(textBoxPort.Text))) - return false; - - return true; - - } - - public bool ValidToSave - { - get { return EnableNext(); } - } - - public void ShowLocalValidationMessages() - { - } - - public void Cleanup() - { - checkBox1.Checked = false; - } - - public bool HasChanged - { - get - { - if (EmailEnabled != _clone.is_alarm_enabled) - return true; - if (!Helper.AreEqual2(_clone.alarm_config, EmailSettings)) - return true; - return false; - } - } - - private void UpdatePageAndEnableOK_EventHandler(object sender, EventArgs e) - { - UpdatePageAndEnableOK(); - } - - private void UpdatePageAndEnableOKWhileInError_EventHandler(object sender, EventArgs e) - { - if (!ErrorWarningMessageIsVisible) - return; - - UpdatePageAndEnableOK(); - } - - private void UpdatePageAndEnableOK() - { - OnPageUpdated(); - EnableOkButton(); - } - } - - -} diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.ja.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.ja.resx deleted file mode 100644 index 36de36de0..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.ja.resx +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Top, Left, Right - - - - 4 - - - True - - - Fill - - - - 3, 6 - - - 3, 6, 3, 0 - - - 99, 23 - - - 1 - - - メール アドレス(&M): - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 0 - - - True - - - Fill - - - 3, 35 - - - 3, 6, 3, 0 - - - 99, 23 - - - 2 - - - SMTP サーバー(&S): - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 1 - - - Fill - - - 108, 3 - - - 343, 19 - - - 1 - - - textBoxEmailAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 2 - - - Fill - - - 108, 32 - - - 210, 19 - - - 2 - - - textBoxSMTP - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 3 - - - True - - - Fill - - - 324, 35 - - - 3, 6, 3, 0 - - - 63, 23 - - - 3 - - - ポート(&O): - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 4 - - - 393, 32 - - - 58, 19 - - - 3 - - - textBoxPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 5 - - - Fill - - - 6, 18 - - - 2 - - - 454, 58 - - - 0 - - - tableLayoutPanel1 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" /><Rows Styles="Percent,50,Percent,50,Absolute,20" /></TableLayoutSettings> - - - False - - - 25, 87 - - - 3, 7, 3, 3 - - - 6, 6, 6, 6 - - - 466, 82 - - - 0 - - - 送信先 - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top - - - 0, 0 - - - 494, 57 - - - 1 - - - [XenServer] での VM 保護ジョブに関するアラート (VM スナップショットが作成またはアーカイブされた場合や、スナップショットまたはアーカイブが失敗した場合など) が生成されたときに、通知メールが送信されるように設定できます。 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 3, 60 - - - 249, 18 - - - 0 - - - VM 保護ジョブのアラートをメールで送信する(&E) - - - checkBox1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 24, 3 - - - 252, 17 - - - 1 - - - 入力したメール アドレスの書式が無効です - - - errorMessageLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 0 - - - 3, 3 - - - 18, 19 - - - 0 - - - pictureBox1 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 1 - - - 25, 176 - - - 466, 25 - - - 2 - - - False - - - errorPanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 96, 96 - - - 494, 301 - - - NewPolicyEmailPage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.resx deleted file mode 100644 index 5995c71a9..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.resx +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Top, Left, Right - - - - 4 - - - True - - - Fill - - - - 3, 6 - - - 3, 6, 3, 0 - - - 96, 22 - - - 1 - - - E&mail address: - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 0 - - - True - - - Fill - - - 3, 34 - - - 3, 6, 3, 0 - - - 96, 23 - - - 2 - - - &SMTP server: - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 1 - - - Fill - - - 105, 3 - - - 346, 20 - - - 1 - - - textBoxEmailAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 2 - - - Fill - - - 105, 31 - - - 235, 20 - - - 2 - - - textBoxSMTP - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 3 - - - True - - - Fill - - - 346, 34 - - - 3, 6, 3, 0 - - - 41, 23 - - - 3 - - - P&ort: - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 4 - - - 393, 31 - - - 58, 20 - - - 3 - - - textBoxPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 5 - - - Fill - - - 6, 19 - - - 2 - - - 454, 57 - - - 0 - - - tableLayoutPanel1 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" /><Rows Styles="Percent,50,Percent,50,Absolute,20" /></TableLayoutSettings> - - - False - - - 25, 87 - - - 3, 7, 3, 3 - - - 6, 6, 6, 6 - - - 466, 82 - - - 0 - - - Delivery address - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top - - - 0, 0 - - - 494, 57 - - - 1 - - - [XenServer] can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails. - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 3, 60 - - - 281, 17 - - - 0 - - - Send &email notifications about VM protection job alerts - - - checkBox1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 24, 3 - - - 232, 13 - - - 1 - - - The email address entered has an invalid format - - - errorMessageLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 0 - - - 3, 3 - - - 18, 19 - - - 0 - - - pictureBox1 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 1 - - - 25, 176 - - - 466, 25 - - - 2 - - - False - - - errorPanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 96, 96 - - - 494, 301 - - - NewPolicyEmailPage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.zh-CN.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.zh-CN.resx deleted file mode 100644 index 192fce503..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.zh-CN.resx +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Top, Left, Right - - - - 4 - - - True - - - Fill - - - - 3, 6 - - - 3, 6, 3, 0 - - - 76, 22 - - - 1 - - - 电子邮件地址(&M): - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 0 - - - True - - - Fill - - - 3, 34 - - - 3, 6, 3, 0 - - - 76, 23 - - - 2 - - - SMTP 服务器(&S): - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 1 - - - Fill - - - 85, 3 - - - 366, 20 - - - 1 - - - textBoxEmailAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 2 - - - Fill - - - 85, 31 - - - 235, 20 - - - 2 - - - textBoxSMTP - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 3 - - - True - - - Fill - - - 326, 34 - - - 3, 6, 3, 0 - - - 41, 43 - - - 3 - - - 端口(&O): - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 4 - - - 393, 31 - - - 58, 20 - - - 3 - - - textBoxPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 5 - - - Fill - - - 6, 19 - - - 2 - - - 454, 57 - - - 0 - - - tableLayoutPanel1 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" /><Rows Styles="Percent,50,Percent,50,Absolute,20" /></TableLayoutSettings> - - - False - - - 25, 87 - - - 3, 7, 3, 3 - - - 6, 6, 6, 6 - - - 466, 82 - - - 0 - - - 收件人地址 - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top - - - 0, 0 - - - 494, 57 - - - 1 - - - 在产生与 VM 保护作业相关联的警报时(例如创建或存档 VM 快照时或者快照生成或存档操作失败时),[XenServer] 可以向您发送电子邮件通知。 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 3, 60 - - - 281, 17 - - - 0 - - - 发送有关 VM 保护作业警报的电子邮件通知(&E) - - - checkBox1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 24, 3 - - - 252, 17 - - - 1 - - - 输入的电子邮件地址格式不正确 - - - errorMessageLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 0 - - - 3, 3 - - - 18, 19 - - - 0 - - - pictureBox1 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - errorPanel - - - 1 - - - 25, 176 - - - 466, 25 - - - 2 - - - False - - - errorPanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 96, 96 - - - 494, 301 - - - NewPolicyEmailPage - - - XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyPolicyNamePage.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyPolicyNamePage.cs index 8988612fc..652787ac8 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyPolicyNamePage.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyPolicyNamePage.cs @@ -29,18 +29,13 @@ * SUCH DAMAGE. */ -using System; using System.Drawing; -using System.Windows.Forms; -using XenAdmin.Actions; using XenAdmin.Controls; using XenAdmin.Properties; -using XenAdmin.SettingsPanels; -using XenAPI; namespace XenAdmin.Wizards.NewPolicyWizard { - public partial class NewPolicyPolicyNamePage : XenTabPage, IEditPage + public partial class NewPolicyPolicyNamePage : XenTabPage { private readonly string _tabName; private readonly string _tabTitle; @@ -104,42 +99,5 @@ namespace XenAdmin.Wizards.NewPolicyWizard { OnPageUpdated(); } - - private void RefreshTab(VMPP vmpp) - { - textBoxName.Text = vmpp.Name; - textBoxDescription.Text = vmpp.Description; - labelwizard.Visible = false; - } - - public AsyncAction SaveSettings() - { - return null; - } - - public void SetXenObjects(IXenObject orig, IXenObject clone) - { - RefreshTab((VMPP) orig); - } - - public bool ValidToSave - { - get { return false; } - } - - public void ShowLocalValidationMessages() - { - - } - - public void Cleanup() - { - - } - - public bool HasChanged - { - get { return false; } - } } } diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotFrequencyPage.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotFrequencyPage.cs index a92b05528..417576470 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotFrequencyPage.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotFrequencyPage.cs @@ -71,7 +71,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard public string SubText { - get { return NewPolicyWizardSpecific.FormatSchedule(Schedule, Frequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); } + get { return NewPolicyWizard.FormatSchedule(Schedule, Frequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); } } public Image Image @@ -100,14 +100,14 @@ namespace XenAdmin.Wizards.NewPolicyWizard { var result = new Dictionary(); - if (Frequency == policy_frequency.hourly) + if (Frequency == vmss_frequency.hourly) result.Add("min", comboBoxMin.SelectedItem.ToString()); - else if (Frequency == policy_frequency.daily) + else if (Frequency == vmss_frequency.daily) { result.Add("hour", dateTimePickerDaily.Value.Hour.ToString()); result.Add("min", dateTimePickerDaily.Value.Minute.ToString()); } - else if (Frequency == policy_frequency.weekly) + else if (Frequency == vmss_frequency.weekly) { result.Add("hour", dateTimePickerWeekly.Value.Hour.ToString()); result.Add("min", dateTimePickerWeekly.Value.Minute.ToString()); @@ -118,13 +118,13 @@ namespace XenAdmin.Wizards.NewPolicyWizard } } - public policy_frequency Frequency + public vmss_frequency Frequency { get { - if (radioButtonHourly.Checked) return policy_frequency.hourly; - else if (radioButtonDaily.Checked) return policy_frequency.daily; - else if (radioButtonWeekly.Checked) return policy_frequency.weekly; + if (radioButtonHourly.Checked) return vmss_frequency.hourly; + else if (radioButtonDaily.Checked) return vmss_frequency.daily; + else if (radioButtonWeekly.Checked) return vmss_frequency.weekly; throw new ArgumentException("Wrong value"); } @@ -165,7 +165,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard OnPageUpdated(); } - private void RefreshTab(IVMPolicy policy) + private void RefreshTab(VMSS policy) { if (ParentForm != null) { @@ -177,18 +177,18 @@ namespace XenAdmin.Wizards.NewPolicyWizard sectionLabelSchedule.LineColor = sectionLabelNumber.LineColor = SystemColors.ActiveBorder; } - switch (policy.policy_frequency) + switch (policy.frequency) { - case policy_frequency.hourly: + case vmss_frequency.hourly: radioButtonHourly.Checked = true; SetHourlyMinutes(Convert.ToDecimal(policy.backup_schedule_min)); break; - case policy_frequency.daily: + case vmss_frequency.daily: radioButtonDaily.Checked = true; dateTimePickerDaily.Value = new DateTime(1970, 1, 1, Convert.ToInt32(policy.backup_schedule_hour), Convert.ToInt32(policy.backup_schedule_min), 0); break; - case policy_frequency.weekly: + case vmss_frequency.weekly: radioButtonWeekly.Checked = true; dateTimePickerWeekly.Value = new DateTime(1970, 1, 1, Convert.ToInt32(policy.backup_schedule_hour), Convert.ToInt32(policy.backup_schedule_min), 0); @@ -196,7 +196,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard break; } - numericUpDownRetention.Value = policy.policy_retention; + numericUpDownRetention.Value = policy.retained_snapshots; } private void SetHourlyMinutes(decimal min) @@ -224,17 +224,17 @@ namespace XenAdmin.Wizards.NewPolicyWizard public AsyncAction SaveSettings() { - _policyCopy.policy_frequency = Frequency; - _policyCopy.policy_schedule = Schedule; - _policyCopy.policy_retention = BackupRetention; + _policyCopy.frequency = Frequency; + _policyCopy.schedule = Schedule; + _policyCopy.retained_snapshots = BackupRetention; return null; } - private IVMPolicy _policyCopy; + private VMSS _policyCopy; public void SetXenObjects(IXenObject orig, IXenObject clone) { - _policyCopy = (IVMPolicy)clone; + _policyCopy = (VMSS)clone; RefreshTab(_policyCopy); } @@ -242,9 +242,9 @@ namespace XenAdmin.Wizards.NewPolicyWizard { get { - _policyCopy.policy_frequency = Frequency; - _policyCopy.policy_schedule = Schedule; - _policyCopy.policy_retention = BackupRetention; + _policyCopy.frequency = Frequency; + _policyCopy.schedule = Schedule; + _policyCopy.retained_snapshots = BackupRetention; return true; } } @@ -261,11 +261,11 @@ namespace XenAdmin.Wizards.NewPolicyWizard { get { - if (!Helper.AreEqual2(_policyCopy.policy_frequency, Frequency)) + if (!Helper.AreEqual2(_policyCopy.frequency, Frequency)) return true; - if (!Helper.AreEqual2(_policyCopy.policy_schedule, Schedule)) + if (!Helper.AreEqual2(_policyCopy.schedule, Schedule)) return true; - if (!Helper.AreEqual2(_policyCopy.policy_retention, BackupRetention)) + if (!Helper.AreEqual2(_policyCopy.retained_snapshots, BackupRetention)) return true; return false; diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePage.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePage.cs index 1a6959448..0a48e04d9 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePage.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePage.cs @@ -41,16 +41,7 @@ using XenAPI; namespace XenAdmin.Wizards.NewPolicyWizard { - // This class acts as the base class for NewPolicySnapshotTypePageSpecific. It's only here - // because of a bug in Visual Studio: the Designer can't design classes of a - // generic class. The workaround is to do the design in this non-generic class, - // and then inherit the generic class from it. See - // http://stackoverflow.com/questions/1627431/fix-embedded-resources-for-generic-usercontrol - // http://bytes.com/topic/c-sharp/answers/537310-can-you-have-generic-type-windows-form - // http://connect.microsoft.com/VisualStudio/feedback/details/115397/component-resource-manager-doesnt-work-with-generic-form-classes - // (or search on Google for [ComponentResourceManager generic]). - - public abstract partial class NewPolicySnapshotTypePage : XenTabPage, IEditPage + public partial class NewPolicySnapshotTypePage : XenTabPage, IEditPage { protected List _selectedVMs; public List SelectedVMs @@ -61,32 +52,245 @@ namespace XenAdmin.Wizards.NewPolicyWizard _selectedVMs = value; } } - - public abstract AsyncAction SaveSettings(); - public abstract string SubText { get; } - public abstract bool HasChanged { get; } - public abstract void SetXenObjects(IXenObject orig, IXenObject clone); - public abstract Image Image { get; } - public abstract bool ValidToSave { get; } - public abstract void ShowLocalValidationMessages(); - public abstract void Cleanup(); - public abstract void checkpointInfoPictureBox_Click(object sender, System.EventArgs e); - public abstract void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e); - public abstract void pictureBoxVSS_Click(object sender, System.EventArgs e); - public abstract void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e); - public abstract void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e); - public abstract void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e); - + public NewPolicySnapshotTypePage() { InitializeComponent(); + this.labelWarning.Text = string.Format(this.labelWarning.Text, Messages.VMSS_TYPE); } - public NewPolicySnapshotTypePage(List selectedVMS) + public string SubText { - InitializeComponent(); - SelectedVMs = selectedVMS; + get + { + if (BackupType == vmss_type.snapshot) + return Messages.DISKS_ONLY; + else if (BackupType == vmss_type.snapshot_with_quiesce) + return Messages.QUIESCED_SNAPSHOTS; + else + return Messages.DISKS_AND_MEMORY; + } + } + public override string HelpID + { + get { return "Snapshottype"; } + } + + public override string PageTitle + { + get + { + return Messages.SNAPSHOT_TYPE_TITLE; + } + } + public override string Text + { + get + { + return Messages.SNAPSHOT_TYPE; + } + } + + public override void PageLoaded(PageLoadedDirection direction) + { + base.PageLoaded(direction); + if (direction == PageLoadedDirection.Forward) + EnableShapshotTypes(Connection, false); + } + + public Image Image + { + get { return Properties.Resources._000_VMSession_h32bit_16; } + } + + public bool ValidToSave + { + get { return true; } + } + + public void ShowLocalValidationMessages() + { + + } + + public void Cleanup() + { + radioButtonDiskOnly.Checked = true; + } + + private void checkpointInfoPictureBox_Click(object sender, System.EventArgs e) + { + toolTip.Show(Messages.FIELD_DISABLED, checkpointInfoPictureBox, 20, 0); + } + + private void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e) + { + toolTip.Hide(checkpointInfoPictureBox); + } + + private void pictureBoxVSS_Click(object sender, System.EventArgs e) + { + string tt = Messages.INFO_QUIESCE_MODE.Replace("\\n", "\n"); // This says that VSS must be enabled. This is a guess, because we can't tell whether it is or not. + toolTip.Show(tt, pictureBoxVSS, 20, 0); + } + + private void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e) + { + toolTip.Hide(pictureBoxVSS); + } + + private void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e) + { + if (this.quiesceCheckBox.Checked) + { + this.radioButtonDiskOnly.Checked = true; + } + } + + public vmss_type BackupType + { + get + { + if (quiesceCheckBox.Checked) + return vmss_type.snapshot_with_quiesce; + if (radioButtonDiskOnly.Checked) + return vmss_type.snapshot; + else if (radioButtonDiskAndMemory.Checked) + return vmss_type.checkpoint; + else + { + return vmss_type.unknown; + } + } + } + + public void ToggleQuiesceCheckBox(List SelectedVMs) + { + + switch (BackupType) + { + case vmss_type.snapshot: + quiesceCheckBox.Enabled = true; + quiesceCheckBox.Checked = false; + break; + + case vmss_type.snapshot_with_quiesce: + quiesceCheckBox.Enabled = true; + quiesceCheckBox.Checked = true; + break; + + case vmss_type.checkpoint: + quiesceCheckBox.Enabled = true; + quiesceCheckBox.Checked = false; + break; + } + + foreach (VM vm in SelectedVMs) + { + if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss)) + { + quiesceCheckBox.Enabled = false; + quiesceCheckBox.Checked = false; + break; + } + } + + } + + private void RefreshTab(VMSS policy) + { + /* when a policy does not have any VMs, irrespective of + * the snapshot type, enable Quiesce + */ + + quiesceCheckBox.Enabled = (policy.VMs.Count == 0); + + switch (policy.type) + { + case vmss_type.checkpoint: + radioButtonDiskAndMemory.Checked = true; + quiesceCheckBox.Enabled = false; + break; + case vmss_type.snapshot: + radioButtonDiskOnly.Checked = true; + break; + case vmss_type.snapshot_with_quiesce: + radioButtonDiskOnly.Checked = true; + + /* when the snapshot type itself is quiesce then we need to + * enable it irrespective of the number of VMs ( > 1 condition) + */ + + quiesceCheckBox.Enabled = true; + quiesceCheckBox.Checked = true; + break; + } + EnableShapshotTypes(policy.Connection, quiesceCheckBox.Enabled); + } + + private void EnableShapshotTypes(IXenConnection connection, bool isQuiesceEnabled) + { + radioButtonDiskAndMemory.Enabled = + label3.Enabled = !Helpers.FeatureForbidden(connection, Host.RestrictCheckpoint); + checkpointInfoPictureBox.Visible = !radioButtonDiskAndMemory.Enabled; + pictureBoxWarning.Visible = labelWarning.Visible = radioButtonDiskAndMemory.Enabled; + + this.quiesceCheckBox.Enabled = true; + this.quiesceCheckBox.Visible = true; + if (this._selectedVMs != null) + { + if (this._selectedVMs.Count > 0) + { + foreach (VM vm in this._selectedVMs) + { + if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || + Helpers.FeatureForbidden(vm, Host.RestrictVss)) + { + this.quiesceCheckBox.Enabled = false; + this.quiesceCheckBox.Checked = false; + break; + } + } + } + } + else /* we enter this block only when we are editing a policy, in that case the decision has already been taken in RefreshTab function */ + { + this.quiesceCheckBox.Enabled = isQuiesceEnabled; + } + this.pictureBoxVSS.Visible = !this.quiesceCheckBox.Enabled; + } + + public AsyncAction SaveSettings() + { + _policy.type = BackupType; + return null; + } + + private VMSS _policy; + + public void SetXenObjects(IXenObject orig, IXenObject clone) + { + _policy = (VMSS)clone; + RefreshTab(_policy); + } + + public bool HasChanged + { + get + { + return BackupType != _policy.type; + } + + } + + private void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e) + { + if (this.quiesceCheckBox.Enabled) + { + this.quiesceCheckBox.Checked = false; + } + } } } diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePageSpecific.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePageSpecific.cs deleted file mode 100644 index f5e76883c..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePageSpecific.cs +++ /dev/null @@ -1,304 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System.Collections.Generic; -using System.Drawing; -using XenAdmin.Actions; -using XenAdmin.Controls; -using XenAdmin.Core; -using XenAdmin.Network; -using XenAdmin.SettingsPanels; -using XenAPI; - - -namespace XenAdmin.Wizards.NewPolicyWizard -{ - //See notes in base class - - public partial class NewPolicySnapshotTypePageSpecific : NewPolicySnapshotTypePage where T : XenObject - { - - public NewPolicySnapshotTypePageSpecific() : base() - { - this.labelWarning.Text = string.Format(this.labelWarning.Text, VMGroup.VMPolicyTypeName); - } - - public NewPolicySnapshotTypePageSpecific(List selectedVMS) - : base(selectedVMS) - { - - } - - public override string SubText - { - get - { - if (BackupType == policy_backup_type.snapshot) - return Messages.DISKS_ONLY; - else if (BackupType == policy_backup_type.snapshot_with_quiesce) - return Messages.QUIESCED_SNAPSHOTS; - else - return Messages.DISKS_AND_MEMORY; - } - - } - - public override string HelpID - { - get { return "Snapshottype"; } - } - - public override string PageTitle - { - get - { - return Messages.SNAPSHOT_TYPE_TITLE; - } - } - public override string Text - { - get - { - return Messages.SNAPSHOT_TYPE; - } - } - - public override void PageLoaded(PageLoadedDirection direction) - { - base.PageLoaded(direction); - if (direction == PageLoadedDirection.Forward) - EnableShapshotTypes(Connection, false); - } - - public override Image Image - { - get { return Properties.Resources._000_VMSession_h32bit_16; } - } - - public override bool ValidToSave - { - get { return true; } - } - - public override void ShowLocalValidationMessages() - { - - } - - public override void Cleanup() - { - radioButtonDiskOnly.Checked = true; - } - - public override void checkpointInfoPictureBox_Click(object sender, System.EventArgs e) - { - toolTip.Show(Messages.FIELD_DISABLED, checkpointInfoPictureBox, 20, 0); - } - - public override void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e) - { - toolTip.Hide(checkpointInfoPictureBox); - } - - public override void pictureBoxVSS_Click(object sender, System.EventArgs e) - { - string tt = Messages.INFO_QUIESCE_MODE.Replace("\\n", "\n"); // This says that VSS must be enabled. This is a guess, because we can't tell whether it is or not. - toolTip.Show(tt, pictureBoxVSS, 20, 0); - } - - public override void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e) - { - toolTip.Hide(pictureBoxVSS); - } - - public override void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e) - { - if (this.quiesceCheckBox.Checked) - { - this.radioButtonDiskOnly.Checked = true; - } - } - - public policy_backup_type BackupType - { - get - { - if (quiesceCheckBox.Checked) - return policy_backup_type.snapshot_with_quiesce; - if (radioButtonDiskOnly.Checked) - return policy_backup_type.snapshot; - else if (radioButtonDiskAndMemory.Checked) - return policy_backup_type.checkpoint; - else - { - return policy_backup_type.unknown; - } - } - } - - public void ToggleQuiesceCheckBox(List SelectedVMs) - { - - switch (BackupType) - { - case policy_backup_type.snapshot: - quiesceCheckBox.Enabled = true; - quiesceCheckBox.Checked = false; - break; - - case policy_backup_type.snapshot_with_quiesce: - quiesceCheckBox.Enabled = true; - quiesceCheckBox.Checked = true; - break; - - case policy_backup_type.checkpoint: - quiesceCheckBox.Enabled = true; - quiesceCheckBox.Checked = false; - break; - } - - foreach (VM vm in SelectedVMs) - { - if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss)) - { - quiesceCheckBox.Enabled = false; - quiesceCheckBox.Checked = false; - break; - } - } - - } - - private void RefreshTab(IVMPolicy policy) - { - /* when a policy does not have any VMs, irrespective of - * the snapshot type, enable Quiesce - */ - - quiesceCheckBox.Enabled = (policy.VMs.Count == 0); - - switch (policy.policy_type) - { - case policy_backup_type.checkpoint: - radioButtonDiskAndMemory.Checked = true; - quiesceCheckBox.Enabled = false; - break; - case policy_backup_type.snapshot: - radioButtonDiskOnly.Checked = true; - break; - case policy_backup_type.snapshot_with_quiesce: - radioButtonDiskOnly.Checked = true; - - /* when the snapshot type itself is quiesce then we need to - * enable it irrespective of the number of VMs ( > 1 condition) - */ - - quiesceCheckBox.Enabled = true; - quiesceCheckBox.Checked = true; - break; - } - EnableShapshotTypes(policy.Connection, quiesceCheckBox.Enabled); - } - - private void EnableShapshotTypes(IXenConnection connection, bool isQuiesceEnabled) - { - radioButtonDiskAndMemory.Enabled = label3.Enabled = !Helpers.FeatureForbidden(connection, Host.RestrictCheckpoint); - checkpointInfoPictureBox.Visible = !radioButtonDiskAndMemory.Enabled; - pictureBoxWarning.Visible = labelWarning.Visible = radioButtonDiskAndMemory.Enabled; - this.quiesceCheckBox.Enabled = true; - - if (VMGroup.isQuescingSupported) - { - this.quiesceCheckBox.Visible = true; - if (this._selectedVMs != null) - { - if (this._selectedVMs.Count > 0) - { - foreach (VM vm in this._selectedVMs) - { - if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss)) - { - this.quiesceCheckBox.Enabled = false; - this.quiesceCheckBox.Checked = false; - break; - } - } - - } - - } - else /* we enter this block only when we are editing a policy, in that case the decision has already been taken in RefreshTab function */ - { - this.quiesceCheckBox.Enabled = isQuiesceEnabled; - } - this.pictureBoxVSS.Visible = !this.quiesceCheckBox.Enabled; - } - else /*quiescing snapshots are not supported in VMPP*/ - { - this.quiesceCheckBox.Visible = false; - this.pictureBoxVSS.Visible = false; - } - - } - - public override AsyncAction SaveSettings() - { - _policy.policy_type = BackupType; - return null; - } - - private IVMPolicy _policy; - - public override void SetXenObjects(IXenObject orig, IXenObject clone) - { - _policy = (IVMPolicy)clone; - RefreshTab(_policy); - } - - public override bool HasChanged - { - get - { - return BackupType != _policy.policy_type; - } - - } - - public override void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e) - { - if(this.quiesceCheckBox.Enabled) - { - this.quiesceCheckBox.Checked = false; - } - } - - } -} diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizard.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizard.cs index f53714aab..39b66aa3a 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizard.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizard.cs @@ -41,23 +41,14 @@ using XenAdmin.Wizards.GenericPages; namespace XenAdmin.Wizards.NewPolicyWizard { - // This class acts as the base class for NewPolicyWizardSpecific. It's only here - // because of a bug in Visual Studio: the Designer can't design classes of a - // generic class. The workaround is to do the design in this non-generic class, - // and then inherit the generic class from it. See - // http://stackoverflow.com/questions/1627431/fix-embedded-resources-for-generic-usercontrol - // http://bytes.com/topic/c-sharp/answers/537310-can-you-have-generic-type-windows-form - // http://connect.microsoft.com/VisualStudio/feedback/details/115397/component-resource-manager-doesnt-work-with-generic-form-classes - // (or search on Google for [ComponentResourceManager generic]). - public partial class NewPolicyWizard : XenWizardBase { - protected NewPolicyPolicyNamePage xenTabPagePolicy; - protected NewPolicySnapshotFrequencyPage xenTabPageSnapshotFrequency; - protected NewPolicyArchivePage xenTabPageArchive; - protected NewPolicyEmailPage xenTabPageEmail; - protected NewPolicyFinishPage xenTabPageFinish; - protected RBACWarningPage xenTabPageRBAC; + private readonly NewPolicyPolicyNamePage xenTabPagePolicy; + private readonly NewVMGroupVMsPage xenTabPageVMsPage; + private readonly NewPolicySnapshotTypePage xenTabPageSnapshotType; + private readonly NewPolicySnapshotFrequencyPage xenTabPageSnapshotFrequency; + private readonly NewPolicyFinishPage xenTabPageFinish; + private readonly RBACWarningPage xenTabPageRBAC; public readonly Pool Pool; public NewPolicyWizard(Pool pool) @@ -65,7 +56,151 @@ namespace XenAdmin.Wizards.NewPolicyWizard { InitializeComponent(); Pool = pool; - } + + this.Text = Messages.VMSS_WIZARD_TITLE; + + xenTabPagePolicy = new NewPolicyPolicyNamePage(Messages.NEW_VMSS_PAGE_TEXT, Messages.NEW_VMSS_PAGE_TEXT_MORE, + Messages.VMSS_NAME, Messages.VMSS_NAME_TITLE, Messages.VMSS_NAME_FIELD_TEXT); + xenTabPageSnapshotType = new NewPolicySnapshotTypePage(); + xenTabPageVMsPage = new NewVMGroupVMsPage(); + xenTabPageFinish = new NewPolicyFinishPage(Messages.VMSS_FINISH_PAGE_TEXT, Messages.VMSS_FINISH_PAGE_CHECKBOX_TEXT, Messages.VMSS_FINISH_TITLE); + xenTabPageRBAC = new RBACWarningPage(); + xenTabPageVMsPage.Pool = pool; + xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage(); + xenTabPageSnapshotFrequency.Pool = pool; + + #region RBAC Warning Page Checks + if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE) + { + //do nothing + } + else + { + RBACWarningPage.WizardPermissionCheck check; + check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_WARNING_VMSS); + check.AddApiCheck("VMSS.async_create"); + check.Blocking = true; + xenTabPageRBAC.AddPermissionChecks(xenConnection, check); + AddPage(xenTabPageRBAC, 0); + } + #endregion + + AddPages(xenTabPagePolicy, xenTabPageVMsPage); + AddPage(xenTabPageSnapshotType); + AddPages(xenTabPageSnapshotFrequency); + AddPages(xenTabPageFinish); + } + + public NewPolicyWizard(Pool pool, List selection) + : this(pool) + { + this.xenTabPageVMsPage.SelectedVMs = selection; + } + + private new string GetSummary() + { + + return string.Format(Messages.VMSS_POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs), + FormatBackupType(xenTabPageSnapshotType.BackupType), + FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG)); + } + + private static string FormatBackupType(vmss_type backupType) + { + if (backupType == vmss_type.snapshot) + return Messages.DISKS_ONLY; + else if (backupType == vmss_type.checkpoint) + return Messages.DISKS_AND_MEMORY; + else if (backupType == vmss_type.snapshot_with_quiesce) + return Messages.QUIESCED_SNAPSHOTS; + + throw new ArgumentException("wrong argument"); + } + + internal static string FormatSchedule(Dictionary schedule, vmss_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode) + { + if (backupFrequency == vmss_frequency.hourly) + { + return string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"]); + } + else if (backupFrequency == vmss_frequency.daily) + { + DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); + return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true)); + } + else if (backupFrequency == vmss_frequency.weekly) + { + DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); + return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode)); + } + return ""; + } + + private static string CommaSeparated(IEnumerable selectedVMs) + { + var sb = new StringBuilder(); + foreach (var selectedVM in selectedVMs) + { + sb.Append(selectedVM.Name); + sb.Append(", "); + } + if (sb.Length > 2) + sb.Remove(sb.Length - 2, 2); + return sb.ToString(); + } + + protected override void UpdateWizardContent(XenTabPage senderPage) + { + var prevPageType = senderPage.GetType(); + + if (prevPageType == typeof(NewPolicyPolicyNamePage)) + { + xenTabPageVMsPage.GroupName = xenTabPagePolicy.PolicyName; + } + else + { + if (prevPageType == typeof(NewPolicySnapshotFrequencyPage)) + { + xenTabPageFinish.Summary = GetSummary(); + xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count; + } + else if (prevPageType == typeof(NewVMGroupVMsPage)) + { + xenTabPageSnapshotType.SelectedVMs = xenTabPageVMsPage.SelectedVMs; + } + } + } + + protected override void FinishWizard() + { + var vmss = new VMSS + { + name_label = xenTabPagePolicy.PolicyName, + name_description = xenTabPagePolicy.PolicyDescription, + type = (vmss_type)xenTabPageSnapshotType.BackupType, + frequency = (vmss_frequency)xenTabPageSnapshotFrequency.Frequency, + schedule = xenTabPageSnapshotFrequency.Schedule, + retained_snapshots = xenTabPageSnapshotFrequency.BackupRetention, + enabled = xenTabPageVMsPage.SelectedVMs.Count == 0 ? false : true, + Connection = Pool.Connection + }; + + var action = new CreateVMPolicy(vmss, xenTabPageVMsPage.SelectedVMs, xenTabPageFinish.RunNow); + + action.RunAsync(); + base.FinishWizard(); + } + + protected override string WizardPaneHelpID() + { + if (CurrentStepTabPage is RBACWarningPage) + { + return FormatHelpId("Rbac"); + } + + return "NewPolicyWizardVMSS_" + CurrentStepTabPage.HelpID + "Pane"; + } + } } diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs deleted file mode 100644 index ab40a82a1..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs +++ /dev/null @@ -1,278 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text; -using XenAdmin.Actions; -using XenAdmin.Controls; -using XenAdmin.Core; -using XenAPI; -using XenAdmin.Wizards.GenericPages; - -namespace XenAdmin.Wizards.NewPolicyWizard -{ - //See notes in base class - - public class NewPolicyWizardSpecific : NewPolicyWizard where T : XenObject - { - private readonly NewVMGroupVMsPage xenTabPageVMsPage; - private readonly NewPolicySnapshotTypePageSpecific xenTabPageSnapshotType; - - public NewPolicyWizardSpecific(Pool pool) - :base(pool) - { - this.Text = VMGroup.VMPolicyWizardTitle; - - xenTabPagePolicy = new NewPolicyPolicyNamePage(VMGroup.VMPolicyNamePageText, VMGroup.VMPolicyNamePageTextMore, - VMGroup.VMPolicyNamePageTabName, VMGroup.VMPolicyNamePageTabText, VMGroup.VMPolicyNamePageNameFieldText); - xenTabPageSnapshotType = new NewPolicySnapshotTypePageSpecific(); - xenTabPageVMsPage = new NewVMGroupVMsPage(); - xenTabPageFinish = new NewPolicyFinishPage(VMGroup.VMPolicyFinishPageText, VMGroup.VMPolicyFinishPageCheckboxText, VMGroup.VMPolicyFinishPageTitle); - xenTabPageRBAC = new RBACWarningPage(); - xenTabPageVMsPage.Pool = pool; - xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage(); - xenTabPageSnapshotFrequency.Pool = pool; - - #region RBAC Warning Page Checks - if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE) - { - //do nothing - } - else - { - RBACWarningPage.WizardPermissionCheck check; - check = new RBACWarningPage.WizardPermissionCheck(VMGroup.VMPolicyRBACWarning); - check.AddApiCheck(VMGroup.VMPolicyRBACapiCheck); - check.Blocking = true; - xenTabPageRBAC.AddPermissionChecks(xenConnection, check); - AddPage(xenTabPageRBAC, 0); - } - #endregion - - AddPages(xenTabPagePolicy, xenTabPageVMsPage); - AddPage(xenTabPageSnapshotType); - AddPages(xenTabPageSnapshotFrequency); - - if (VMGroup.isVMPolicyVMPP) - { - xenTabPageArchive = new NewPolicyArchivePage(); - xenTabPageArchive.Pool = pool; - AddPage(xenTabPageArchive); - - xenTabPageEmail = new NewPolicyEmailPage(); - xenTabPageEmail.Pool = pool; - AddPages(xenTabPageEmail); - - } - - AddPages(xenTabPageFinish); - } - - public NewPolicyWizardSpecific(Pool pool, List selection) - : this(pool) - { - this.xenTabPageVMsPage.SelectedVMs = selection; - } - - private new string GetSummary() - { - - if (VMGroup.isVMPolicyVMPP) - { - return string.Format(Messages.POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs), - FormatBackupType(xenTabPageSnapshotType.BackupType), - FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG), - FormatSchedule(xenTabPageArchive.Schedule, xenTabPageArchive.ArchiveFrequency, DaysWeekCheckboxes.DaysMode.L10N_LONG)); - } - else - { - return string.Format(Messages.VMSS_POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs), - FormatBackupType(xenTabPageSnapshotType.BackupType), - FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG)); - } - } - - private int GetBackupDaysCount() - { - string days; - return xenTabPageSnapshotFrequency.Schedule.TryGetValue("days", out days) ? days.Split(',').Length : 0; - } - - private static string FormatBackupType(policy_backup_type backupType) - { - if (backupType == policy_backup_type.snapshot) - return Messages.DISKS_ONLY; - else if (backupType == policy_backup_type.checkpoint) - return Messages.DISKS_AND_MEMORY; - else if (backupType == policy_backup_type.snapshot_with_quiesce) - return Messages.QUIESCED_SNAPSHOTS; - - throw new ArgumentException("wrong argument"); - } - - - // These two instances of FormatSchedule used to be in the VMPP class. That's probably where - // they really belong, but because of the way they're constructed (see DaysWeekCheckboxes.L10NDays()) - // they had to move into the View. (CA-51612). - internal static string FormatSchedule(Dictionary schedule, vmpp_archive_frequency archiveType, DaysWeekCheckboxes.DaysMode mode) - { - if (archiveType == vmpp_archive_frequency.always_after_backup) - { - return Messages.ASAPSNAPSHOTTAKEN; - } - else if (archiveType == vmpp_archive_frequency.never) - { - return Messages.NEVER; - } - else if (archiveType == vmpp_archive_frequency.daily) - { - DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); - return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true)); - } - else if (archiveType == vmpp_archive_frequency.weekly) - { - DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); - return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode)); - } - return ""; - - } - - internal static string FormatSchedule(Dictionary schedule, policy_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode) - { - if (backupFrequency == policy_frequency.hourly) - { - return string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"]); - } - else if (backupFrequency == policy_frequency.daily) - { - DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); - return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true)); - } - else if (backupFrequency == policy_frequency.weekly) - { - DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); - return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode)); - } - return ""; - } - - private static string CommaSeparated(IEnumerable selectedVMs) - { - var sb = new StringBuilder(); - foreach (var selectedVM in selectedVMs) - { - sb.Append(selectedVM.Name); - sb.Append(", "); - } - if (sb.Length > 2) - sb.Remove(sb.Length - 2, 2); - return sb.ToString(); - } - - protected override void UpdateWizardContent(XenTabPage senderPage) - { - var prevPageType = senderPage.GetType(); - - if (prevPageType == typeof(NewPolicyPolicyNamePage)) - { - xenTabPageVMsPage.GroupName = xenTabPagePolicy.PolicyName; - } - else if (VMGroup.isVMPolicyVMPP) - { - if (prevPageType == typeof(NewPolicySnapshotFrequencyPage)) - { - xenTabPageArchive.SnapshotFrequency = (vmpp_backup_frequency)xenTabPageSnapshotFrequency.Frequency; - xenTabPageArchive.BackupDaysCount = GetBackupDaysCount(); - } - else if (prevPageType == typeof(NewPolicyEmailPage)) - { - xenTabPageFinish.Summary = GetSummary(); - xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count; - } - } - else - { - if (prevPageType == typeof(NewPolicySnapshotFrequencyPage)) - { - xenTabPageFinish.Summary = GetSummary(); - xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count; - } - else if (prevPageType == typeof(NewVMGroupVMsPage)) - { - xenTabPageSnapshotType.SelectedVMs = xenTabPageVMsPage.SelectedVMs; - } - } - - } - - protected override void FinishWizard() - { - var action = VMGroup.VMCreateObjectAction( - xenTabPagePolicy.PolicyName, - xenTabPagePolicy.PolicyDescription, - xenTabPageSnapshotType.BackupType, - xenTabPageSnapshotFrequency.Frequency, - xenTabPageSnapshotFrequency.Schedule, - xenTabPageSnapshotFrequency.BackupRetention, - xenTabPageArchive != null ? xenTabPageArchive.ArchiveFrequency : vmpp_archive_frequency.unknown, - xenTabPageArchive != null ? xenTabPageArchive.ArchiveConfig : null, - xenTabPageArchive != null ? xenTabPageArchive.ArchiveTargetType : vmpp_archive_target_type.unknown, - xenTabPageArchive != null ? xenTabPageArchive.Schedule : null, - xenTabPageEmail != null ? xenTabPageEmail.EmailEnabled : false, - xenTabPageEmail != null ? xenTabPageEmail.EmailSettings : null, - xenTabPageVMsPage.SelectedVMs.Count == 0 ? false : true, - xenTabPageVMsPage.SelectedVMs, - xenTabPageFinish.RunNow, - Pool.Connection); - - action.RunAsync(); - base.FinishWizard(); - } - - protected override string WizardPaneHelpID() - { - if (CurrentStepTabPage is RBACWarningPage) - { - return FormatHelpId("Rbac"); - } - - else if (!VMGroup.isVMPolicyVMPP) - { - return "NewPolicyWizardVMSS_" + CurrentStepTabPage.HelpID + "Pane"; - } - - return "NewPolicyWizard_" + CurrentStepTabPage.HelpID + "Pane"; - } - - } -} diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index 8581b0a24..f67b3131c 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -167,6 +167,7 @@ DataGridViewEx.cs + Component @@ -705,12 +706,6 @@ IntraPoolCopyPage.cs - - UserControl - - - Form - UserControl @@ -3453,18 +3448,17 @@ MoveVMDialog.cs - - + UserControl - + PolicyHistory.cs - + Form - - VMProtectionPoliciesDialog.cs + + ScheduledSnapshotsDialog.cs Form @@ -3672,18 +3666,6 @@ LocalServerTime.cs - - UserControl - - - NewPolicyArchivePage.cs - - - UserControl - - - NewPolicyEmailPage.cs - UserControl @@ -5545,24 +5527,24 @@ SelectVMsToSuspendDialog.cs - + PolicyHistory.cs - + PolicyHistory.cs - + PolicyHistory.cs - - VMProtectionPoliciesDialog.cs + + ScheduledSnapshotsDialog.cs - - VMProtectionPoliciesDialog.cs + + ScheduledSnapshotsDialog.cs Designer - - VMProtectionPoliciesDialog.cs + + ScheduledSnapshotsDialog.cs VmSnapshotDialog.cs @@ -6339,25 +6321,6 @@ LocalServerTime.cs - - NewPolicyArchivePage.cs - - - NewPolicyArchivePage.cs - - - NewPolicyArchivePage.cs - - - NewPolicyEmailPage.cs - - - NewPolicyEmailPage.cs - Designer - - - NewPolicyEmailPage.cs - NewPolicyFinishPage.cs diff --git a/XenAdminTests/DialogTests/DialogsForPool.cs b/XenAdminTests/DialogTests/DialogsForPool.cs index ae57fc886..28bbd5bba 100644 --- a/XenAdminTests/DialogTests/DialogsForPool.cs +++ b/XenAdminTests/DialogTests/DialogsForPool.cs @@ -36,7 +36,7 @@ using System.Windows.Forms; using NUnit.Framework; using XenAdmin.Controls; using XenAdmin.Dialogs; -using XenAdmin.Dialogs.VMProtection_Recovery; +using XenAdmin.Dialogs.ScheduledSnapshots; namespace XenAdminTests.DialogTests.state1_xml.DialogsForPool { @@ -76,11 +76,11 @@ namespace XenAdminTests.DialogTests.state2_xml.DialogsForPool namespace XenAdminTests.DialogTests.cowleyPolicies_xml.DialogsForPool { [TestFixture, Category(TestCategories.UICategoryA)] - public class VMProtectionPoliciesDialogTest : DialogTest + public class VMProtectionPoliciesDialogTest : DialogTest { - protected override VMProtectionPoliciesDialog NewDialog() + protected override ScheduledSnapshotsDialog NewDialog() { - return new VMProtectionPoliciesDialog(GetAnyPool()); + return new ScheduledSnapshotsDialog(GetAnyPool()); } } } \ No newline at end of file diff --git a/XenAdminTests/MockConnectionManager.cs b/XenAdminTests/MockConnectionManager.cs index ed0c4a93d..b28abcc62 100644 --- a/XenAdminTests/MockConnectionManager.cs +++ b/XenAdminTests/MockConnectionManager.cs @@ -188,7 +188,7 @@ namespace XenAdminTests caches[connectionId].Setup(c => c.VDIs).Returns(GeneratedXenObjects(connectionId)); caches[connectionId].Setup(c => c.VGPUs).Returns(GeneratedXenObjects(connectionId)); caches[connectionId].Setup(c => c.VIFs).Returns(GeneratedXenObjects(connectionId)); - caches[connectionId].Setup(c => c.VMPPs).Returns(GeneratedXenObjects(connectionId)); + caches[connectionId].Setup(c => c.VMSSs).Returns(GeneratedXenObjects(connectionId)); caches[connectionId].Setup(c => c.VM_appliances).Returns(GeneratedXenObjects(connectionId)); caches[connectionId].Setup(c => c.VMs).Returns(GeneratedXenObjects(connectionId)); } diff --git a/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs b/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs index 612660548..56ca626f2 100644 --- a/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs +++ b/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs @@ -74,7 +74,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -117,7 +116,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -186,7 +184,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)}), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -229,7 +226,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -300,7 +296,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -343,7 +338,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -414,7 +408,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -457,7 +450,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -529,7 +521,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -572,7 +563,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", true),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -646,7 +636,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -689,7 +678,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -764,7 +752,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -807,7 +794,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -885,7 +871,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -928,7 +913,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1007,7 +991,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -1050,7 +1033,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1130,7 +1112,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -1173,7 +1154,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1254,7 +1234,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", false, false ), new ExpectedTextMenuItem("Di&saster Recovery", false, false ), - new ExpectedTextMenuItem("VM &Protection Policies...", false, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ), @@ -1297,7 +1276,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", false, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1373,7 +1351,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -1416,7 +1393,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1485,7 +1461,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -1528,7 +1503,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&New VM...", true, false ), new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ), new ExpectedTextMenuItem("Assign to vA&pp", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false ), @@ -1601,7 +1575,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -1674,7 +1647,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&Migrate VM wizard...", false, false) }), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false), new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false), @@ -1745,7 +1717,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -1801,7 +1772,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Shut Dow&n vApp", false) }), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false), new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", false, false), @@ -1873,7 +1843,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true, false ), new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ), - new ExpectedTextMenuItem("VM &Protection Policies...", true, false ), new ExpectedTextMenuItem("E&xport Resource Data...", false, false ), new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ), new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ), @@ -1938,7 +1907,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("incubus (INTERNAL_ERROR)", false, false, true) }), new ExpectedSeparator(), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false), new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }), new ExpectedSeparator(), new ExpectedTextMenuItem("&Copy VM...", true, false), diff --git a/XenAdminTests/TabsAndMenus/PluginTabsAndMenus.cs b/XenAdminTests/TabsAndMenus/PluginTabsAndMenus.cs index 4959bb1df..6a49b518e 100644 --- a/XenAdminTests/TabsAndMenus/PluginTabsAndMenus.cs +++ b/XenAdminTests/TabsAndMenus/PluginTabsAndMenus.cs @@ -181,13 +181,13 @@ namespace XenAdminTests.TabsAndMenus Assert.AreEqual("view_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.ViewMenu.DropDownItems)[5].Text); MainWindowWrapper.PoolMenu.ShowDropDown(); - Assert.AreEqual("pool_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.PoolMenu.DropDownItems)[20].Text); + Assert.AreEqual("pool_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.PoolMenu.DropDownItems)[19].Text); MainWindowWrapper.HostMenu.ShowDropDown(); Assert.AreEqual("server_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.HostMenu.DropDownItems)[21].Text); MainWindowWrapper.VMMenu.ShowDropDown(); - Assert.AreEqual("vm_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.VMMenu.DropDownItems)[19].Text); + Assert.AreEqual("vm_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.VMMenu.DropDownItems)[18].Text); MainWindowWrapper.TemplatesMenu.ShowDropDown(); Assert.AreEqual("templates_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.TemplatesMenu.DropDownItems)[7].Text); diff --git a/XenAdminTests/TabsAndMenus/TabsAndMenusBoston.cs b/XenAdminTests/TabsAndMenus/TabsAndMenusBoston.cs index 0ee25c3c4..f6d0aed8a 100644 --- a/XenAdminTests/TabsAndMenus/TabsAndMenusBoston.cs +++ b/XenAdminTests/TabsAndMenus/TabsAndMenusBoston.cs @@ -304,7 +304,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedSeparator(), new ExpectedTextMenuItem("&High Availability...", true) }; - expected.Add(new ExpectedTextMenuItem("VM Pr&otection Policies...", true)); expected.Add(new ExpectedTextMenuItem("Manage &vApps...", true)); expected.Add(new ExpectedTextMenuItem("Di&saster Recovery", true, new ExpectedMenuItem[] { @@ -410,7 +409,6 @@ namespace XenAdminTests.TabsAndMenus expectedMenuItems.Add(new ExpectedTextMenuItem("Ta&ke a Snapshot...", true)); - expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) })); expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) })); expectedMenuItems.Add(new ExpectedSeparator()); expectedMenuItems.Add(new ExpectedTextMenuItem("P&roperties", true)); @@ -429,7 +427,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Force Re&boot", true), new ExpectedSeparator(), new ExpectedTextMenuItem("Ta&ke a Snapshot...", true), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) }), new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }), new ExpectedSeparator(), new ExpectedTextMenuItem("Inst&all " + Branding.PRODUCT_BRAND + " Tools...", true), @@ -459,7 +456,6 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("&Export...", true), new ExpectedTextMenuItem("Ta&ke a Snapshot...", true), new ExpectedTextMenuItem("Co&nvert to Template...", true), - new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) }), new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }), new ExpectedSeparator(), new ExpectedTextMenuItem("&Delete VM...", true), diff --git a/XenAdminTests/TabsAndMenus/TabsAndMenusTampa.cs b/XenAdminTests/TabsAndMenus/TabsAndMenusTampa.cs index def1e897a..81e7afe03 100644 --- a/XenAdminTests/TabsAndMenus/TabsAndMenusTampa.cs +++ b/XenAdminTests/TabsAndMenus/TabsAndMenusTampa.cs @@ -268,7 +268,7 @@ namespace XenAdminTests.TabsAndMenus { foreach (VM vm in GetAllXenObjects(HasTools)) { - if(vm.Name.Contains("23")) //Skip over the slave servers VMs + if(vm.Name.Contains("22")) //Skip over the slave servers VMs continue; List expectedMenuItems = new List(); @@ -298,7 +298,6 @@ namespace XenAdminTests.TabsAndMenus })); expectedMenuItems.Add(new ExpectedSeparator()); expectedMenuItems.Add(new ExpectedTextMenuItem("Ta&ke a Snapshot...", true)); - expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true)})); expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true)})); diff --git a/XenAdminTests/UnitTests/VMPPGetWeeklyTests.cs b/XenAdminTests/UnitTests/VMPPGetWeeklyTests.cs index 59d13af78..985d1a459 100644 --- a/XenAdminTests/UnitTests/VMPPGetWeeklyTests.cs +++ b/XenAdminTests/UnitTests/VMPPGetWeeklyTests.cs @@ -44,7 +44,7 @@ namespace XenAdminTests.UnitTests public void Test1() { //Test when the day this week already past - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List { DayOfWeek.Tuesday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List { DayOfWeek.Tuesday }); Assert.AreEqual(new DateTime(2010, 10, 26, 10, 15, 0), time); } @@ -52,7 +52,7 @@ namespace XenAdminTests.UnitTests public void Test2() { //Test when the day is today but the time alreday past - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List { DayOfWeek.Wednesday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List { DayOfWeek.Wednesday }); Assert.AreEqual(new DateTime(2010, 10, 27, 10, 15, 0), time); } @@ -60,7 +60,7 @@ namespace XenAdminTests.UnitTests public void Test3() { //Test when the day is today but the time did not pass - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List { DayOfWeek.Wednesday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List { DayOfWeek.Wednesday }); Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time); } @@ -68,7 +68,7 @@ namespace XenAdminTests.UnitTests public void Test4() { //Test when the day is today but the time did not pass with more than one day - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List { DayOfWeek.Wednesday,DayOfWeek.Monday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Monday }); Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time); } @@ -76,7 +76,7 @@ namespace XenAdminTests.UnitTests public void Test5() { //Today already past take next day in same week - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Thursday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Thursday }); Assert.AreEqual(new DateTime(2010, 10, 21, 10, 15, 0), time); } @@ -84,7 +84,7 @@ namespace XenAdminTests.UnitTests public void Test6() { //Today already past take next day in next week - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Monday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Monday }); Assert.AreEqual(new DateTime(2010, 10, 25, 10, 15, 0), time); } @@ -92,7 +92,7 @@ namespace XenAdminTests.UnitTests public void Test7() { //Today already past take next day in next week - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 15, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Monday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 15, 0), 10, 15, new List { DayOfWeek.Wednesday, DayOfWeek.Monday }); Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time); } @@ -100,7 +100,7 @@ namespace XenAdminTests.UnitTests public void Test8() { //Check Sunday and unsorted list - var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 24, 10, 16, 0), 10, 15, new List { DayOfWeek.Sunday, DayOfWeek.Monday }); + var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 24, 10, 16, 0), 10, 15, new List { DayOfWeek.Sunday, DayOfWeek.Monday }); Assert.AreEqual(new DateTime(2010, 10, 25, 10, 15, 0), time); } diff --git a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs index 494089db7..891610175 100644 --- a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs +++ b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -using System.Threading; -using System.Windows.Forms; using NUnit.Framework; using XenAdmin.Wizards.NewPolicyWizard; @@ -38,21 +36,21 @@ namespace XenAdminTests.WizardTests.cowleyPolicies_xml { [TestFixture, Category(TestCategories.UICategoryB)] - class NewPolicyWizardTest : WizardTest> + class NewPolicyWizardTest : WizardTest { public NewPolicyWizardTest() - : base(new string[] { "Policy Name", "Protected VMs", "Snapshot Type", "Snapshot schedule","Archive Options","Email Alerts","Finish" } + : base(new string[] { "Schedule Name", "VMs in the snapshot schedule", "Snapshot Type", "Snapshot schedule","Finish" } , true, false) { } - protected override NewPolicyWizardSpecific NewWizard() + protected override NewPolicyWizard NewWizard() { - return new NewPolicyWizardSpecific(base.GetAnyPool()); + return new NewPolicyWizard(base.GetAnyPool()); } protected override void TestPage(string pageName) { - if (pageName == "Policy Name") + if (pageName == "Schedule Name") { MW(() => (TestUtils.GetTextBox(wizard, "xenTabPagePolicy.textBoxName")).Text = "policy"); } diff --git a/XenAdminTests/XenModelTests/DestroyPolicyActionTests.cs b/XenAdminTests/XenModelTests/DestroyPolicyActionTests.cs index 81b59bbfc..e53b5e90b 100644 --- a/XenAdminTests/XenModelTests/DestroyPolicyActionTests.cs +++ b/XenAdminTests/XenModelTests/DestroyPolicyActionTests.cs @@ -47,7 +47,7 @@ namespace XenAdminTests.XenModelTests [Test] public void TestEmptyList() { - var action = new DestroyPolicyAction(mockConnection.Object, new List()); + var action = new DestroyPolicyAction(mockConnection.Object, new List()); action.Completed += action_Completed; action.RunAsync(); _autoResetEvent.WaitOne(); @@ -62,30 +62,30 @@ namespace XenAdminTests.XenModelTests [Test] public void TestOneInList() { - mockProxy.Setup(x => x.vmpp_destroy(It.IsAny(), "1")).Returns(new Response("")); - mockProxy.Setup(x => x.vm_set_protection_policy(It.IsAny(), "1", It.IsAny())).Returns(new Response("")); - var action = new DestroyPolicyAction(mockConnection.Object, new List() - {new VMPP(){opaque_ref = "1",VMs = new List>(){new XenRef("1")}}}); + mockProxy.Setup(x => x.vmss_destroy(It.IsAny(), "1")).Returns(new Response("")); + mockProxy.Setup(x => x.vm_set_snapshot_schedule(It.IsAny(), "1", It.IsAny())).Returns(new Response("")); + var action = new DestroyPolicyAction(mockConnection.Object, new List() + {new VMSS(){opaque_ref = "1",VMs = new List>(){new XenRef("1")}}}); action.Completed += action_Completed; action.RunAsync(); _autoResetEvent.WaitOne(); Assert.True(action.Succeeded,action.Exception!=null?action.Exception.ToString():""); mockProxy.VerifyAll(); - mockProxy.Verify(x => x.vm_set_protection_policy(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); + mockProxy.Verify(x => x.vm_set_snapshot_schedule(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); } [Test] public void TestOneWithTwonVMsInList() { - mockProxy.Setup(x => x.vmpp_destroy(It.IsAny(),"1")).Returns(new Response("")); - mockProxy.Setup(x => x.vm_set_protection_policy(It.IsAny(), It.Is(s=>s=="1"||s=="2"), It.IsAny())).Returns(new Response("")); - var action = new DestroyPolicyAction(mockConnection.Object, new List() - { new VMPP() { opaque_ref = "1", VMs = new List>() { new XenRef("1"), new XenRef("2") } } }); + mockProxy.Setup(x => x.vmss_destroy(It.IsAny(),"1")).Returns(new Response("")); + mockProxy.Setup(x => x.vm_set_snapshot_schedule(It.IsAny(), It.Is(s => s == "1" || s == "2"), It.IsAny())).Returns(new Response("")); + var action = new DestroyPolicyAction(mockConnection.Object, new List() + { new VMSS() { opaque_ref = "1", VMs = new List>() { new XenRef("1"), new XenRef("2") } } }); action.Completed += action_Completed; action.RunAsync(); _autoResetEvent.WaitOne(); Assert.True(action.Succeeded, action.Exception != null ? action.Exception.ToString() : ""); - mockProxy.Verify(x => x.vm_set_protection_policy(It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(2)); + mockProxy.Verify(x => x.vm_set_snapshot_schedule(It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(2)); mockProxy.VerifyAll(); } diff --git a/XenAdminTests/XenModelTests/PureAsyncActionTests.cs b/XenAdminTests/XenModelTests/PureAsyncActionTests.cs index bfb9ccade..af583987f 100644 --- a/XenAdminTests/XenModelTests/PureAsyncActionTests.cs +++ b/XenAdminTests/XenModelTests/PureAsyncActionTests.cs @@ -46,24 +46,6 @@ namespace XenAdminTests.XenModelTests public class PureAsyncActionTests : ActionTestBase { readonly AutoResetEvent _autoResetEvent = new AutoResetEvent(false); - [Test] - public void VMTestPureAsyncAction() - { - mockProxy.Setup(x => x.vmpp_archive_now(It.IsAny(), "testvm")).Returns(new Response("")); - mockProxy.Setup(x => x.task_add_to_other_config(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(new Response("")); - mockProxy.Setup(x => x.task_remove_from_other_config(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new Response("")); - VM vm = GetVM(); - SetupPureAsyncAction(vm); - //Async call pure async action extra setups needed - ExtraAsyncMethodsSetup(); - var action = new ArchiveNowAction(vm); - action.Completed += action_Completed; - action.RunAsync(); - _autoResetEvent.WaitOne(); - Assert.True(action.Succeeded); - mockProxy.VerifyAll(); - - } private void ExtraAsyncMethodsSetup() { @@ -137,7 +119,7 @@ namespace XenAdminTests.XenModelTests mockConnection.Setup(x => x.Cache).Returns(cache); mockConnection.Setup(x => x.ResolveAll(It.IsAny>>())) .Returns(new List() { - new Role() { name_label = "vmpp.archive_now" } + new Role() { name_label = "vm.set_is_a_template" } ,new Role() { name_label = "vm.destroy" } ,new Role() { name_label = "vm.clean_shutdown" } , new Role() { name_label = "task.add_to_other_config/key:xencenteruuid" } diff --git a/XenModel/Actions/VMPP/ArchiveNowAction.cs b/XenModel/Actions/VMPP/ArchiveNowAction.cs deleted file mode 100644 index 3315de24a..000000000 --- a/XenModel/Actions/VMPP/ArchiveNowAction.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using XenAPI; - - -namespace XenAdmin.Actions -{ - public class ArchiveNowAction : PureAsyncAction - { - private VM _snapshot; - public ArchiveNowAction(VM snapshot) - : base(snapshot.Connection, string.Format(Messages.ARCHIVE_SNAPSHOT_X, snapshot.Name)) - { - _snapshot = snapshot; - VM = snapshot.Connection.Resolve(snapshot.snapshot_of); - } - protected override void Run() - { - try - { - Description = string.Format(Messages.ARCHIVING_SNAPSHOT_X, _snapshot.Name); - RelatedTask=new XenRef(VMPP.archive_now(Session, _snapshot.opaque_ref)); - PollToCompletion(); - Description = string.Format(Messages.ARCHIVED_SNAPSHOT_X, _snapshot.Name); - } - catch (Exception e) - { - Failure f = e as Failure; - if (f != null) - { - string msg = ""; - if (f.ErrorDescription.Count > 3) - { - msg = XenAPI.Message.FriendlyName(f.ErrorDescription[3]); - } - - throw new Exception(msg); - - } - throw; - } - } - } -} diff --git a/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs b/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs deleted file mode 100644 index b4e5a5d44..000000000 --- a/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using XenAdmin.Network; -using XenAPI; -using XenAdmin.Core; - - -namespace XenAdmin.Actions -{ - public class ChangePolicyEnabledAction : PureAsyncAction where T : XenObject - { - private IVMPolicy _policy; - public ChangePolicyEnabledAction(IVMPolicy policy) - : base(policy.Connection, string.Format(Messages.CHANGE_POLICY_STATUS, policy.Name)) - { - _policy = policy; - Pool = Helpers.GetPool(_policy.Connection); - } - - protected override void Run() - { - bool value = !_policy.is_enabled; - Description = value ? string.Format(typeof(T) == typeof(VMPP) ? Messages.ENABLING_VMPP : Messages.ENABLING_VMSS, _policy.Name) : - string.Format(typeof(T) == typeof(VMPP) ? Messages.DISABLING_VMPP : Messages.DISABLING_VMSS, _policy.Name); - - _policy.set_is_enabled(Session, _policy.opaque_ref, !_policy.is_enabled); - - Description = value ? string.Format(typeof(T) == typeof(VMPP) ? Messages.ENABLED_VMPP : Messages.ENABLED_VMSS, _policy.Name) : - string.Format(typeof(T) == typeof(VMPP) ? Messages.DISABLED_VMPP : Messages.DISABLED_VMSS, _policy.Name); - - } - } -} diff --git a/XenModel/Actions/VMPP/GetVMPPAlertsAction.cs b/XenModel/Actions/VMPP/GetVMPPAlertsAction.cs deleted file mode 100644 index 7ebd63ca0..000000000 --- a/XenModel/Actions/VMPP/GetVMPPAlertsAction.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using XenAdmin.Alerts; -using XenAPI; -using System.Diagnostics; - -namespace XenAdmin.Actions -{ - public class GetVMPPAlertsAction : PureAsyncAction - { - public readonly VMPP VMPP; - private int _hoursFromNow; - public GetVMPPAlertsAction(VMPP vmpp,int hoursfromNow) - : base(vmpp.Connection, "", true) - { - VMPP = vmpp; - _hoursFromNow = hoursfromNow; - } - - protected override void Run() - { - var now = DateTime.Now; - var result = new List(VMPP.get_alerts(VMPP.Connection.Session, VMPP.opaque_ref, _hoursFromNow)); - - var listAlerts=new List(); - foreach(string item in result) - { - listAlerts.Add(new PolicyAlert(VMPP.Connection,item)); - } - VMPP.Alerts=new List(listAlerts); - Debug.WriteLine(string.Format("GetAlerts took: {0}", DateTime.Now - now)); - } - - - } -} diff --git a/XenModel/Actions/VMPP/AssignVMsToPolicyAction.cs b/XenModel/Actions/VMSS/AssignVMsToPolicyAction.cs similarity index 58% rename from XenModel/Actions/VMPP/AssignVMsToPolicyAction.cs rename to XenModel/Actions/VMSS/AssignVMsToPolicyAction.cs index e82b05d24..f7c62ca69 100644 --- a/XenModel/Actions/VMPP/AssignVMsToPolicyAction.cs +++ b/XenModel/Actions/VMSS/AssignVMsToPolicyAction.cs @@ -36,14 +36,14 @@ using XenAdmin.Core; namespace XenAdmin.Actions { - public class AssignVMsToPolicyAction:PureAsyncAction where T : XenObject + public class AssignVMsToPolicyAction : PureAsyncAction { - private IVMPolicy _policy; + private VMSS _policy; private List> _selectedVMs; - public AssignVMsToPolicyAction(IVMPolicy policy, List> selectedVMs, bool suppressHistory) - : base(policy.Connection, (typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY_NOAMP : Messages.ASSIGN_VMSS_POLICY_NOAMP), suppressHistory) + public AssignVMsToPolicyAction(VMSS policy, List> selectedVMs, bool suppressHistory) + : base(policy.Connection, Messages.ASSIGN_VMSS_POLICY_NOAMP, suppressHistory) { _policy = policy; _selectedVMs = selectedVMs; @@ -53,32 +53,32 @@ namespace XenAdmin.Actions protected override void Run() { - Description = typeof(T) == typeof(VMPP) ? Messages.ASSIGNING_PROTECTION_POLICY : Messages.ASSIGNING_VMSS_POLICY; + Description = Messages.ASSIGNING_VMSS_POLICY; foreach (var xenRef in _policy.VMs) { - _policy.set_vm_policy(Session, xenRef, null); + VM.set_snapshot_schedule(Session, xenRef, null); } foreach (var xenRef in _selectedVMs) { - _policy.set_vm_policy(Session, xenRef, _policy.opaque_ref); + VM.set_snapshot_schedule(Session, xenRef, _policy.opaque_ref); } - Description = (typeof(T) == typeof(VMPP)) ? Messages.ASSIGNED_PROTECTION_POLICY : Messages.ASSIGNED_VMSS_POLICY; + Description = Messages.ASSIGNED_VMSS_POLICY; } } - public class RemoveVMsFromPolicyAction : PureAsyncAction where T : XenObject + public class RemoveVMsFromPolicyAction : PureAsyncAction { private List> _selectedVMs; - private IVMPolicy _policy; + private VMSS _policy; - public RemoveVMsFromPolicyAction(IVMPolicy policy, List> selectedVMs) + public RemoveVMsFromPolicyAction(VMSS policy, List> selectedVMs) : base(policy.Connection, selectedVMs.Count == 1 ? - string.Format(typeof(T) == typeof(VMPP) ? Messages.REMOVE_VM_FROM_POLICY : Messages.REMOVE_VM_FROM_VMSS, policy.Connection.Resolve(selectedVMs[0]), policy.Name) : - string.Format(typeof(T) == typeof(VMPP) ? Messages.REMOVE_VMS_FROM_POLICY : Messages.REMOVE_VMS_FROM_VMSS, policy.Name)) + string.Format(Messages.REMOVE_VM_FROM_VMSS, policy.Connection.Resolve(selectedVMs[0]), policy.Name) : + string.Format(Messages.REMOVE_VMS_FROM_VMSS, policy.Name)) { _policy = policy; _selectedVMs = selectedVMs; @@ -87,13 +87,13 @@ namespace XenAdmin.Actions protected override void Run() { - Description = typeof(T) == typeof(VMPP) ? Messages.REMOVING_VMS_FROM_POLICY : Messages.REMOVING_VMS_FROM_VMSS; + Description = Messages.REMOVING_VMS_FROM_VMSS; foreach (var xenRef in _selectedVMs) - _policy.set_vm_policy(Session, xenRef, null); + VM.set_snapshot_schedule(Session, xenRef, null); - Description = typeof(T) == typeof(VMPP) ? Messages.REMOVED_VMS_FROM_POLICY : Messages.REMOVED_VMS_FROM_VMSS; + Description = Messages.REMOVED_VMS_FROM_VMSS; } } } diff --git a/XenModel/Actions/VMPP/TestArchiveTargetAction.cs b/XenModel/Actions/VMSS/ChangePolicyEnabledAction.cs similarity index 64% rename from XenModel/Actions/VMPP/TestArchiveTargetAction.cs rename to XenModel/Actions/VMSS/ChangePolicyEnabledAction.cs index 915ad1812..3ee9ecd4b 100644 --- a/XenModel/Actions/VMPP/TestArchiveTargetAction.cs +++ b/XenModel/Actions/VMSS/ChangePolicyEnabledAction.cs @@ -29,38 +29,33 @@ * SUCH DAMAGE. */ -using System; -using System.Collections.Generic; -using System.Text; -using XenAdmin.Network; using XenAPI; +using XenAdmin.Core; namespace XenAdmin.Actions { - public class TestArchiveTargetAction : PureAsyncAction + public class ChangePolicyEnabledAction : PureAsyncAction { - - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary _archiveConfig; - public TestArchiveTargetAction(IXenConnection connection, Dictionary archiveConfig) - : base(connection, Messages.TEST_ARCHIVE_LOCATION,true) + private VMSS _policy; + public ChangePolicyEnabledAction(VMSS policy) + : base(policy.Connection, string.Format(Messages.CHANGE_POLICY_STATUS, policy.Name)) { - _archiveConfig = archiveConfig; - + _policy = policy; + Pool = Helpers.GetPool(_policy.Connection); } protected override void Run() { - try - { - Result = Pool.test_archive_target(Session, null, _archiveConfig); - } - catch(Exception e) - { - log.Error(e.Message, e); - } - } + bool value = !_policy.enabled; + Description = value ? string.Format(Messages.ENABLING_VMSS, _policy.Name) : + string.Format(Messages.DISABLING_VMSS, _policy.Name); + VMSS.set_enabled(Session, _policy.opaque_ref, !_policy.enabled); + + Description = value ? string.Format(Messages.ENABLED_VMSS, _policy.Name) : + string.Format(Messages.DISABLED_VMSS, _policy.Name); + + } } } diff --git a/XenModel/Actions/VMPP/CreateVMPP.cs b/XenModel/Actions/VMSS/CreateVMPolicy.cs similarity index 61% rename from XenModel/Actions/VMPP/CreateVMPP.cs rename to XenModel/Actions/VMSS/CreateVMPolicy.cs index 2a52292f2..ef00b16ac 100644 --- a/XenModel/Actions/VMPP/CreateVMPP.cs +++ b/XenModel/Actions/VMSS/CreateVMPolicy.cs @@ -37,47 +37,38 @@ using XenAdmin.Core; namespace XenAdmin.Actions { - public class CreateVMPolicy : AsyncAction where T : XenObject + public class CreateVMPolicy : AsyncAction { - private IVMPolicy _record; + private VMSS _record; private List _vms; private bool _runNow = false; - public CreateVMPolicy(IVMPolicy record, List vms, bool runNow) + public CreateVMPolicy(VMSS record, List vms, bool runNow) : base(record.Connection, Messages.CREATE_POLICY) { _record = record; _vms = vms; _runNow = runNow; Pool = Helpers.GetPool(record.Connection); - if (typeof(T) == typeof(VMPP)) - { - ApiMethodsToRoleCheck.Add("VMPP.async_create"); - ApiMethodsToRoleCheck.Add("VM.set_protection_policy"); - ApiMethodsToRoleCheck.Add("VMPP.protect_now"); - } - else - { - ApiMethodsToRoleCheck.Add("VMSS.async_create"); - ApiMethodsToRoleCheck.Add("VM.set_snapshot_schedule"); - ApiMethodsToRoleCheck.Add("VMSS.snapshot_now"); - } + ApiMethodsToRoleCheck.Add("VMSS.async_create"); + ApiMethodsToRoleCheck.Add("VM.set_snapshot_schedule"); + ApiMethodsToRoleCheck.Add("VMSS.snapshot_now"); } protected override void Run() { - Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATING_VMPP : Messages.CREATING_VMSS, _record.Name); - RelatedTask = _record.async_task_create(Session); + Description = string.Format(Messages.CREATING_VMSS, _record.Name); + RelatedTask = VMSS.async_create(Session, _record); PollToCompletion(); - var vmppref = new XenRef(Result); - Connection.WaitForCache(vmppref); + var vmssref = new XenRef(Result); + Connection.WaitForCache(vmssref); foreach (var selectedVM in _vms) { - _record.set_policy(Session, selectedVM.opaque_ref, vmppref.opaque_ref); + VM.set_snapshot_schedule(Session, selectedVM.opaque_ref, vmssref.opaque_ref); } - Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATED_VMPP : Messages.CREATED_VMSS, _record.Name); + Description = string.Format(Messages.CREATED_VMSS, _record.Name); PercentComplete = 60; if (_runNow) - _record.run_now (Session, vmppref); + VMSS.snapshot_now(Session, vmssref); PercentComplete = 100; } } diff --git a/XenModel/Actions/VMPP/DestroyPolicyAction.cs b/XenModel/Actions/VMSS/DestroyPolicyAction.cs similarity index 76% rename from XenModel/Actions/VMPP/DestroyPolicyAction.cs rename to XenModel/Actions/VMSS/DestroyPolicyAction.cs index 6ffe44cea..b842a10c4 100644 --- a/XenModel/Actions/VMPP/DestroyPolicyAction.cs +++ b/XenModel/Actions/VMSS/DestroyPolicyAction.cs @@ -39,10 +39,10 @@ using XenAdmin.Core; namespace XenAdmin.Actions { - public class DestroyPolicyAction :PureAsyncAction where T: XenObject + public class DestroyPolicyAction: PureAsyncAction { - private List _selectedToDelete; - public DestroyPolicyAction(IXenConnection connection,List deletePolicies) : base(connection, Messages.DELETE_POLICIES) + private List _selectedToDelete; + public DestroyPolicyAction(IXenConnection connection,List deletePolicies) : base(connection, Messages.DELETE_POLICIES) { _selectedToDelete = deletePolicies; Pool = Helpers.GetPool(connection); @@ -53,14 +53,14 @@ namespace XenAdmin.Actions foreach (var policy in _selectedToDelete) { - Description = typeof(T) == typeof(VMPP) ? string.Format(Messages.DELETING_VMPP, policy.Name) : string.Format(Messages.DELETING_VMSS, policy.Name); + Description = string.Format(Messages.DELETING_VMSS, policy.Name); foreach (var vmref in policy.VMs) { - policy.set_vm_policy(Session, vmref.opaque_ref, null); + VM.set_snapshot_schedule(Session, vmref.opaque_ref, null); } try { - policy.do_destroy(Session, policy.opaque_ref); + VMSS.destroy(Session, policy.opaque_ref); } catch (Exception e) { @@ -68,7 +68,7 @@ namespace XenAdmin.Actions throw e; } } - Description = typeof(T) == typeof(VMPP) ? Messages.DELETED_VMPP : Messages.DELETED_VMSS; + Description =Messages.DELETED_VMSS; } } } diff --git a/XenModel/Actions/VMPP/RunPolicyNowAction.cs b/XenModel/Actions/VMSS/RunPolicyNowAction.cs similarity index 85% rename from XenModel/Actions/VMPP/RunPolicyNowAction.cs rename to XenModel/Actions/VMSS/RunPolicyNowAction.cs index 3930c381b..af654bbdf 100644 --- a/XenModel/Actions/VMPP/RunPolicyNowAction.cs +++ b/XenModel/Actions/VMSS/RunPolicyNowAction.cs @@ -29,17 +29,16 @@ * SUCH DAMAGE. */ -using XenAdmin.Network; using XenAPI; using XenAdmin.Core; namespace XenAdmin.Actions { - public class RunPolicyNowAction : PureAsyncAction where T : XenObject + public class RunPolicyNowAction : PureAsyncAction { - private IVMPolicy _policy; - public RunPolicyNowAction(IVMPolicy policy) + private VMSS _policy; + public RunPolicyNowAction(VMSS policy) : base(policy.Connection, string.Format(Messages.RUN_POLICY, policy.Name)) { _policy = policy; @@ -48,7 +47,7 @@ namespace XenAdmin.Actions protected override void Run() { - Result = _policy.run_now(Session, _policy.opaque_ref); + Result = VMSS.snapshot_now(Session, _policy.opaque_ref); Description = string.Format(Messages.RUN_POLICY_STARTED, _policy.Name); } } diff --git a/XenModel/Alerts/PolicyAlert.cs b/XenModel/Alerts/PolicyAlert.cs index d312dcd23..0ae153457 100644 --- a/XenModel/Alerts/PolicyAlert.cs +++ b/XenModel/Alerts/PolicyAlert.cs @@ -45,14 +45,12 @@ namespace XenAdmin.Alerts public readonly string Type; public readonly string Text; public readonly DateTime Time; - public readonly string PolicyType; public readonly int numberOfVMsFailed; public PolicyAlert(long priority, string name, DateTime _time, string body, string policyName) { Type = (priority == 4 ? "info": "error"); Time = _time; - PolicyType = "VMSS"; if(Type == "info") { @@ -101,92 +99,24 @@ namespace XenAdmin.Alerts Text = sb.ToString(); } - public PolicyAlert(IXenConnection connection, string body) - { - PolicyType = "VMPP"; - var sb = new StringBuilder(); - try - { - var xmlDocument = new XmlDocument(); - xmlDocument.LoadXml(body); - XmlNodeList _fnames = xmlDocument.GetElementsByTagName("time"); - Time = DateTime.Parse(_fnames[0].InnerText, CultureInfo.InvariantCulture); - _fnames = xmlDocument.GetElementsByTagName("messagetype"); - if (_fnames[0].InnerText == "error") - { - Type = "error"; - numberOfVMsFailed = 0; - _fnames = xmlDocument.GetElementsByTagName("error"); - for (int i = 0; i < _fnames.Count; i++) - { - XmlNode item = _fnames[i]; - foreach (XmlNode child in item.ChildNodes) - { - if (child.Name == "vm") - { - var vm = connection.Cache.Find_By_Uuid(child.InnerText); - if (vm == null) - continue; - sb.AppendFormat("VM '{0}': ", vm.Name); - numberOfVMsFailed++; - } - if (child.Name == "errorcode") - { - string text = FriendlyErrorNames.ResourceManager.GetString(child.InnerText); - if (string.IsNullOrEmpty(text)) - text = Message.FriendlyBody(child.InnerText); - sb.Append(string.IsNullOrEmpty(text) ? child.InnerText : text); - } - } - if (i + 1 < _fnames.Count) - sb.AppendLine(); - } - Text = sb.ToString(); - } - else if (_fnames[0].InnerText == "info" || _fnames[0].InnerText == "warn") - { - Type = _fnames[0].InnerText; - XmlNodeList _messages = xmlDocument.GetElementsByTagName("message"); - - foreach (XmlNode node in _messages) - { - if (node.InnerText == node.InnerXml) - { - Text = Message.FriendlyBody(node.InnerText); - break; - } - } - } - } - catch (Exception) { } - } - public string ShortFormatBody { get { + if (Type == "error") { - if (Type == "error") - { - if (PolicyType == "VMSS") - { - if (numberOfVMsFailed == 0) - { - return Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()); - } - else - { - return string.Format(Messages.VM_SNAPSHOT_SCHEDULE_FAILED, Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()), numberOfVMsFailed); - } - - } - else - { - return string.Format(Messages.VM_PROTECTION_POLICY_FAILED, Message.FriendlyName(XenAPI.Message.MessageType.VMPP_SNAPSHOT_FAILED.ToString()), numberOfVMsFailed); - } + if (numberOfVMsFailed == 0) + { + return Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()); + } + else + { + return string.Format(Messages.VM_SNAPSHOT_SCHEDULE_FAILED, + Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()), + numberOfVMsFailed); } - else return Text; } + return Text; } } diff --git a/XenModel/FriendlyNames.Designer.cs b/XenModel/FriendlyNames.Designer.cs index ab7e99f80..8347e6bca 100644 --- a/XenModel/FriendlyNames.Designer.cs +++ b/XenModel/FriendlyNames.Designer.cs @@ -842,7 +842,7 @@ namespace XenAdmin { return ResourceManager.GetString("Label-host.edition-per-socket", resourceCulture); } } - + /// /// Looks up a localized string similar to [Citrix] [XenServer product] Ultimate Edition. /// @@ -3905,132 +3905,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to The archive operation for this protection policy could not be completed.. - /// - public static string Message_body_vmpp_archive_failed_0 { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_failed_0", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please run the protection policy again later.. - /// - public static string Message_body_vmpp_archive_lock_failed { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_lock_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please check that the archive schedules for the protection policies in this pool do not clash.. - /// - public static string Message_body_vmpp_archive_missed_event { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_missed_event", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scheduled snapshot(s) have been archived successfully.. - /// - public static string Message_body_vmpp_archive_succeeded { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be mounted. Please check the VMPR archive target configuration settings.. - /// - public static string Message_body_vmpp_archive_target_mount_failed { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_target_mount_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be unmounted. Please make sure than the local directory was mounted successfully and has no open handles.. - /// - public static string Message_body_vmpp_archive_target_unmount_failed { - get { - return ResourceManager.GetString("Message.body-vmpp_archive_target_unmount_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Backup succeeded. - /// - public static string Message_body_vmpp_backup_succeeded { - get { - return ResourceManager.GetString("Message.body-vmpp_backup_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The [XenServer product] license you are using does not allow you to use the VMPR feature. VMPR is available in [Citrix] [XenServer product] Advanced Edition or higher.. - /// - public static string Message_body_vmpp_license_error { - get { - return ResourceManager.GetString("Message.body-vmpp_license_error", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The snapshot is already archived.. - /// - public static string Message_body_vmpp_snapshot_archive_already_exists { - get { - return ResourceManager.GetString("Message.body-vmpp_snapshot_archive_already_exists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The VM protection policy failed to run because a snapshot could not be created.. - /// - public static string Message_body_vmpp_snapshot_failed { - get { - return ResourceManager.GetString("Message.body-vmpp_snapshot_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create snapshots at this time because the scheduled snapshot operation for this policy is already in progress. Please try again later.. - /// - public static string Message_body_vmpp_snapshot_lock_failed { - get { - return ResourceManager.GetString("Message.body-vmpp_snapshot_lock_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create snapshots at this time because a scheduled snapshot operation is already in progress in this pool. One only VMPR snapshot operation can run at a time in the same pool. Please check that the snapshot schedules for the protection policies in this pool do not clash.. - /// - public static string Message_body_vmpp_snapshot_missed_event { - get { - return ResourceManager.GetString("Message.body-vmpp_snapshot_missed_event", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scheduled snapshot(s) have been successfully created.. - /// - public static string Message_body_vmpp_snapshot_succeeded { - get { - return ResourceManager.GetString("Message.body-vmpp_snapshot_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to log in to XAPI session.. - /// - public static string Message_body_vmpp_xapi_logon_failure { - get { - return ResourceManager.GetString("Message.body-vmpp_xapi_logon_failure", resourceCulture); - } - } - /// /// Looks up a localized string similar to The XenServer license you are using does not allow you to use the Scheduled Snapshots feature.. /// @@ -4796,132 +4670,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VMPR archive operation failed. - /// - public static string Message_name_vmpp_archive_failed_0 { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_failed_0", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR archive operation failed. - /// - public static string Message_name_vmpp_archive_lock_failed { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_lock_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR archive operation failed. - /// - public static string Message_name_vmpp_archive_missed_event { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_missed_event", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scheduled snapshot archive succeeded. - /// - public static string Message_name_vmpp_archive_succeeded { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR archive operation failed. - /// - public static string Message_name_vmpp_archive_target_mount_failed { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_target_mount_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to unmount VMPR archive target. - /// - public static string Message_name_vmpp_archive_target_unmount_failed { - get { - return ResourceManager.GetString("Message.name-vmpp_archive_target_unmount_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Backup succeeded. - /// - public static string Message_name_vmpp_backup_succeeded { - get { - return ResourceManager.GetString("Message.name-vmpp_backup_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR failed: insufficient license for VMPR. - /// - public static string Message_name_vmpp_license_error { - get { - return ResourceManager.GetString("Message.name-vmpp_license_error", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to archive snapshot. - /// - public static string Message_name_vmpp_snapshot_archive_already_exists { - get { - return ResourceManager.GetString("Message.name-vmpp_snapshot_archive_already_exists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR failed: snapshot could not be created. - /// - public static string Message_name_vmpp_snapshot_failed { - get { - return ResourceManager.GetString("Message.name-vmpp_snapshot_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR failed: snapshot could not be created. - /// - public static string Message_name_vmpp_snapshot_lock_failed { - get { - return ResourceManager.GetString("Message.name-vmpp_snapshot_lock_failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPR failed: snapshot could not be created. - /// - public static string Message_name_vmpp_snapshot_missed_event { - get { - return ResourceManager.GetString("Message.name-vmpp_snapshot_missed_event", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scheduled snapshot succeeded. - /// - public static string Message_name_vmpp_snapshot_succeeded { - get { - return ResourceManager.GetString("Message.name-vmpp_snapshot_succeeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VMPP XAPI logon failure. - /// - public static string Message_name_vmpp_xapi_logon_failure { - get { - return ResourceManager.GetString("Message.name-vmpp_xapi_logon_failure", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot schedule failed: insufficient license for Scheduled snapshots. /// diff --git a/XenModel/FriendlyNames.resx b/XenModel/FriendlyNames.resx index 91029e22d..f8edf416d 100644 --- a/XenModel/FriendlyNames.resx +++ b/XenModel/FriendlyNames.resx @@ -1103,48 +1103,6 @@ Virtual machine '{0}' did not reduce its memory usage when requested. - - The archive operation for this protection policy could not be completed. - - - Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please run the protection policy again later. - - - Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please check that the archive schedules for the protection policies in this pool do not clash. - - - Scheduled snapshot(s) have been archived successfully. - - - The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be mounted. Please check the VMPR archive target configuration settings. - - - The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be unmounted. Please make sure than the local directory was mounted successfully and has no open handles. - - - Backup succeeded - - - The [XenServer product] license you are using does not allow you to use the VMPR feature. VMPR is available in [Citrix] [XenServer product] Advanced Edition or higher. - - - The snapshot is already archived. - - - The VM protection policy failed to run because a snapshot could not be created. - - - Unable to create snapshots at this time because the scheduled snapshot operation for this policy is already in progress. Please try again later. - - - Unable to create snapshots at this time because a scheduled snapshot operation is already in progress in this pool. One only VMPR snapshot operation can run at a time in the same pool. Please check that the snapshot schedules for the protection policies in this pool do not clash. - - - Scheduled snapshot(s) have been successfully created. - - - Unable to log in to XAPI session. - The XenServer license you are using does not allow you to use the Scheduled Snapshots feature. @@ -1346,48 +1304,6 @@ VM Uncooperative - - VMPR archive operation failed - - - VMPR archive operation failed - - - VMPR archive operation failed - - - Scheduled snapshot archive succeeded - - - VMPR archive operation failed - - - Unable to unmount VMPR archive target - - - Backup succeeded - - - VMPR failed: insufficient license for VMPR - - - Unable to archive snapshot - - - VMPR failed: snapshot could not be created - - - VMPR failed: snapshot could not be created - - - VMPR failed: snapshot could not be created - - - Scheduled snapshot succeeded - - - VMPP XAPI logon failure - Snapshot schedule failed: insufficient license for Scheduled snapshots diff --git a/XenModel/InvisibleMessages.Designer.cs b/XenModel/InvisibleMessages.Designer.cs index f8302fadd..18763238b 100644 --- a/XenModel/InvisibleMessages.Designer.cs +++ b/XenModel/InvisibleMessages.Designer.cs @@ -384,15 +384,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/vmpr. - /// - public static string UPSELL_LEARNMOREURL_VM_PROTECTION { - get { - return ResourceManager.GetString("UPSELL_LEARNMOREURL_VM_PROTECTION", resourceCulture); - } - } - /// /// Looks up a localized string similar to . /// @@ -420,15 +411,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to http://support.citrix.com/article/CTX137335. - /// - public static string VMPR_DEPRECATION_URL { - get { - return ResourceManager.GetString("VMPR_DEPRECATION_URL", resourceCulture); - } - } - /// /// Looks up a localized string similar to xensearch. /// diff --git a/XenModel/InvisibleMessages.resx b/XenModel/InvisibleMessages.resx index bc2c05aed..71abe244e 100644 --- a/XenModel/InvisibleMessages.resx +++ b/XenModel/InvisibleMessages.resx @@ -225,18 +225,12 @@ http://www.citrix.com/xenserver/le/features/vapps - - http://www.citrix.com/xenserver/le/features/vmpr - http://www.citrix.com/xenserver/le/features/wlb http://store.citrix.com/XSInProduct - - http://support.citrix.com/article/CTX137335 - http://www.citrix.com/TryXenDesktop diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 9e80b8f70..8b0ffd304 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -5164,89 +5164,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Do you want to archive the selected snapshots now? - ///Archive destination: {0}. - /// - public static string ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE { - get { - return ResourceManager.GetString("ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Do you want to archive the selected snapshot now? - ///Archive destination: {0}. - /// - public static string ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE { - get { - return ResourceManager.GetString("ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archive snapshot '{0}'. - /// - public static string ARCHIVE_SNAPSHOT_X { - get { - return ResourceManager.GetString("ARCHIVE_SNAPSHOT_X", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archive Options. - /// - public static string ARCHIVE_SNAPSHOTS { - get { - return ResourceManager.GetString("ARCHIVE_SNAPSHOTS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Automatically archive scheduled snapshots. - /// - public static string ARCHIVE_SNAPSHOTS_TITLE { - get { - return ResourceManager.GetString("ARCHIVE_SNAPSHOTS_TITLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archive Snapshot Now. - /// - public static string ARCHIVE_VM_PROTECTION_TITLE { - get { - return ResourceManager.GetString("ARCHIVE_VM_PROTECTION_TITLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Example: \\server\sharename (CIFS) or server:/sharename (NFS). - /// - public static string ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH { - get { - return ResourceManager.GetString("ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archived snapshot '{0}'. - /// - public static string ARCHIVED_SNAPSHOT_X { - get { - return ResourceManager.GetString("ARCHIVED_SNAPSHOT_X", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archiving snapshot '{0}'. - /// - public static string ARCHIVING_SNAPSHOT_X { - get { - return ResourceManager.GetString("ARCHIVING_SNAPSHOT_X", resourceCulture); - } - } - /// /// Looks up a localized string similar to are empty. /// @@ -5319,33 +5236,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Assign to VM Protection Polic&y. - /// - public static string ASSIGN_PROTECTION_POLICY { - get { - return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign to VM Protection Polic&y. - /// - public static string ASSIGN_PROTECTION_POLICY_CONTEXT_MENU { - get { - return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY_CONTEXT_MENU", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign to VM Protection Policy.... - /// - public static string ASSIGN_PROTECTION_POLICY_NOAMP { - get { - return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY_NOAMP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Assign to vA&pp. /// @@ -5400,15 +5290,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Protection policy assigned.. - /// - public static string ASSIGNED_PROTECTION_POLICY { - get { - return ResourceManager.GetString("ASSIGNED_PROTECTION_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to vApp assigned.. /// @@ -5427,15 +5308,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Assigning protection policy.... - /// - public static string ASSIGNING_PROTECTION_POLICY { - get { - return ResourceManager.GetString("ASSIGNING_PROTECTION_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to Assigning vApp.... /// @@ -6812,37 +6684,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Some of the VMs you selected are already assigned to a different protection policy. - /// - ///Do you want to assign these VMs to the policy '{0}' instead?. - /// - public static string CHANGE_VMS_POLICIES_WARNING { - get { - return ResourceManager.GetString("CHANGE_VMS_POLICIES_WARNING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign VM to Protection Policy. - /// - public static string CHANGE_VMS_POLICY { - get { - return ResourceManager.GetString("CHANGE_VMS_POLICY", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The VM '{0}' is already assigned to the protection policy '{1}'. - /// - ///Do you want to assign it to the policy '{2}' instead?. - /// - public static string CHANGE_VMS_POLICY_WARNING { - get { - return ResourceManager.GetString("CHANGE_VMS_POLICY_WARNING", resourceCulture); - } - } - /// /// Looks up a localized string similar to Some of the VMs you selected are already assigned to a different snapshot schedule. /// @@ -7070,15 +6911,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Select a checkbox to add a VM to the protection policy; clear its checkbox to remove it from the policy.. - /// - public static string CHOOSE_VMS_VMPP_RUBRIC { - get { - return ResourceManager.GetString("CHOOSE_VMS_VMPP_RUBRIC", resourceCulture); - } - } - /// /// Looks up a localized string similar to Select a checkbox to add a VM to the snapshot schedule; clear its checkbox to remove it from the schedule.. /// @@ -9664,15 +9496,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM protection policy '{0}' created.. - /// - public static string CREATED_VMPP { - get { - return ResourceManager.GetString("CREATED_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot schedule '{0}' created.. /// @@ -9835,15 +9658,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Creating VM protection policy '{0}'.... - /// - public static string CREATING_VMPP { - get { - return ResourceManager.GetString("CREATING_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Creating snapshot schedule '{0}'.... /// @@ -10761,11 +10575,11 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to Delete VM Protection Policy. + /// Looks up a localized string similar to Delete Snapshot Schedule. /// - public static string DELETE_VM_PROTECTION_TITLE { + public static string DELETE_VMSS_TITLE { get { - return ResourceManager.GetString("DELETE_VM_PROTECTION_TITLE", resourceCulture); + return ResourceManager.GetString("DELETE_VMSS_TITLE", resourceCulture); } } @@ -10850,15 +10664,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM protection policies deleted.. - /// - public static string DELETED_VMPP { - get { - return ResourceManager.GetString("DELETED_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot schedules deleted.. /// @@ -10940,15 +10745,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Deleting VM protection policy '{0}'. - /// - public static string DELETING_VMPP { - get { - return ResourceManager.GetString("DELETING_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Deleting snapshot schedule '{0}'. /// @@ -11282,15 +11078,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM protection policy '{0}' disabled.. - /// - public static string DISABLED_VMPP { - get { - return ResourceManager.GetString("DISABLED_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot schedule '{0}' disabled.. /// @@ -11345,15 +11132,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Disabling VM protection policy '{0}'.... - /// - public static string DISABLING_VMPP { - get { - return ResourceManager.GetString("DISABLING_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Disabling snapshot schedule '{0}'.... /// @@ -13590,15 +13368,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM protection policy '{0}' enabled.. - /// - public static string ENABLED_VMPP { - get { - return ResourceManager.GetString("ENABLED_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot schedule '{0}' enabled.. /// @@ -13653,15 +13422,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Enabling VM protection policy '{0}'.... - /// - public static string ENABLING_VMPP { - get { - return ResourceManager.GetString("ENABLING_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to Enabling snapshot schedule '{0}'.... /// @@ -15931,15 +15691,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Enter the VM Protection Policy name and an optional description.. - /// - public static string GENERAL_PAGE_VMPP_SETTINGS { - get { - return ResourceManager.GetString("GENERAL_PAGE_VMPP_SETTINGS", resourceCulture); - } - } - /// /// Looks up a localized string similar to Enter the snapshot schedule name and an optional description.. /// @@ -23525,24 +23276,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Use this wizard to define a VM protection policy that will ensure your critical VMs are protected via automatic scheduled snapshot jobs.. - /// - public static string NEW_VMPP_PAGE_TEXT { - get { - return ResourceManager.GetString("NEW_VMPP_PAGE_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to To begin, enter a name for the policy and a description (optional), then click Next.. - /// - public static string NEW_VMPP_PAGE_TEXT_MORE { - get { - return ResourceManager.GetString("NEW_VMPP_PAGE_TEXT_MORE", resourceCulture); - } - } - /// /// Looks up a localized string similar to Use this wizard to define a snapshot schedule that will create automatic scheduled snapshot jobs for your VMs.. /// @@ -27665,26 +27398,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Unable to archive the selected snapshot(s). - /// - ///The VM protection policy for this VM does not have automatic archiving configured. Do you want to edit the policy and configure it now?. - /// - public static string POLICY_DOES_NOT_HAVE_ARCHIVE { - get { - return ResourceManager.GetString("POLICY_DOES_NOT_HAVE_ARCHIVE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Archive Snapshot Now. - /// - public static string POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE { - get { - return ResourceManager.GetString("POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE", resourceCulture); - } - } - /// /// Looks up a localized string similar to Policy Name. /// @@ -28788,15 +28501,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to A {0} user cannot create VM protection policies. Log in as a different user with sufficient privileges and try again.. - /// - public static string RBAC_WARNING_VMPP { - get { - return ResourceManager.GetString("RBAC_WARNING_VMPP", resourceCulture); - } - } - /// /// Looks up a localized string similar to A {0} user cannot create a snapshot schedule. Log in as a different user with sufficient privileges and try again.. /// @@ -29128,15 +28832,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Remove VM '{0}' from VM Protection Policy '{1}'. - /// - public static string REMOVE_VM_FROM_POLICY { - get { - return ResourceManager.GetString("REMOVE_VM_FROM_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to Remove VM '{0}' from snapshot schedule '{1}'. /// @@ -29155,15 +28850,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Remove VMs from VM Protection Policy '{1}'. - /// - public static string REMOVE_VMS_FROM_POLICY { - get { - return ResourceManager.GetString("REMOVE_VMS_FROM_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to Remove VMs from snapshot schedule '{1}'. /// @@ -29200,15 +28886,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Removed from VM Protection Policy. - /// - public static string REMOVED_VMS_FROM_POLICY { - get { - return ResourceManager.GetString("REMOVED_VMS_FROM_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to Removed from snapshot schedule. /// @@ -29263,15 +28940,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Removing from VM Protection Policy. - /// - public static string REMOVING_VMS_FROM_POLICY { - get { - return ResourceManager.GetString("REMOVING_VMS_FROM_POLICY", resourceCulture); - } - } - /// /// Looks up a localized string similar to Removing from snapshot schedule. /// @@ -32643,24 +32311,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to This VM is not currently protected with a VM protection policy. - /// - public static string THIS_VM_IS_NOT_PROTECTED { - get { - return ResourceManager.GetString("THIS_VM_IS_NOT_PROTECTED", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This VM is currently protected with VM protection policy '{0}'. - /// - public static string THIS_VM_IS_PROTECTED { - get { - return ResourceManager.GetString("THIS_VM_IS_PROTECTED", resourceCulture); - } - } - /// /// Looks up a localized string similar to is this week. /// @@ -34849,26 +34499,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Upgrade your [XenServer] license to enable VM Protection and Recovery. VM Protection and Recovery allows you to protect your critical VMs by scheduling automatic snapshots, and optionally, archiving those snapshots to a CIFS or NFS share.. - /// - public static string UPSELL_BLURB_VM_PROTECTION { - get { - return ResourceManager.GetString("UPSELL_BLURB_VM_PROTECTION", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to - /// - ///To learn more about the [XenServer] VM Protection and Recovery feature or to start a [XenServer] trial, click the button below.. - /// - public static string UPSELL_BLURB_VM_PROTECTION_MORE { - get { - return ResourceManager.GetString("UPSELL_BLURB_VM_PROTECTION_MORE", resourceCulture); - } - } - /// /// Looks up a localized string similar to Upgrade your [XenServer] license to enable VM Scheduled Snapshots. VM Scheduled Snapshost allows you to create automatic snapshots for your critical VMs.. /// @@ -35431,15 +35061,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to View VM Protection Policies. - /// - public static string VIEW_POLICIES { - get { - return ResourceManager.GetString("VIEW_POLICIES", resourceCulture); - } - } - /// /// Looks up a localized string similar to View tag.... /// @@ -36115,51 +35736,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM Pr&otection Policies.... - /// - public static string VM_PROTECTION_CONTEXT_MENU { - get { - return ResourceManager.GetString("VM_PROTECTION_CONTEXT_MENU", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VM &Protection Policies.... - /// - public static string VM_PROTECTION_MAIN_MENU { - get { - return ResourceManager.GetString("VM_PROTECTION_MAIN_MENU", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} ({1} VMs failed). - /// - public static string VM_PROTECTION_POLICY_FAILED { - get { - return ResourceManager.GetString("VM_PROTECTION_POLICY_FAILED", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pool master unreachable. - /// - public static string VM_PROTECTION_POLICY_HOST_NOT_LIVE { - get { - return ResourceManager.GetString("VM_PROTECTION_POLICY_HOST_NOT_LIVE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Succeeded. - /// - public static string VM_PROTECTION_POLICY_SUCCEEDED { - get { - return ResourceManager.GetString("VM_PROTECTION_POLICY_SUCCEEDED", resourceCulture); - } - } - /// /// Looks up a localized string similar to This VM is not using read caching. /// @@ -36349,114 +35925,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to VM Protection Policy. - /// - public static string VMPP { - get { - return ResourceManager.GetString("VMPP", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Protect your critical VMs with a protection policy that takes regular scheduled snapshots and, optionally, archives the snapshots to a CIFS or NFS share.. - /// - public static string VMPP_DIALOG_TEXT { - get { - return ResourceManager.GetString("VMPP_DIALOG_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VM Protection Policies. - /// - public static string VMPP_DIALOG_TITLE { - get { - return ResourceManager.GetString("VMPP_DIALOG_TITLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Send &email notifications about VM protection job alerts. - /// - public static string VMPP_EMAIL_CHECKBOX_TEXT { - get { - return ResourceManager.GetString("VMPP_EMAIL_CHECKBOX_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to XenServer can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails.. - /// - public static string VMPP_EMAIL_PAGE_TEXT { - get { - return ResourceManager.GetString("VMPP_EMAIL_PAGE_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to &Run the new VM protection job when I click Finish. - /// - public static string VMPP_FINISH_PAGE_CHECKBOX_TEXT { - get { - return ResourceManager.GetString("VMPP_FINISH_PAGE_CHECKBOX_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Review the new VM protection policy below and click Previous if you want to change any settings or Finish to create the new policy.. - /// - public static string VMPP_FINISH_PAGE_TEXT { - get { - return ResourceManager.GetString("VMPP_FINISH_PAGE_TEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Create the new policy. - /// - public static string VMPP_FINISH_TITLE { - get { - return ResourceManager.GetString("VMPP_FINISH_TITLE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VM protection policies defined in pool '{0}' ({1} out of {2} VMs currently protected):. - /// - public static string VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL { - get { - return ResourceManager.GetString("VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VM protection policies defined in server '{0}' ({1} out of {2} VMs currently protected):. - /// - public static string VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER { - get { - return ResourceManager.GetString("VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to protection policy. - /// - public static string VMPP_TYPE { - get { - return ResourceManager.GetString("VMPP_TYPE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to New VM Protection Policy. - /// - public static string VMPP_WIZARD_TITLE { - get { - return ResourceManager.GetString("VMPP_WIZARD_TITLE", resourceCulture); - } - } - /// /// Looks up a localized string similar to VMs. /// @@ -36592,6 +36060,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Pool master unreachable. + /// + public static string VMSS_HOST_NOT_LIVE { + get { + return ResourceManager.GetString("VMSS_HOST_NOT_LIVE", resourceCulture); + } + } + /// /// Looks up a localized string similar to VM Snaps&hot Schedules.... /// @@ -36655,6 +36132,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Succeeded. + /// + public static string VMSS_SUCCEEDED { + get { + return ResourceManager.GetString("VMSS_SUCCEEDED", resourceCulture); + } + } + /// /// Looks up a localized string similar to schedule. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index ae305d500..391f3c1d2 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -1897,35 +1897,6 @@ Apply update '{0}' to server '{1}'... - - Archived snapshot '{0}' - - - Archive Options - - - Automatically archive scheduled snapshots - - - Do you want to archive the selected snapshots now? -Archive destination: {0} - - - Do you want to archive the selected snapshot now? -Archive destination: {0} - - - Archive snapshot '{0}' - - - Example: \\server\sharename (CIFS) or server:/sharename (NFS) - - - Archive Snapshot Now - - - Archiving snapshot '{0}' - are empty @@ -1944,18 +1915,12 @@ Archive destination: {0} {0}: Can recover VM check - - Protection policy assigned. - Snapshot schedule assigned. vApp assigned. - - Assigning protection policy... - Assigning to a snapshot schedule... @@ -1968,15 +1933,6 @@ Archive destination: {0} License Details - - Assign to VM Protection Polic&y - - - Assign to VM Protection Polic&y - - - Assign to VM Protection Policy... - Assign VM to snapsh&ot schedule @@ -2489,19 +2445,6 @@ Do you want to assign these VMs to the vApp '{0}' instead? The VM '{0}' is already assigned to the vApp '{1}'. Do you want to assign it to the vApp '{2}' instead? - - - Some of the VMs you selected are already assigned to a different protection policy. - -Do you want to assign these VMs to the policy '{0}' instead? - - - Assign VM to Protection Policy - - - The VM '{0}' is already assigned to the protection policy '{1}'. - -Do you want to assign it to the policy '{2}' instead? Some of the VMs you selected are already assigned to a different snapshot schedule. @@ -2567,9 +2510,6 @@ Do you want to assign it to the schedule '{2}' instead? Select a checkbox to add a VM to the vApp; clear its checkbox to remove it from the vApp. - - Select a checkbox to add a VM to the protection policy; clear its checkbox to remove it from the policy. - Select a checkbox to add a VM to the snapshot schedule; clear its checkbox to remove it from the schedule. @@ -3459,9 +3399,6 @@ For optimal performance and reliability during VM migration, ensure that the net Created new folders - - VM protection policy '{0}' created. - Snapshot schedule '{0}' created. @@ -3537,9 +3474,6 @@ For optimal performance and reliability during VM migration, ensure that the net Creating new folders... - - Creating VM protection policy '{0}'... - Creating snapshot schedule '{0}'... @@ -3768,9 +3702,6 @@ For optimal performance and reliability during VM migration, ensure that the net Deleted tags - - VM protection policies deleted. - Snapshot schedules deleted. @@ -3874,15 +3805,15 @@ This will also delete its subfolders. &Delete Virtual Disk + + Delete Snapshot Schedule + Delete vApps Delete vApp - - Delete VM Protection Policy - Delete WLB Optimization Scheduler @@ -3910,9 +3841,6 @@ This will also delete its subfolders. Deleting tags - - Deleting VM protection policy '{0}' - Deleting snapshot schedule '{0}' @@ -4003,9 +3931,6 @@ This will also delete its subfolders. No updates found because automatic checking for updates is disabled. - - VM protection policy '{0}' disabled. - Snapshot schedule '{0}' disabled. @@ -4048,9 +3973,6 @@ This will also delete its subfolders. Disabling HA on pool '{0}' - - Disabling VM protection policy '{0}'... - Disabling snapshot schedule '{0}'... @@ -4784,9 +4706,6 @@ Would you like to eject these ISOs before continuing? Enabled - - VM protection policy '{0}' enabled. - Snapshot schedule '{0}' enabled. @@ -4826,9 +4745,6 @@ Would you like to eject these ISOs before continuing? Enabling HA on pool '{0}' - - Enabling VM protection policy '{0}'... - Enabling snapshot schedule '{0}'... @@ -5583,9 +5499,6 @@ Would you like to eject these ISOs before continuing? : - - Enter the VM Protection Policy name and an optional description. - Enter the snapshot schedule name and an optional description. @@ -8784,12 +8697,6 @@ It is strongly recommended that you Cancel and apply the latest version of the p New Update Available - {0} - - Use this wizard to define a VM protection policy that will ensure your critical VMs are protected via automatic scheduled snapshot jobs. - - - To begin, enter a name for the policy and a description (optional), then click Next. - Use this wizard to define a snapshot schedule that will create automatic scheduled snapshot jobs for your VMs. @@ -9629,14 +9536,6 @@ Please reconnect the host and try again Wake on LAN - - Unable to archive the selected snapshot(s). - -The VM protection policy for this VM does not have automatic archiving configured. Do you want to edit the policy and configure it now? - - - Archive Snapshot Now - Policy Name @@ -10005,9 +9904,6 @@ You must reconnect to {1} using an account with Pool Administrator permissions b A {0} user cannot create new SRs. Log in as a different user with sufficient privileges and try again. - - A {0} user cannot create VM protection policies. Log in as a different user with sufficient privileges and try again. - A {0} user cannot create a snapshot schedule. Log in as a different user with sufficient privileges and try again. @@ -10081,9 +9977,6 @@ To log out of this server and log in again using a different user account, enter Removed from vApp - - Removed from VM Protection Policy - Removed from snapshot schedule @@ -10153,18 +10046,12 @@ Click Server Status Report to open the Compile Server Status Report Wizard or cl Remove VMs from vApp '{0}' - - Remove VMs from VM Protection Policy '{1}' - Remove VMs from snapshot schedule '{1}' Remove VM '{0}' from vApp '{1}' - - Remove VM '{0}' from VM Protection Policy '{1}' - Remove VM '{0}' from snapshot schedule '{1}' @@ -10183,9 +10070,6 @@ Click Server Status Report to open the Compile Server Status Report Wizard or cl Removing from vApp - - Removing from VM Protection Policy - Removing from snapshot schedule @@ -11322,12 +11206,6 @@ Refer to the "[XenServer product] Administrator's Guide" for instructions on how This VM is not currently part of a snapshot schedule - - This VM is not currently protected with a VM protection policy - - - This VM is currently protected with VM protection policy '{0}' - is this week @@ -12089,14 +11967,6 @@ To learn more about the [XenServer] VM Scheduled Snapshots feature or to start a To learn more about the vApps feature of [XenServer] or to start a [XenServer] trial, click the button below. - - - Upgrade your [XenServer] license to enable VM Protection and Recovery. VM Protection and Recovery allows you to protect your critical VMs by scheduling automatic snapshots, and optionally, archiving those snapshots to a CIFS or NFS share. - - - - -To learn more about the [XenServer] VM Protection and Recovery feature or to start a [XenServer] trial, click the button below. Upgrade your [XenServer] license to enable Dynamic Workload Balancing. Dynamic Workload Balancing continually profiles your virtual machines’ and [XenServer] hosts’ performance and will intelligently rebalance and optimally place new workloads to ensure the best use of physical server resources in your resource pool. @@ -12280,9 +12150,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta Organization Views - - View VM Protection Policies - View tag... @@ -12364,42 +12231,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta VM - - VM Protection Policy - - - Protect your critical VMs with a protection policy that takes regular scheduled snapshots and, optionally, archives the snapshots to a CIFS or NFS share. - - - VM Protection Policies - - - Send &email notifications about VM protection job alerts - - - XenServer can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails. - - - &Run the new VM protection job when I click Finish - - - Review the new VM protection policy below and click Previous if you want to change any settings or Finish to create the new policy. - - - Create the new policy - - - VM protection policies defined in pool '{0}' ({1} out of {2} VMs currently protected): - - - VM protection policies defined in server '{0}' ({1} out of {2} VMs currently protected): - - - protection policy - - - New VM Protection Policy - VMs @@ -12433,6 +12264,9 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta Create the new schedule + + Pool master unreachable + VM Snaps&hot Schedules... @@ -12454,6 +12288,9 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta Snapshot schedules defined in server '{0}' ({1} out of {2} VMs currently in schedule): + + Succeeded + schedule @@ -12622,21 +12459,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta This VM is paused. - - VM Pr&otection Policies... - - - VM &Protection Policies... - - - {0} ({1} VMs failed) - - - Pool master unreachable - - - Succeeded - This VM is not using read caching diff --git a/XenModel/Network/Cache.cs b/XenModel/Network/Cache.cs index cfbf590af..6b9394922 100644 --- a/XenModel/Network/Cache.cs +++ b/XenModel/Network/Cache.cs @@ -89,7 +89,6 @@ namespace XenAdmin.Network private readonly ChangeableDictionary, VM> _vm = new ChangeableDictionary, VM>(); private readonly ChangeableDictionary, VM_metrics> _vm_metrics = new ChangeableDictionary, VM_metrics>(); private readonly ChangeableDictionary, VM_guest_metrics> _vm_guest_metrics = new ChangeableDictionary, VM_guest_metrics>(); - private readonly ChangeableDictionary, VMPP> _vmmp = new ChangeableDictionary, VMPP>(); private readonly ChangeableDictionary, VMSS> _vmss = new ChangeableDictionary, VMSS>(); private readonly ChangeableDictionary, VM_appliance> _vm_appliance = new ChangeableDictionary, VM_appliance>(); private readonly ChangeableDictionary, Crashdump> _crashdump = new ChangeableDictionary, Crashdump>(); @@ -116,11 +115,6 @@ namespace XenAdmin.Network get { return contents(_bond); } } - public VMPP[] VMPPs - { - get { return contents(_vmmp); } - } - public VMSS[] VMSSs { get { return contents(_vmss); } diff --git a/XenModel/Network/ICache.cs b/XenModel/Network/ICache.cs index d12102c14..83aa9b90b 100644 --- a/XenModel/Network/ICache.cs +++ b/XenModel/Network/ICache.cs @@ -78,7 +78,6 @@ namespace XenAdmin.Network VGPU[] VGPUs { get; } VGPU_type[] VGPU_types { get; } VIF[] VIFs { get; } - VMPP[] VMPPs { get; } VMSS[] VMSSs { get; } VM_appliance[] VM_appliances { get; } VM[] VMs { get; } diff --git a/XenModel/Utils/Helpers.cs b/XenModel/Utils/Helpers.cs index bc76a617a..215e2be26 100755 --- a/XenModel/Utils/Helpers.cs +++ b/XenModel/Utils/Helpers.cs @@ -1615,11 +1615,6 @@ namespace XenAdmin.Core if (sr != null) return sr; break; - case cls.VMPP: - VMPP vmpp = message.Connection.Cache.Find_By_Uuid(message.obj_uuid); - if (vmpp != null) - return vmpp; - break; case cls.VMSS: VMSS vmss = message.Connection.Cache.Find_By_Uuid(message.obj_uuid); if (vmss != null) diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 45397cb0f..1e8885fba 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -296,16 +296,6 @@ namespace XenAPI get { return BoolKeyPreferTrue(license_params, "restrict_pooling"); } } - public static bool RestrictVMProtection(Host h) - { - return h._RestrictVMProtection; - } - - private bool _RestrictVMProtection - { - get { return BoolKeyPreferTrue(license_params, "restrict_vmpr"); } - } - public static bool RestrictVMSnapshotSchedule(Host h) { return h._RestrictVMSnapshotSchedule; diff --git a/XenModel/XenAPI-Extensions/IVMPolicy.cs b/XenModel/XenAPI-Extensions/IVMPolicy.cs deleted file mode 100644 index 1b84e6343..000000000 --- a/XenModel/XenAPI-Extensions/IVMPolicy.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using XenAdmin; -using XenAdmin.Alerts; -using XenAdmin.Core; -using XenAdmin.Network; -using XenAdmin.Actions; - -/* Interface that will be implemented by VMSS and VMPP XenObjects*/ -namespace XenAPI -{ - public enum policy_frequency - { - hourly, daily, weekly, unknown - } - - public enum policy_backup_type - { - snapshot, checkpoint, snapshot_with_quiesce, unknown - } - - public interface IVMPolicy - { - string Name { get; } - string name_description {get; } - string uuid { get; } - List> VMs { get; } - IXenConnection Connection { get; } - bool is_enabled { get; } - bool is_running { get; } - bool is_archiving { get; } - string LastResult { get;} - DateTime GetNextRunTime(); - DateTime GetNextArchiveRunTime(); - Type _Type { get; } - List PolicyAlerts { get; } - bool hasArchive { get; } - void set_vm_policy(Session session, string _vm, string _value); - void do_destroy(Session session, string _policy); - string run_now(Session session, string _policy); - string opaque_ref { get; } - void set_is_enabled(Session session, string _policy, bool _is_enabled); - PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow); - policy_frequency policy_frequency { get; set; } - Dictionary policy_schedule { get; set; } - long policy_retention { get; set; } - string backup_schedule_min { get; } - string backup_schedule_hour { get; } - string backup_schedule_days { get; } - policy_backup_type policy_type { get; set; } - XenRef async_task_create(Session session); - void set_policy(Session session, string _vm, string _value); - - } -} diff --git a/XenModel/XenAPI-Extensions/VMPP.cs b/XenModel/XenAPI-Extensions/VMPP.cs deleted file mode 100644 index a45e90de1..000000000 --- a/XenModel/XenAPI-Extensions/VMPP.cs +++ /dev/null @@ -1,512 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using XenAdmin; -using XenAdmin.Alerts; -using XenAdmin.Core; -using XenAdmin.Network; -using XenAdmin.Actions; - -namespace XenAPI -{ - public partial class VMPP : IVMPolicy - { - public DateTime GetNextRunTime() - { - var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref); - - if (backup_frequency == vmpp_backup_frequency.hourly) - { - return GetHourlyDate(time, Convert.ToInt32(backup_schedule_min)); - } - if (backup_frequency == vmpp_backup_frequency.daily) - { - - var hour = Convert.ToInt32(backup_schedule_hour); - var min = Convert.ToInt32(backup_schedule_min); - return GetDailyDate(time, min, hour); - - } - if (backup_frequency == vmpp_backup_frequency.weekly) - { - var hour = Convert.ToInt32(backup_schedule_hour); - var min = Convert.ToInt32(backup_schedule_min); - return GetWeeklyDate(time, hour, min, new List(DaysOfWeekBackup)); - } - return new DateTime(); - - } - - public static DateTime GetDailyDate(DateTime time, int min, int hour) - { - var nextDateTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0); - if (time > nextDateTime) - nextDateTime = nextDateTime.AddDays(1); - return nextDateTime; - } - - public static DateTime GetHourlyDate(DateTime time, int min) - { - var nextDateTime = new DateTime(time.Year, time.Month, time.Day, time.Hour, min, 0); - if (time > nextDateTime) - nextDateTime = nextDateTime.AddHours(1); - return nextDateTime; - } - - public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List listDaysOfWeek) - { - listDaysOfWeek.Sort(); - - int daysOfDifference; - DayOfWeek today = time.DayOfWeek; - - int nextDay = listDaysOfWeek.FindIndex(x => x >= time.DayOfWeek); - - // No scheduled days later in the week: take first day next week - if (nextDay < 0) - { - daysOfDifference = 7 - (today - listDaysOfWeek[0]); - } - else - { - daysOfDifference = listDaysOfWeek[nextDay] - today; - - // Today is a scheduled day: but is the time already past? - if (daysOfDifference == 0) - { - var todaysScheduledTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0); - if (time > todaysScheduledTime) - { - // Yes, the time is already past. Find the next day in the schedule instead. - if (listDaysOfWeek.Count == nextDay + 1) // we're at the last scheduled day in the week: go to next week - daysOfDifference = 7 - (today - listDaysOfWeek[0]); - else - daysOfDifference = listDaysOfWeek[nextDay + 1] - today; - } - } - } - return (new DateTime(time.Year, time.Month, time.Day, hour, min, 0)).AddDays(daysOfDifference); - - } - - public IEnumerable DaysOfWeekBackup - { - get - { - return GetDaysFromDictionary(backup_schedule); - } - } - - private static IEnumerable GetDaysFromDictionary(Dictionary dictionary) - { - if (dictionary.ContainsKey("days")) - { - if (dictionary["days"].IndexOf("monday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Monday; - if (dictionary["days"].IndexOf("tuesday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Tuesday; - if (dictionary["days"].IndexOf("wednesday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Wednesday; - if (dictionary["days"].IndexOf("thursday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Thursday; - if (dictionary["days"].IndexOf("friday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Friday; - if (dictionary["days"].IndexOf("saturday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Saturday; - if (dictionary["days"].IndexOf("sunday", StringComparison.InvariantCultureIgnoreCase) >= 0) - yield return DayOfWeek.Sunday; - } - } - - public IEnumerable DaysOfWeekArchive - { - get - { - return GetDaysFromDictionary(archive_schedule); - - } - } - - public override string Name - { - get { return name_label; } - } - - public override string Description - { - get { return name_description; } - } - - public bool is_enabled - { - get { return this.is_policy_enabled; } - } - - public bool is_running - { - get { return this.is_backup_running; } - } - - public bool is_archiving - { - get { return this.is_archive_running; } - } - - public Type _Type - { - get {return typeof(VMPP);} - } - - public List PolicyAlerts - { - get { return RecentAlerts;} - } - - public bool hasArchive - { - get { return true; } - } - - public void set_vm_policy(Session session, string _vm, string _value) - { - VM.set_protection_policy(session, _vm, _value); - } - - public void do_destroy(Session session, string _policy) - { - VMPP.destroy(session, _policy); - } - - public string run_now(Session session, string _policy) - { - return VMPP.protect_now(session, _policy); - } - - public void set_is_enabled(Session session, string _policy, bool _is_enabled) - { - VMPP.set_is_policy_enabled(session, _policy, _is_enabled); - } - - public PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow) - { - return new GetVMPPAlertsAction((VMPP)policy, hoursfromnow); - } - - public policy_frequency policy_frequency - { - get - { - switch(backup_frequency) - { - case vmpp_backup_frequency.hourly: - return policy_frequency.hourly; - case vmpp_backup_frequency.daily: - return policy_frequency.daily; - case vmpp_backup_frequency.weekly: - return policy_frequency.weekly; - default: - return policy_frequency.unknown; - } - } - - set - { - switch (value) - { - case policy_frequency.hourly: - backup_frequency = vmpp_backup_frequency.hourly; - break; - case policy_frequency.daily: - backup_frequency = vmpp_backup_frequency.daily; - break; - case policy_frequency.weekly: - backup_frequency = vmpp_backup_frequency.weekly; - break; - default: - backup_frequency = vmpp_backup_frequency.unknown; - break; - } - } - } - - public Dictionary policy_schedule - { - get { return backup_schedule; } - set { backup_schedule = value; } - } - - public long policy_retention - { - get { return backup_retention_value; } - set { backup_retention_value = value; } - } - - public policy_backup_type policy_type - { - get - { - switch(backup_type) - { - case vmpp_backup_type.checkpoint: - return policy_backup_type.checkpoint; - case vmpp_backup_type.snapshot: - return policy_backup_type.snapshot; - default: - return policy_backup_type.unknown; - } - } - - set - { - switch (value) - { - case policy_backup_type.checkpoint: - backup_type = vmpp_backup_type.checkpoint; - break; - case policy_backup_type.snapshot: - backup_type = vmpp_backup_type.snapshot; - break; - default: - backup_type = vmpp_backup_type.unknown; - break; - } - } - } - - public XenRef async_task_create(Session session) - { - return VMPP.async_create(session, (VMPP)this); - } - - public void set_policy(Session session, string _vm, string _value) - { - VM.set_protection_policy(session, _vm, _value); - } - - public string alarm_config_smtp_server - { - get - { - return TryGetKey(alarm_config, "smtp_server"); - } - } - - public string alarm_config_smtp_port - { - get - { - return TryGetKey(alarm_config, "smtp_port"); - } - } - - public static string TryGetKey(Dictionary dict, string key) - { - string r; - if (dict.TryGetValue(key, out r)) - { - return r; - } - return ""; - } - - public string alarm_config_email_address - { - get - { - return TryGetKey(alarm_config, "email_address"); - } - } - - public DateTime GetNextArchiveRunTime() - { - var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref); - if (archive_frequency == vmpp_archive_frequency.daily) - { - return GetDailyDate(time, - Convert.ToInt32(archive_schedule_min), - Convert.ToInt32(archive_schedule_hour)); - } - if (archive_frequency == vmpp_archive_frequency.weekly) - { - var hour = Convert.ToInt32(archive_schedule_hour); - var min = Convert.ToInt32(archive_schedule_min); - return GetWeeklyDate(time, hour, min, new List(DaysOfWeekArchive)); - } - if (archive_frequency == vmpp_archive_frequency.always_after_backup) - return GetNextRunTime(); - return DateTime.MinValue; - - } - - public string archive_target_config_location - { - get - { - - return TryGetKey(archive_target_config, "location"); - } - } - - public string archive_target_config_username - { - get - { - return TryGetKey(archive_target_config, "username"); - } - } - - public string archive_target_config_password_uuid - { - get - { - - return TryGetKey(archive_target_config, "password"); - } - } - - public string archive_target_config_password_value - { - get - { - string uuid = archive_target_config_password_uuid; - try - { - string opaqueref = Secret.get_by_uuid(Connection.Session, uuid); - return Secret.get_value(Connection.Session, opaqueref); - } - catch (Exception) - { - return ""; - } - } - } - - - public string backup_schedule_min - { - get - { - return TryGetKey(backup_schedule, "min"); - } - } - - public string backup_schedule_hour - { - get - { - - return TryGetKey(backup_schedule, "hour"); - } - } - - public string backup_schedule_days - { - get - { - - return TryGetKey(backup_schedule, "days"); - } - } - - public string archive_schedule_min - { - get - { - return TryGetKey(archive_schedule, "min"); - } - } - - public string archive_schedule_hour - { - get - { - - return TryGetKey(archive_schedule, "hour"); - } - } - - public string archive_schedule_days - { - get - { - - return TryGetKey(archive_schedule, "days"); - } - } - private List _alerts = new List(); - - public List Alerts - { - get - { - foreach (var recent in RecentAlerts) - { - if (!_alerts.Contains(recent)) - _alerts.Add(recent); - } - return _alerts; - } - set { _alerts = value; } - } - - public List RecentAlerts - { - get - { - List result = new List(); - foreach (var body in recent_alerts) - { - result.Add(new PolicyAlert(Connection, body)); - } - return result; - } - } - - public string LastResult - { - get - { - if (_recent_alerts.Length > 0) - { - var listRecentAlerts = new List(RecentAlerts); - listRecentAlerts.Sort((x, y) => y.Time.CompareTo(x.Time)); - if (listRecentAlerts[0].Type == "info") - return Messages.VM_PROTECTION_POLICY_SUCCEEDED; - - return Messages.FAILED; - } - return Messages.NOT_YET_RUN; - } - } - } -} diff --git a/XenModel/XenAPI-Extensions/VMSS.cs b/XenModel/XenAPI-Extensions/VMSS.cs index c7376cbda..fd3e5d5b7 100644 --- a/XenModel/XenAPI-Extensions/VMSS.cs +++ b/XenModel/XenAPI-Extensions/VMSS.cs @@ -39,161 +39,18 @@ using XenAdmin.Actions; namespace XenAPI { - public partial class VMSS : IVMPolicy + public partial class VMSS { - public bool is_enabled - { - get { return this.enabled; } - } - public bool is_running { get { return false; } } - public bool is_archiving - { - get { return false; } - } - public DateTime GetNextArchiveRunTime() - { - /*Not supported*/ - return new DateTime(); - } - public Type _Type - { - get { return typeof(VMSS); } - } public List PolicyAlerts { get { return Alerts; } } - public bool hasArchive - { - get { return false; } - } - - public void set_vm_policy(Session session, string _vm, string _value) - { - VM.set_snapshot_schedule(session, _vm, _value); - } - - public void do_destroy(Session session, string _policy) - { - VMSS.destroy(session, _policy); - } - - public string run_now(Session session, string _policy) - { - return VMSS.snapshot_now(session, _policy); - } - - public void set_is_enabled(Session session, string _policy, bool _is_enabled) - { - VMSS.set_enabled(session, _policy, _is_enabled); - } - - public PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow) - { - return new GetVMSSAlertsAction((VMSS)policy, hoursfromnow); - } - - public policy_frequency policy_frequency - { - get - { - switch(frequency) - { - case vmss_frequency.hourly: - return policy_frequency.hourly; - case vmss_frequency.daily: - return policy_frequency.daily; - case vmss_frequency.weekly: - return policy_frequency.weekly; - default: - return policy_frequency.unknown; - } - } - set - { - switch (value) - { - case policy_frequency.hourly: - frequency = vmss_frequency.hourly; - break; - case policy_frequency.daily: - frequency = vmss_frequency.daily; - break; - case policy_frequency.weekly: - frequency = vmss_frequency.weekly; - break; - default: - frequency = vmss_frequency.unknown; - break; - } - } - } - - public Dictionary policy_schedule - { - get { return schedule; } - set { schedule = value; } - } - - public long policy_retention - { - get { return retained_snapshots; } - set { retained_snapshots = value; } - } - - public policy_backup_type policy_type - { - get - { - switch(type) - { - case vmss_type.checkpoint: - return policy_backup_type.checkpoint; - case vmss_type.snapshot: - return policy_backup_type.snapshot; - case vmss_type.snapshot_with_quiesce: - return policy_backup_type.snapshot_with_quiesce; - default: - return policy_backup_type.unknown; - } - } - - set - { - switch (value) - { - case policy_backup_type.checkpoint: - type = vmss_type.checkpoint; - break; - case policy_backup_type.snapshot: - type = vmss_type.snapshot; - break; - case policy_backup_type.snapshot_with_quiesce: - type = vmss_type.snapshot_with_quiesce; - break; - default: - type = vmss_type.unknown; - break; - } - } - } - - public XenRef async_task_create(Session session) - { - return VMSS.async_create(session, (VMSS)this); - } - - public void set_policy(Session session, string _vm, string _value) - { - VM.set_snapshot_schedule(session, _vm, _value); - } - public DateTime GetNextRunTime() { var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref); @@ -218,21 +75,57 @@ namespace XenAPI } return new DateTime(); - } - - private static DateTime GetDailyDate(DateTime time, int min, int hour) - { - return VMPP.GetDailyDate(time, min, hour); - } - - private static DateTime GetHourlyDate(DateTime time, int min) - { - return VMPP.GetHourlyDate(time, min); - } - - public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List listDaysOfWeek) - { - return VMPP.GetWeeklyDate(time, hour, min, listDaysOfWeek); + } + + public static DateTime GetDailyDate(DateTime time, int min, int hour) + { + var nextDateTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0); + if (time > nextDateTime) + nextDateTime = nextDateTime.AddDays(1); + return nextDateTime; + } + + public static DateTime GetHourlyDate(DateTime time, int min) + { + var nextDateTime = new DateTime(time.Year, time.Month, time.Day, time.Hour, min, 0); + if (time > nextDateTime) + nextDateTime = nextDateTime.AddHours(1); + return nextDateTime; + } + + public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List listDaysOfWeek) + { + listDaysOfWeek.Sort(); + + int daysOfDifference; + DayOfWeek today = time.DayOfWeek; + + int nextDay = listDaysOfWeek.FindIndex(x => x >= time.DayOfWeek); + + // No scheduled days later in the week: take first day next week + if (nextDay < 0) + { + daysOfDifference = 7 - (today - listDaysOfWeek[0]); + } + else + { + daysOfDifference = listDaysOfWeek[nextDay] - today; + + // Today is a scheduled day: but is the time already past? + if (daysOfDifference == 0) + { + var todaysScheduledTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0); + if (time > todaysScheduledTime) + { + // Yes, the time is already past. Find the next day in the schedule instead. + if (listDaysOfWeek.Count == nextDay + 1) // we're at the last scheduled day in the week: go to next week + daysOfDifference = 7 - (today - listDaysOfWeek[0]); + else + daysOfDifference = listDaysOfWeek[nextDay + 1] - today; + } + } + } + return (new DateTime(time.Year, time.Month, time.Day, hour, min, 0)).AddDays(daysOfDifference); } public IEnumerable DaysOfWeekBackup @@ -262,9 +155,18 @@ namespace XenAPI if (dictionary["days"].IndexOf("sunday", StringComparison.InvariantCultureIgnoreCase) >= 0) yield return DayOfWeek.Sunday; } + } + + public static string TryGetKey(Dictionary dict, string key) + { + string r; + if (dict.TryGetValue(key, out r)) + { + return r; + } + return ""; } - public override string Name { get { return name_label; } @@ -279,7 +181,7 @@ namespace XenAPI { get { - return VMPP.TryGetKey(schedule, "min"); + return TryGetKey(schedule, "min"); } } @@ -288,7 +190,7 @@ namespace XenAPI get { - return VMPP.TryGetKey(schedule, "hour"); + return TryGetKey(schedule, "hour"); } } @@ -297,7 +199,7 @@ namespace XenAPI get { - return VMPP.TryGetKey(schedule, "days"); + return TryGetKey(schedule, "days"); } } private List _alerts = new List(); @@ -319,8 +221,8 @@ namespace XenAPI { var listRecentAlerts = new List(_alerts); listRecentAlerts.Sort((x, y) => y.Time.CompareTo(x.Time)); - if (listRecentAlerts[0].Type == "info") - return Messages.VM_PROTECTION_POLICY_SUCCEEDED; + if (listRecentAlerts[0].Type == "info") + return Messages.VMSS_SUCCEEDED; return Messages.FAILED; } diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index 80381a716..f07189a07 100644 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -282,14 +282,11 @@ - - - - - - - - + + + + + @@ -330,7 +327,6 @@ - @@ -447,7 +443,6 @@ -