From f752f05a1d28dd98cb6da4ac035ed587930b449c Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 25 May 2017 14:56:13 +0100 Subject: [PATCH 1/4] CA-242134: Remove the VMPP code Signed-off-by: Mihaela Stoica --- .../AssignVMGroupToolStripMenuItem.cs | 14 +- .../Commands/Controls/ContextMenuBuilder.cs | 3 - XenAdmin/Commands/VMGroupCommand.cs | 14 +- XenAdmin/Core/Registry.cs | 9 - XenAdmin/Core/VMGroup.cs | 223 +-- XenAdmin/Dialogs/PropertiesDialog.cs | 40 +- .../VMProtectionRecovery/PolicyHistory.cs | 15 +- .../VMProtectionPoliciesDialog.cs | 181 +-- XenAdmin/Help/HelpManager.resx | 3 - XenAdmin/MainWindow.Designer.cs | 27 +- XenAdmin/MainWindow.cs | 8 +- XenAdmin/MainWindow.resx | 94 +- XenAdmin/SettingsPanels/GeneralEditPage.cs | 6 - XenAdmin/TabPages/SnapshotsPage.cs | 141 +- XenAdmin/TabPages/SnapshotsPage.designer.cs | 21 +- XenAdmin/TabPages/SnapshotsPage.resx | 30 +- .../Wizards/GenericPages/NewVMGroupVMsPage.cs | 5 +- .../NewPolicyArchivePage.Designer.cs | 366 ----- .../NewPolicyWizard/NewPolicyArchivePage.cs | 592 -------- .../NewPolicyArchivePage.ja.resx | 1194 ----------------- .../NewPolicyWizard/NewPolicyArchivePage.resx | 1194 ----------------- .../NewPolicyArchivePage.zh-CN.resx | 1194 ----------------- .../NewPolicyEmailPage.Designer.cs | 169 --- .../NewPolicyWizard/NewPolicyEmailPage.cs | 257 ---- .../NewPolicyEmailPage.ja.resx | 501 ------- .../NewPolicyWizard/NewPolicyEmailPage.resx | 501 ------- .../NewPolicyEmailPage.zh-CN.resx | 501 ------- .../NewPolicyPolicyNamePage.cs | 44 +- .../NewPolicySnapshotFrequencyPage.cs | 50 +- .../NewPolicySnapshotTypePage.cs | 262 +++- .../NewPolicySnapshotTypePageSpecific.cs | 304 ----- .../NewPolicyWizard/NewPolicyWizard.cs | 195 ++- .../NewPolicyWizardSpecific.cs | 278 ---- XenAdmin/XenAdmin.csproj | 37 - XenAdminTests/MockConnectionManager.cs | 2 +- XenAdminTests/TabsAndMenus/MainMenuGeorge.cs | 32 - .../TabsAndMenus/PluginTabsAndMenus.cs | 4 +- .../TabsAndMenus/TabsAndMenusBoston.cs | 4 - .../TabsAndMenus/TabsAndMenusTampa.cs | 3 +- XenAdminTests/UnitTests/VMPPGetWeeklyTests.cs | 16 +- .../WizardTests/NewPolicyWizardTest.cs | 12 +- .../XenModelTests/DestroyPolicyActionTests.cs | 22 +- .../XenModelTests/PureAsyncActionTests.cs | 20 +- XenModel/Actions/VMPP/ArchiveNowAction.cs | 76 -- .../Actions/VMPP/AssignVMsToPolicyAction.cs | 32 +- .../Actions/VMPP/ChangePolicyEnabledAction.cs | 22 +- XenModel/Actions/VMPP/CreateVMPP.cs | 35 +- XenModel/Actions/VMPP/DestroyPolicyAction.cs | 14 +- XenModel/Actions/VMPP/GetVMPPAlertsAction.cs | 68 - XenModel/Actions/VMPP/RunPolicyNowAction.cs | 9 +- .../Actions/VMPP/TestArchiveTargetAction.cs | 66 - XenModel/Alerts/PolicyAlert.cs | 9 +- XenModel/FriendlyNames.Designer.cs | 254 +--- XenModel/FriendlyNames.resx | 84 -- XenModel/InvisibleMessages.Designer.cs | 18 - XenModel/InvisibleMessages.resx | 6 - XenModel/Messages.Designer.cs | 556 +------- XenModel/Messages.resx | 196 +-- XenModel/Network/Cache.cs | 6 - XenModel/Network/ICache.cs | 1 - XenModel/Utils/Helpers.cs | 5 - XenModel/XenAPI-Extensions/Host.cs | 10 - XenModel/XenAPI-Extensions/IVMPolicy.cs | 86 -- XenModel/XenAPI-Extensions/VMPP.cs | 512 ------- XenModel/XenAPI-Extensions/VMSS.cs | 229 +--- XenModel/XenModel.csproj | 5 - 66 files changed, 785 insertions(+), 10102 deletions(-) delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.Designer.cs delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.cs delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.ja.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.zh-CN.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.Designer.cs delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.cs delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.ja.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyEmailPage.zh-CN.resx delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicySnapshotTypePageSpecific.cs delete mode 100644 XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs delete mode 100644 XenModel/Actions/VMPP/ArchiveNowAction.cs delete mode 100644 XenModel/Actions/VMPP/GetVMPPAlertsAction.cs delete mode 100644 XenModel/Actions/VMPP/TestArchiveTargetAction.cs delete mode 100644 XenModel/XenAPI-Extensions/IVMPolicy.cs delete mode 100644 XenModel/XenAPI-Extensions/VMPP.cs 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/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..b1d673ad6 100644 --- a/XenAdmin/Core/VMGroup.cs +++ b/XenAdmin/Core/VMGroup.cs @@ -31,11 +31,10 @@ using System; using System.Collections.Generic; -using System.Text; using XenAdmin.Actions; using XenAdmin.Dialogs; -using XenAdmin.Dialogs.VMPolicies; using XenAdmin.Dialogs.VMAppliances; +using XenAdmin.Dialogs.VMProtection_Recovery; using XenAdmin.Network; using XenAdmin.Wizards; using XenAdmin.Wizards.NewPolicyWizard; @@ -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 VMProtectionPoliciesDialog(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/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.cs b/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs index a2d2b36bf..5240debe6 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs +++ b/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs @@ -71,7 +71,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery } } - private IVMPolicy _policy; + private VMSS _policy; public void StartRefreshTab() { /* hoursFromNow has 3 possible values: @@ -92,12 +92,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 +202,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/VMProtectionPoliciesDialog.cs b/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs index a8a385f0e..85d2d2dee 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs +++ b/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs @@ -34,15 +34,10 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using XenAdmin.Actions; -using XenAdmin.Controls; 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; @@ -63,23 +58,10 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery 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 class PolicyRow : DataGridViewRow { private DataGridViewTextBoxCell _name = new DataGridViewTextBoxCell(); @@ -88,8 +70,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 +100,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 +115,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 +129,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 +151,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 +165,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 +217,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 +258,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 +279,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 +296,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 +327,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 +352,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 +362,7 @@ namespace XenAdmin.Dialogs.VMPolicies { get { - if (!VMGroup.isVMPolicyVMPP) - { - return "VMSnapshotSchedulesDialog"; - } - return "VMProtectionPoliciesDialog"; + return "VMSnapshotSchedulesDialog"; } } diff --git a/XenAdmin/Help/HelpManager.resx b/XenAdmin/Help/HelpManager.resx index b8398ab0d..e5555d7a5 100644 --- a/XenAdmin/Help/HelpManager.resx +++ b/XenAdmin/Help/HelpManager.resx @@ -1059,9 +1059,6 @@ 9800 - - 6536 - 6551 diff --git a/XenAdmin/MainWindow.Designer.cs b/XenAdmin/MainWindow.Designer.cs index a5ef03d17..5c41e7108 100644 --- a/XenAdmin/MainWindow.Designer.cs +++ b/XenAdmin/MainWindow.Designer.cs @@ -156,7 +156,7 @@ namespace XenAdmin this.disasterRecoveryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.drConfigureToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.DrWizardToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); - this.vMProtectionAndRecoveryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); + this.VMSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.exportResourceReportPoolToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.wlbReportsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.wlbDisconnectToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); @@ -207,7 +207,6 @@ namespace XenAdmin this.startOnHostToolStripMenuItem = new XenAdmin.Commands.StartVMOnHostToolStripMenuItem(); this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator(); this.assignSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVMSS(); - this.assignPolicyToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVMPP(); this.assignToVirtualApplianceToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVM_appliance(); this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator(); this.copyVMtoSharedStorageMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); @@ -287,7 +286,6 @@ namespace XenAdmin this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar(); - this.VMSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -922,7 +920,6 @@ namespace XenAdmin this.highAvailabilityToolStripMenuItem, this.disasterRecoveryToolStripMenuItem, this.VMSnapshotScheduleToolStripMenuItem, - this.vMProtectionAndRecoveryToolStripMenuItem, this.exportResourceReportPoolToolStripMenuItem, this.wlbReportsToolStripMenuItem, this.wlbDisconnectToolStripMenuItem, @@ -1014,11 +1011,11 @@ namespace XenAdmin this.DrWizardToolStripMenuItem.Name = "DrWizardToolStripMenuItem"; resources.ApplyResources(this.DrWizardToolStripMenuItem, "DrWizardToolStripMenuItem"); // - // vMProtectionAndRecoveryToolStripMenuItem + // VMSnapshotScheduleToolStripMenuItem // - this.vMProtectionAndRecoveryToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMPP(); - this.vMProtectionAndRecoveryToolStripMenuItem.Name = "vMProtectionAndRecoveryToolStripMenuItem"; - resources.ApplyResources(this.vMProtectionAndRecoveryToolStripMenuItem, "vMProtectionAndRecoveryToolStripMenuItem"); + this.VMSnapshotScheduleToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMSS(); + this.VMSnapshotScheduleToolStripMenuItem.Name = "VMSnapshotScheduleToolStripMenuItem"; + resources.ApplyResources(this.VMSnapshotScheduleToolStripMenuItem, "VMSnapshotScheduleToolStripMenuItem"); // // exportResourceReportPoolToolStripMenuItem // @@ -1305,7 +1302,6 @@ namespace XenAdmin this.startOnHostToolStripMenuItem, this.toolStripSeparator20, this.assignSnapshotScheduleToolStripMenuItem, - this.assignPolicyToolStripMenuItem, this.assignToVirtualApplianceToolStripMenuItem, this.toolStripMenuItem9, this.copyVMtoSharedStorageMenuItem, @@ -1363,11 +1359,6 @@ namespace XenAdmin this.assignSnapshotScheduleToolStripMenuItem.Name = "assignSnapshotScheduleToolStripMenuItem"; resources.ApplyResources(this.assignSnapshotScheduleToolStripMenuItem, "assignSnapshotScheduleToolStripMenuItem"); // - // assignPolicyToolStripMenuItem - // - this.assignPolicyToolStripMenuItem.Name = "assignPolicyToolStripMenuItem"; - resources.ApplyResources(this.assignPolicyToolStripMenuItem, "assignPolicyToolStripMenuItem"); - // // assignToVirtualApplianceToolStripMenuItem // this.assignToVirtualApplianceToolStripMenuItem.Name = "assignToVirtualApplianceToolStripMenuItem"; @@ -1896,12 +1887,6 @@ namespace XenAdmin this.statusProgressBar.Name = "statusProgressBar"; this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; // - // VMSnapshotScheduleToolStripMenuItem - // - this.VMSnapshotScheduleToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMSS(); - this.VMSnapshotScheduleToolStripMenuItem.Name = "VMSnapshotScheduleToolStripMenuItem"; - resources.ApplyResources(this.VMSnapshotScheduleToolStripMenuItem, "VMSnapshotScheduleToolStripMenuItem"); - // // MainWindow // resources.ApplyResources(this, "$this"); @@ -2125,8 +2110,6 @@ namespace XenAdmin private ToolStripMenuItem xenCenterPluginsOnlineToolStripMenuItem; private CommandToolStripMenuItem MoveVMToolStripMenuItem; private CommandToolStripMenuItem rollingUpgradeToolStripMenuItem; - private CommandToolStripMenuItem vMProtectionAndRecoveryToolStripMenuItem; - private AssignGroupToolStripMenuItemVMPP assignPolicyToolStripMenuItem; private CommandToolStripMenuItem changePoolPasswordToolStripMenuItem; private ToolStripSeparator toolStripSeparator30; private CommandToolStripMenuItem virtualAppliancesToolStripMenuItem; diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 9b4d682d3..2a50a6d64 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -1689,22 +1689,16 @@ namespace XenAdmin IXenConnection conn; conn = SelectionManager.Selection.GetConnectionOfAllItems(); - if (SelectionManager.Selection.Count > 0 && (Helpers.GetMaster(conn) != null) && (Helpers.FalconOrGreater(conn))) /* hide VMPP */ + if (SelectionManager.Selection.Count > 0 && (Helpers.GetMaster(conn) != null) && (Helpers.FalconOrGreater(conn))) { assignSnapshotScheduleToolStripMenuItem.Available = true; VMSnapshotScheduleToolStripMenuItem.Available = true; - assignPolicyToolStripMenuItem.Available = false; - vMProtectionAndRecoveryToolStripMenuItem.Available = false; - } else /* hide VMSS */ { assignSnapshotScheduleToolStripMenuItem.Available = false; VMSnapshotScheduleToolStripMenuItem.Available = false; - - assignPolicyToolStripMenuItem.Available = true; - vMProtectionAndRecoveryToolStripMenuItem.Available = true; } templatesToolStripMenuItem1.Checked = Properties.Settings.Default.DefaultTemplatesVisible; diff --git a/XenAdmin/MainWindow.resx b/XenAdmin/MainWindow.resx index 05ff27910..1245a6c1c 100644 --- a/XenAdmin/MainWindow.resx +++ b/XenAdmin/MainWindow.resx @@ -1965,12 +1965,6 @@ VM Snapshot Schedule Policies... - - 277, 22 - - - VM &Protection Policies... - 277, 22 @@ -2245,124 +2239,124 @@ Ctrl+N - 246, 22 + 245, 22 &New VM... - 246, 22 + 245, 22 &Start/Shut down - 246, 22 + 245, 22 Res&ume on Server - 246, 22 + 245, 22 M&igrate to Server - 246, 22 + 245, 22 Start &on Server - 243, 6 + 242, 6 - 246, 22 + 245, 22 Assign to Snaps&hot Schedule... - - 246, 22 - - - Assign to VM &Protection Policy... - - 246, 22 + 245, 22 Assign to &vApp - 243, 6 + 242, 6 - 246, 22 + 245, 22 &Copy VM - 246, 22 + 245, 22 &Move VM - 246, 22 + 245, 22 Ta&ke a Snapshot - 246, 22 + 245, 22 Convert to &Template - 246, 22 + 245, 22 &Export... + + 245, 22 + + + 245, 22 + - 243, 6 + 242, 6 - 246, 22 + 245, 22 Inst&all [XenServer product] Tools - 246, 22 + 245, 22 Send Ctrl+&Alt+Del - 243, 6 + 242, 6 - 246, 22 + 245, 22 &Delete VM - 243, 6 + 242, 6 - 246, 22 + 245, 22 PluginItemsPlaceHolder - 246, 22 + 245, 22 P&roperties @@ -3141,10 +3135,10 @@ XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - vMProtectionAndRecoveryToolStripMenuItem + + VMSnapshotScheduleToolStripMenuItem - + XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null @@ -3447,12 +3441,6 @@ XenAdmin.Commands.AssignGroupToolStripMenuItemVMSS, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - assignPolicyToolStripMenuItem - - - XenAdmin.Commands.AssignGroupToolStripMenuItemVMPP, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - assignToVirtualApplianceToolStripMenuItem @@ -3495,6 +3483,18 @@ XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + enablePVSReadcachingToolStripMenuItem + + + XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + disablePVSReadcachingToolStripMenuItem + + + XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + toolStripMenuItem12 @@ -3897,16 +3897,10 @@ System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - VMSnapshotScheduleToolStripMenuItem - - - XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - MainWindow System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + \ No newline at end of file diff --git a/XenAdmin/SettingsPanels/GeneralEditPage.cs b/XenAdmin/SettingsPanels/GeneralEditPage.cs index 789a55de7..3754941a3 100644 --- a/XenAdmin/SettingsPanels/GeneralEditPage.cs +++ b/XenAdmin/SettingsPanels/GeneralEditPage.cs @@ -197,12 +197,6 @@ namespace XenAdmin.SettingsPanels labelIqnHint.Visible = true; } - if (xenObjectCopy is VMPP) - { - lblFolder.Visible = labelTags.Visible = folderPanel.Visible = tagsPanel.Visible = false; - labelTitle.Text = Messages.GENERAL_PAGE_VMPP_SETTINGS; - } - if (xenObjectCopy is VMSS) { lblFolder.Visible = labelTags.Visible = folderPanel.Visible = tagsPanel.Visible = false; diff --git a/XenAdmin/TabPages/SnapshotsPage.cs b/XenAdmin/TabPages/SnapshotsPage.cs index d8bca0bda..b8ba99000 100644 --- a/XenAdmin/TabPages/SnapshotsPage.cs +++ b/XenAdmin/TabPages/SnapshotsPage.cs @@ -129,7 +129,7 @@ namespace XenAdmin.TabPages VM_BatchCollectionChanged); m_VM.PropertyChanged += snapshot_PropertyChanged; //Version setup - toolStripMenuItemScheduledSnapshots.Available = toolStripSeparatorView.Available = (Registry.VMPRFeatureEnabled && !Helpers.ClearwaterOrGreater(VM.Connection)) || !Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule); + toolStripMenuItemScheduledSnapshots.Available = toolStripSeparatorView.Available = !Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule); if (VM.SnapshotView != SnapshotsView.ListView) TreeViewChecked(); else @@ -146,8 +146,7 @@ namespace XenAdmin.TabPages BuildList(); RefreshDetailsGroupBox(true); RefreshToolStripButtons(); - RefreshVMProtectionPanel(); - RefreshArchiveNowOption(); + RefreshVMSSPanel(); } } get @@ -156,42 +155,9 @@ namespace XenAdmin.TabPages } } - private void RefreshArchiveNowOption() + private void RefreshVMSSPanel() { - if(Helpers.ClearwaterOrGreater(VM.Connection)) - { - archiveSnapshotNowToolStripMenuItem.Enabled = archiveSnapshotNowToolStripMenuItem.Visible = false; - archiveToolStripMenuItem.Enabled = archiveToolStripMenuItem.Visible = false; - } - else - { - archiveSnapshotNowToolStripMenuItem.Enabled = archiveSnapshotNowToolStripMenuItem.Visible = true; - archiveToolStripMenuItem.Enabled = archiveToolStripMenuItem.Visible = true; - } - } - - private void RefreshVMProtectionPanel() - { - if (Registry.VMPRFeatureEnabled && !Helpers.ClearwaterOrGreater(VM.Connection)) - { - panelVMPP.Visible = true; - var vmpp = VM.Connection.Resolve(VM.protection_policy); - if (vmpp == null || Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection)) - { - labelVMPPInfo.Text = Messages.THIS_VM_IS_NOT_PROTECTED; - pictureBoxVMPPInfo.Image = Resources._000_BackupMetadata_h32bit_16; - - linkLabelVMPPInfo.Text = Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection) ? Messages.TELL_ME_MORE : Messages.VIEW_POLICIES; - - } - else - { - labelVMPPInfo.Text = string.Format(Messages.THIS_VM_IS_PROTECTED, vmpp.Name); - pictureBoxVMPPInfo.Image = Resources._000_Tick_h32bit_16; - linkLabelVMPPInfo.Text = Messages.VIEW_POLICIES; - } - } - else if (Helpers.FalconOrGreater(VM.Connection)) + if (Helpers.FalconOrGreater(VM.Connection)) { panelVMPP.Visible = true; var vmss = VM.Connection.Resolve(VM.snapshot_schedule); @@ -536,9 +502,6 @@ namespace XenAdmin.TabPages case "snapshots": m_NeedToUpdate = true; break; - case "protection_policy": - RefreshVMProtectionPanel(); - break; } } @@ -624,11 +587,6 @@ namespace XenAdmin.TabPages EnableDelete(); else DisableAllButtons(); - - - //Archive now - archiveSnapshotNowToolStripMenuItem.Available = CanArchive; - } private void DisableAllButtons() @@ -1178,9 +1136,6 @@ namespace XenAdmin.TabPages { contextMenuStrip.Items.Clear(); - if (CanArchive) - contextMenuStrip.Items.Add(archiveToolStripMenuItem); - contextMenuStrip.Items.AddRange(new ToolStripItem[] { viewToolStripMenuItem, @@ -1189,14 +1144,6 @@ namespace XenAdmin.TabPages }); } - private bool CanArchive - { - get - { - var vmpp = VM.Connection.Resolve(VM.protection_policy); - return vmpp != null; - } - } private void SetContextMenuSnapshot() { @@ -1214,9 +1161,6 @@ namespace XenAdmin.TabPages exportToolStripMenuItem }); - if (CanArchive) - contextMenuStrip.Items.Add(archiveToolStripMenuItem); - contextMenuStrip.Items.AddRange(new ToolStripItem[] { separatorDeleteToolStripSeparator, @@ -1544,55 +1488,6 @@ namespace XenAdmin.TabPages } } - private void archiveToolStripMenuItem_Click(object sender, EventArgs e) - { - var vmpp = VM.Connection.Resolve(VM.protection_policy); - if (vmpp.archive_frequency != vmpp_archive_frequency.never) - { - var selectedSnapshots = GetSelectedSnapshots(); - string text = ""; - if (selectedSnapshots.Count == 1) - text = string.Format(Messages.ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE, VM.Connection.Resolve(VM.protection_policy).archive_target_config_location); - else - text = string.Format(Messages.ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE, VM.Connection.Resolve(VM.protection_policy).archive_target_config_location); - - DialogResult dialogResult; - using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Information, text, Messages.ARCHIVE_VM_PROTECTION_TITLE), - ThreeButtonDialog.ButtonYes, - ThreeButtonDialog.ButtonNo)) - { - dialogResult = dlg.ShowDialog(this); - } - if (dialogResult == DialogResult.Yes) - { - foreach (var snapshot in selectedSnapshots) - { - new ArchiveNowAction(snapshot).RunAsync(); - } - } - } - else - { - DialogResult dialogResult; - using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Error, Messages.POLICY_DOES_NOT_HAVE_ARCHIVE, Messages.POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE), - ThreeButtonDialog.ButtonYes, - ThreeButtonDialog.ButtonNo)) - { - dialogResult = dlg.ShowDialog(this); - } - if (dialogResult == DialogResult.Yes) - { - using (var dialog = new PropertiesDialog(vmpp)) - { - dialog.SelectNewPolicyArchivePage(); - dialog.ShowDialog(this); - } - } - } - } - private void button1_Click(object sender, EventArgs e) { contextMenuStripView.Show(buttonView, 0, buttonView.Height); @@ -1606,37 +1501,17 @@ namespace XenAdmin.TabPages private void linkLabelVMPPInfo_Click(object sender, LinkLabelLinkClickedEventArgs e) { - if (Helpers.DundeeOrGreater(VM.Connection)) + if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule)) { - if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection)) - { - VMGroupCommand.ShowUpsellDialog(this); - } - else - { - var command = new VMGroupCommand(Program.MainWindow, VM); - command.Execute(); - } + VMGroupCommand.ShowUpsellDialog(this); } else { - if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection)) - { - VMGroupCommand.ShowUpsellDialog(this); - } - else - { - var command = new VMGroupCommand(Program.MainWindow, VM); - command.Execute(); - } + var command = new VMGroupCommand(Program.MainWindow, VM); + command.Execute(); } } - private void saveMenuStrip_Opening(object sender, CancelEventArgs e) - { - saveMenuStrip.Items[saveMenuStrip.Items.Count - 1].Available = CanArchive; - } - private void snapshotTreeView_Leave(object sender, EventArgs e) { TreeView.Invalidate(); diff --git a/XenAdmin/TabPages/SnapshotsPage.designer.cs b/XenAdmin/TabPages/SnapshotsPage.designer.cs index c55e2820b..7c77d6a27 100644 --- a/XenAdmin/TabPages/SnapshotsPage.designer.cs +++ b/XenAdmin/TabPages/SnapshotsPage.designer.cs @@ -85,7 +85,6 @@ namespace XenAdmin.TabPages this.saveVMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.archiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.separatorDeleteToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sortByToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -114,7 +113,6 @@ namespace XenAdmin.TabPages this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.saveAsTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportAsBackupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.archiveSnapshotNowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripView = new XenAdmin.Controls.NonReopeningContextMenuStrip(this.components); this.toolStripButtonListView = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripButtonTreeView = new System.Windows.Forms.ToolStripMenuItem(); @@ -461,7 +459,6 @@ namespace XenAdmin.TabPages this.saveVMToolStripMenuItem, this.saveTemplateToolStripMenuItem, this.exportToolStripMenuItem, - this.archiveToolStripMenuItem, this.separatorDeleteToolStripSeparator, this.viewToolStripMenuItem, this.sortByToolStripMenuItem, @@ -507,12 +504,6 @@ namespace XenAdmin.TabPages resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem"); this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportSnapshotToolStripMenuItem_Click); // - // archiveToolStripMenuItem - // - this.archiveToolStripMenuItem.Name = "archiveToolStripMenuItem"; - resources.ApplyResources(this.archiveToolStripMenuItem, "archiveToolStripMenuItem"); - this.archiveToolStripMenuItem.Click += new System.EventHandler(this.archiveToolStripMenuItem_Click); - // // separatorDeleteToolStripSeparator // this.separatorDeleteToolStripSeparator.Name = "separatorDeleteToolStripSeparator"; @@ -696,11 +687,9 @@ namespace XenAdmin.TabPages this.saveAsVMToolStripMenuItem, this.toolStripSeparator2, this.saveAsTemplateToolStripMenuItem, - this.exportAsBackupToolStripMenuItem, - this.archiveSnapshotNowToolStripMenuItem}); + this.exportAsBackupToolStripMenuItem}); this.saveMenuStrip.Name = "saveMenuStrip"; resources.ApplyResources(this.saveMenuStrip, "saveMenuStrip"); - this.saveMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.saveMenuStrip_Opening); // // saveAsVMToolStripMenuItem // @@ -726,12 +715,6 @@ namespace XenAdmin.TabPages resources.ApplyResources(this.exportAsBackupToolStripMenuItem, "exportAsBackupToolStripMenuItem"); this.exportAsBackupToolStripMenuItem.Click += new System.EventHandler(this.exportAsBackupToolStripMenuItem_Click); // - // archiveSnapshotNowToolStripMenuItem - // - this.archiveSnapshotNowToolStripMenuItem.Name = "archiveSnapshotNowToolStripMenuItem"; - resources.ApplyResources(this.archiveSnapshotNowToolStripMenuItem, "archiveSnapshotNowToolStripMenuItem"); - this.archiveSnapshotNowToolStripMenuItem.Click += new System.EventHandler(this.archiveToolStripMenuItem_Click); - // // contextMenuStripView // this.contextMenuStripView.ImageScalingSize = new System.Drawing.Size(20, 20); @@ -868,7 +851,6 @@ namespace XenAdmin.TabPages private ToolTipContainer toolTipContainerRevertButton; private Label labelModeTitle; private Label labelMode; - private ToolStripMenuItem archiveToolStripMenuItem; private Panel panelPropertiesColumn; private Panel panelVMPP; private Label labelVMPPInfo; @@ -880,7 +862,6 @@ namespace XenAdmin.TabPages private ToolStripMenuItem toolStripButtonTreeView; private ToolStripSeparator toolStripSeparatorView; private ToolStripMenuItem toolStripMenuItemScheduledSnapshots; - private ToolStripMenuItem archiveSnapshotNowToolStripMenuItem; private ToolStripSeparator toolStripSeparator2; private DataGridViewTextBoxColumn Live; private DataGridViewTextBoxColumn Snapshot; diff --git a/XenAdmin/TabPages/SnapshotsPage.resx b/XenAdmin/TabPages/SnapshotsPage.resx index 55623dc34..bca758aa9 100644 --- a/XenAdmin/TabPages/SnapshotsPage.resx +++ b/XenAdmin/TabPages/SnapshotsPage.resx @@ -1411,7 +1411,7 @@ $this - 0 + 2 105, 0 @@ -1449,12 +1449,6 @@ E&xport to File... - - 209, 22 - - - &Archive Now - 206, 6 @@ -1513,7 +1507,7 @@ P&roperties - 210, 242 + 210, 220 contextMenuStrip @@ -1788,14 +1782,8 @@ E&xport to File... - - 209, 22 - - - &Archive Now - - 210, 98 + 210, 76 saveMenuStrip @@ -1890,12 +1878,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - archiveToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - separatorDeleteToolStripSeparator @@ -2016,12 +1998,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - archiveSnapshotNowToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - toolStripButtonListView diff --git a/XenAdmin/Wizards/GenericPages/NewVMGroupVMsPage.cs b/XenAdmin/Wizards/GenericPages/NewVMGroupVMsPage.cs index 7f7921a11..e132cef71 100644 --- a/XenAdmin/Wizards/GenericPages/NewVMGroupVMsPage.cs +++ b/XenAdmin/Wizards/GenericPages/NewVMGroupVMsPage.cs @@ -218,16 +218,13 @@ namespace XenAdmin.Wizards.GenericPages public override void PageLoaded(PageLoadedDirection direction) { base.PageLoaded(direction); - if (!VMGroup.isQuescingSupported) - { - this.dataGridView1.Columns["ColumnQuiesceSupported"].Visible = false; - } RefreshTab(null); } private T _group = null; private void RefreshTab(T group) { + ColumnQuiesceSupported.Visible = VMGroup.isQuescingSupported; _group = group; if (Pool != null) { diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.Designer.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.Designer.cs deleted file mode 100644 index c6279c668..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.Designer.cs +++ /dev/null @@ -1,366 +0,0 @@ -namespace XenAdmin.Wizards.NewPolicyWizard -{ - partial class NewPolicyArchivePage - { - /// - /// 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(NewPolicyArchivePage)); - this.radioButtonArchiveWeekly = new System.Windows.Forms.RadioButton(); - this.radioButtonArchiveDaily = new System.Windows.Forms.RadioButton(); - this.radioButtonArchiveASAP = new System.Windows.Forms.RadioButton(); - this.radioButtonDoNotArchive = new System.Windows.Forms.RadioButton(); - this.m_tlpDestination = new System.Windows.Forms.TableLayoutPanel(); - this.label2 = new System.Windows.Forms.Label(); - this.textBoxPath = new System.Windows.Forms.TextBox(); - this.buttonTest = new System.Windows.Forms.Button(); - this.pictureBoxTest = new System.Windows.Forms.PictureBox(); - this.checkBoxCredentials = new System.Windows.Forms.CheckBox(); - this.m_tlpCredentials = new System.Windows.Forms.TableLayoutPanel(); - this.labelUser = new System.Windows.Forms.Label(); - this.textBoxUser = new System.Windows.Forms.TextBox(); - this.labelPassword = new System.Windows.Forms.Label(); - this.textBoxPassword = new System.Windows.Forms.TextBox(); - this.m_labelError = new XenAdmin.Controls.Common.AutoHeightLabel(); - this.toolTipContainer1 = new XenAdmin.Controls.ToolTipContainer(); - this.labelDivider = new System.Windows.Forms.Label(); - this.labelRecurDaily = new System.Windows.Forms.Label(); - this.dateTimePickerDaily = new XenAdmin.Controls.DateTimeMinutes15(); - this.daysWeekCheckboxes1 = new XenAdmin.Wizards.NewPolicyWizard.DaysWeekCheckboxes(); - this.labelDays = new System.Windows.Forms.Label(); - this.labelRecurWeekly = new System.Windows.Forms.Label(); - this.dateTimePickerWeekly = new XenAdmin.Controls.DateTimeMinutes15(); - this.localServerTime1 = new XenAdmin.Wizards.NewPolicyWizard.LocalServerTime(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.autoHeightLabel1 = new XenAdmin.Controls.Common.AutoHeightLabel(); - this.sectionLabelSchedule = new XenAdmin.Controls.SectionHeaderLabel(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.m_tlpRecur = new System.Windows.Forms.TableLayoutPanel(); - this.sectionLabelDest = new XenAdmin.Controls.SectionHeaderLabel(); - this.m_tlpDestination.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTest)).BeginInit(); - this.m_tlpCredentials.SuspendLayout(); - this.toolTipContainer1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - this.m_tlpRecur.SuspendLayout(); - this.SuspendLayout(); - // - // radioButtonArchiveWeekly - // - resources.ApplyResources(this.radioButtonArchiveWeekly, "radioButtonArchiveWeekly"); - this.radioButtonArchiveWeekly.Name = "radioButtonArchiveWeekly"; - this.radioButtonArchiveWeekly.UseVisualStyleBackColor = true; - this.radioButtonArchiveWeekly.CheckedChanged += new System.EventHandler(this.radioButtonArchiveWeekly_CheckedChanged); - // - // radioButtonArchiveDaily - // - resources.ApplyResources(this.radioButtonArchiveDaily, "radioButtonArchiveDaily"); - this.radioButtonArchiveDaily.Name = "radioButtonArchiveDaily"; - this.radioButtonArchiveDaily.TabStop = true; - this.radioButtonArchiveDaily.UseVisualStyleBackColor = true; - this.radioButtonArchiveDaily.CheckedChanged += new System.EventHandler(this.radioButtonArchiveDaily_CheckedChanged); - // - // radioButtonArchiveASAP - // - resources.ApplyResources(this.radioButtonArchiveASAP, "radioButtonArchiveASAP"); - this.radioButtonArchiveASAP.Name = "radioButtonArchiveASAP"; - this.radioButtonArchiveASAP.UseVisualStyleBackColor = true; - this.radioButtonArchiveASAP.CheckedChanged += new System.EventHandler(this.radioButtonArchiveASAP_CheckedChanged); - // - // radioButtonDoNotArchive - // - resources.ApplyResources(this.radioButtonDoNotArchive, "radioButtonDoNotArchive"); - this.radioButtonDoNotArchive.Name = "radioButtonDoNotArchive"; - this.radioButtonDoNotArchive.UseVisualStyleBackColor = true; - this.radioButtonDoNotArchive.CheckedChanged += new System.EventHandler(this.radioButtonDoNotArchive_CheckedChanged); - // - // m_tlpDestination - // - resources.ApplyResources(this.m_tlpDestination, "m_tlpDestination"); - this.m_tlpDestination.Controls.Add(this.label2, 0, 0); - this.m_tlpDestination.Controls.Add(this.textBoxPath, 1, 0); - this.m_tlpDestination.Controls.Add(this.buttonTest, 2, 0); - this.m_tlpDestination.Controls.Add(this.pictureBoxTest, 3, 0); - this.m_tlpDestination.Controls.Add(this.checkBoxCredentials, 0, 2); - this.m_tlpDestination.Controls.Add(this.m_tlpCredentials, 0, 3); - this.m_tlpDestination.Controls.Add(this.m_labelError, 1, 1); - this.m_tlpDestination.Name = "m_tlpDestination"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // textBoxPath - // - resources.ApplyResources(this.textBoxPath, "textBoxPath"); - this.textBoxPath.Name = "textBoxPath"; - this.textBoxPath.TextChanged += new System.EventHandler(this.textBoxPath_TextChanged); - // - // buttonTest - // - resources.ApplyResources(this.buttonTest, "buttonTest"); - this.buttonTest.Name = "buttonTest"; - this.buttonTest.UseVisualStyleBackColor = true; - this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); - // - // pictureBoxTest - // - resources.ApplyResources(this.pictureBoxTest, "pictureBoxTest"); - this.pictureBoxTest.Cursor = System.Windows.Forms.Cursors.Default; - this.pictureBoxTest.Image = global::XenAdmin.Properties.Resources.ajax_loader; - this.pictureBoxTest.Name = "pictureBoxTest"; - this.pictureBoxTest.TabStop = false; - // - // checkBoxCredentials - // - resources.ApplyResources(this.checkBoxCredentials, "checkBoxCredentials"); - this.m_tlpDestination.SetColumnSpan(this.checkBoxCredentials, 4); - this.checkBoxCredentials.Name = "checkBoxCredentials"; - this.checkBoxCredentials.UseVisualStyleBackColor = true; - this.checkBoxCredentials.CheckedChanged += new System.EventHandler(this.checkBoxCredentials_CheckedChanged); - // - // m_tlpCredentials - // - resources.ApplyResources(this.m_tlpCredentials, "m_tlpCredentials"); - this.m_tlpDestination.SetColumnSpan(this.m_tlpCredentials, 2); - this.m_tlpCredentials.Controls.Add(this.labelUser, 1, 0); - this.m_tlpCredentials.Controls.Add(this.textBoxUser, 2, 0); - this.m_tlpCredentials.Controls.Add(this.labelPassword, 3, 0); - this.m_tlpCredentials.Controls.Add(this.textBoxPassword, 4, 0); - this.m_tlpCredentials.Name = "m_tlpCredentials"; - // - // labelUser - // - resources.ApplyResources(this.labelUser, "labelUser"); - this.labelUser.Name = "labelUser"; - // - // textBoxUser - // - resources.ApplyResources(this.textBoxUser, "textBoxUser"); - this.textBoxUser.Name = "textBoxUser"; - this.textBoxUser.TextChanged += new System.EventHandler(this.textBoxUser_TextChanged); - // - // labelPassword - // - resources.ApplyResources(this.labelPassword, "labelPassword"); - this.labelPassword.Name = "labelPassword"; - // - // textBoxPassword - // - resources.ApplyResources(this.textBoxPassword, "textBoxPassword"); - this.textBoxPassword.Name = "textBoxPassword"; - this.textBoxPassword.TextChanged += new System.EventHandler(this.textBoxPassword_TextChanged); - // - // m_labelError - // - resources.ApplyResources(this.m_labelError, "m_labelError"); - this.m_labelError.ForeColor = System.Drawing.Color.Red; - this.m_labelError.Name = "m_labelError"; - // - // toolTipContainer1 - // - resources.ApplyResources(this.toolTipContainer1, "toolTipContainer1"); - this.toolTipContainer1.Controls.Add(this.radioButtonArchiveDaily); - this.toolTipContainer1.Name = "toolTipContainer1"; - this.toolTipContainer1.TabStop = true; - // - // labelDivider - // - this.labelDivider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - resources.ApplyResources(this.labelDivider, "labelDivider"); - this.labelDivider.Name = "labelDivider"; - this.tableLayoutPanel5.SetRowSpan(this.labelDivider, 4); - // - // labelRecurDaily - // - resources.ApplyResources(this.labelRecurDaily, "labelRecurDaily"); - this.labelRecurDaily.Name = "labelRecurDaily"; - // - // dateTimePickerDaily - // - resources.ApplyResources(this.dateTimePickerDaily, "dateTimePickerDaily"); - this.dateTimePickerDaily.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.dateTimePickerDaily.Name = "dateTimePickerDaily"; - this.dateTimePickerDaily.ShowUpDown = true; - this.dateTimePickerDaily.Value = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); - // - // daysWeekCheckboxes1 - // - resources.ApplyResources(this.daysWeekCheckboxes1, "daysWeekCheckboxes1"); - this.m_tlpRecur.SetColumnSpan(this.daysWeekCheckboxes1, 2); - this.daysWeekCheckboxes1.Days = ""; - this.daysWeekCheckboxes1.Name = "daysWeekCheckboxes1"; - // - // labelDays - // - resources.ApplyResources(this.labelDays, "labelDays"); - this.m_tlpRecur.SetColumnSpan(this.labelDays, 2); - this.labelDays.Name = "labelDays"; - // - // labelRecurWeekly - // - resources.ApplyResources(this.labelRecurWeekly, "labelRecurWeekly"); - this.labelRecurWeekly.Name = "labelRecurWeekly"; - // - // dateTimePickerWeekly - // - resources.ApplyResources(this.dateTimePickerWeekly, "dateTimePickerWeekly"); - this.dateTimePickerWeekly.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.dateTimePickerWeekly.Name = "dateTimePickerWeekly"; - this.dateTimePickerWeekly.ShowUpDown = true; - this.dateTimePickerWeekly.Value = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); - // - // localServerTime1 - // - resources.ApplyResources(this.localServerTime1, "localServerTime1"); - this.localServerTime1.Name = "localServerTime1"; - this.localServerTime1.TabStop = false; - // - // tableLayoutPanel2 - // - resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); - this.tableLayoutPanel2.Controls.Add(this.autoHeightLabel1, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.sectionLabelSchedule, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.localServerTime1, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel4, 0, 3); - this.tableLayoutPanel2.Controls.Add(this.sectionLabelDest, 0, 4); - this.tableLayoutPanel2.Controls.Add(this.m_tlpDestination, 0, 5); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - // - // autoHeightLabel1 - // - resources.ApplyResources(this.autoHeightLabel1, "autoHeightLabel1"); - this.autoHeightLabel1.Name = "autoHeightLabel1"; - // - // sectionLabelSchedule - // - resources.ApplyResources(this.sectionLabelSchedule, "sectionLabelSchedule"); - this.sectionLabelSchedule.LineColor = System.Drawing.SystemColors.Window; - this.sectionLabelSchedule.LineLocation = XenAdmin.Controls.SectionHeaderLabel.VerticalAlignment.Middle; - this.sectionLabelSchedule.Name = "sectionLabelSchedule"; - this.sectionLabelSchedule.TabStop = false; - // - // tableLayoutPanel4 - // - resources.ApplyResources(this.tableLayoutPanel4, "tableLayoutPanel4"); - this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel5, 0, 0); - this.tableLayoutPanel4.Controls.Add(this.m_tlpRecur, 1, 0); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - // - // tableLayoutPanel5 - // - resources.ApplyResources(this.tableLayoutPanel5, "tableLayoutPanel5"); - this.tableLayoutPanel5.Controls.Add(this.radioButtonDoNotArchive, 0, 0); - this.tableLayoutPanel5.Controls.Add(this.radioButtonArchiveASAP, 0, 1); - this.tableLayoutPanel5.Controls.Add(this.toolTipContainer1, 0, 2); - this.tableLayoutPanel5.Controls.Add(this.radioButtonArchiveWeekly, 0, 3); - this.tableLayoutPanel5.Controls.Add(this.labelDivider, 1, 0); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - // - // m_tlpRecur - // - resources.ApplyResources(this.m_tlpRecur, "m_tlpRecur"); - this.m_tlpRecur.Controls.Add(this.labelRecurDaily, 0, 0); - this.m_tlpRecur.Controls.Add(this.dateTimePickerDaily, 1, 0); - this.m_tlpRecur.Controls.Add(this.labelRecurWeekly, 0, 1); - this.m_tlpRecur.Controls.Add(this.dateTimePickerWeekly, 1, 1); - this.m_tlpRecur.Controls.Add(this.labelDays, 0, 2); - this.m_tlpRecur.Controls.Add(this.daysWeekCheckboxes1, 0, 3); - this.m_tlpRecur.Name = "m_tlpRecur"; - // - // sectionLabelDest - // - resources.ApplyResources(this.sectionLabelDest, "sectionLabelDest"); - this.sectionLabelDest.LineColor = System.Drawing.SystemColors.Window; - this.sectionLabelDest.LineLocation = XenAdmin.Controls.SectionHeaderLabel.VerticalAlignment.Middle; - this.sectionLabelDest.Name = "sectionLabelDest"; - this.sectionLabelDest.TabStop = false; - // - // NewPolicyArchivePage - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.Controls.Add(this.tableLayoutPanel2); - this.Name = "NewPolicyArchivePage"; - this.m_tlpDestination.ResumeLayout(false); - this.m_tlpDestination.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTest)).EndInit(); - this.m_tlpCredentials.ResumeLayout(false); - this.m_tlpCredentials.PerformLayout(); - this.toolTipContainer1.ResumeLayout(false); - this.toolTipContainer1.PerformLayout(); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel4.PerformLayout(); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - this.m_tlpRecur.ResumeLayout(false); - this.m_tlpRecur.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.RadioButton radioButtonArchiveWeekly; - private System.Windows.Forms.RadioButton radioButtonArchiveDaily; - private System.Windows.Forms.RadioButton radioButtonArchiveASAP; - private System.Windows.Forms.RadioButton radioButtonDoNotArchive; - private System.Windows.Forms.Label labelPassword; - private System.Windows.Forms.TextBox textBoxPassword; - private System.Windows.Forms.Label labelUser; - private System.Windows.Forms.TextBox textBoxUser; - private System.Windows.Forms.Button buttonTest; - private System.Windows.Forms.CheckBox checkBoxCredentials; - private System.Windows.Forms.Label labelRecurDaily; - private XenAdmin.Controls.DateTimeMinutes15 dateTimePickerDaily; - private DaysWeekCheckboxes daysWeekCheckboxes1; - private System.Windows.Forms.Label labelDays; - private System.Windows.Forms.Label labelRecurWeekly; - private XenAdmin.Controls.DateTimeMinutes15 dateTimePickerWeekly; - private System.Windows.Forms.PictureBox pictureBoxTest; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TableLayoutPanel m_tlpCredentials; - private System.Windows.Forms.Label labelDivider; - private LocalServerTime localServerTime1; - private XenAdmin.Controls.ToolTipContainer toolTipContainer1; - private System.Windows.Forms.TableLayoutPanel m_tlpDestination; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private XenAdmin.Controls.Common.AutoHeightLabel autoHeightLabel1; - private XenAdmin.Controls.SectionHeaderLabel sectionLabelSchedule; - private XenAdmin.Controls.SectionHeaderLabel sectionLabelDest; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.TableLayoutPanel m_tlpRecur; - private XenAdmin.Controls.Common.AutoHeightLabel m_labelError; - private System.Windows.Forms.TextBox textBoxPath; - } -} diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.cs deleted file mode 100644 index f0944b679..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.cs +++ /dev/null @@ -1,592 +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 System.Windows.Forms; -using XenAdmin.Actions; -using XenAdmin.Controls; -using XenAdmin.Core; -using XenAdmin.Dialogs; -using XenAdmin.SettingsPanels; -using XenAdmin.Wizards.NewSRWizard_Pages; -using XenAPI; - - -namespace XenAdmin.Wizards.NewPolicyWizard -{ - public partial class NewPolicyArchivePage : XenTabPage, IEditPage - { - public NewPolicyArchivePage() - { - InitializeComponent(); - - CueBannersManager.SetWatermark(textBoxPath, Messages.ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH); - m_labelError.Visible = false; - radioButtonDoNotArchive.Checked = true; - ArchiveTargetType = vmpp_archive_target_type.none; - daysWeekCheckboxes1.CheckBoxChanged += checkBox_CheckedChanged; - } - - private void checkBox_CheckedChanged(object sender, EventArgs e) - { - RefreshEnablementCheckBoxes(); - } - - private void RefreshEnablementCheckBoxes() - { - if ((_clone == null && daysWeekCheckboxes1.Days != "" && BackupDaysCount <= daysWeekCheckboxes1.Days.Split(',').Length) && SnapshotFrequency == vmpp_backup_frequency.weekly - || (_clone != null && daysWeekCheckboxes1.Days != "" && new List(_clone.DaysOfWeekBackup).Count <= daysWeekCheckboxes1.Days.Split(',').Length) && _clone.backup_frequency == vmpp_backup_frequency.weekly) - daysWeekCheckboxes1.DisableUnSelected(); - else - daysWeekCheckboxes1.EnableAll(); - OnPageUpdated(); - EnableOkButton(); - } - - public override string Text - { - get - { - return Messages.ARCHIVE_SNAPSHOTS; - } - } - - public string SubText - { - get { return NewPolicyWizardSpecific.FormatSchedule(Schedule, ArchiveFrequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); } - } - - public override string HelpID - { - get { return "Archivesnapshots"; } - } - - public Image Image - { - get { return Properties.Resources._000_BackupMetadata_h32bit_16; } - } - - public override string PageTitle - { - get - { - return Messages.ARCHIVE_SNAPSHOTS_TITLE; - } - } - - public override void PageLoaded(PageLoadedDirection direction) - { - base.PageLoaded(direction); - RefreshDailyEnabled(SnapshotFrequency); - } - - public vmpp_backup_frequency SnapshotFrequency { private get; set; } - public int BackupDaysCount { private get; set; } - - private void RepositionArchiveDailyRadioButton() - { - tableLayoutPanel5.SuspendLayout(); - try - { - //Enabled radioButtonArchiveDaily should be in one container with other radio buttons - if (radioButtonArchiveDaily.Enabled && radioButtonArchiveDaily.Parent == toolTipContainer1) - { - toolTipContainer1.Controls.Remove(radioButtonArchiveDaily); - radioButtonArchiveDaily.Dock = DockStyle.None; - tableLayoutPanel5.Controls.Add(radioButtonArchiveDaily, 0, 2); - toolTipContainer1.Visible = false; - } - - //Disabled radioButtonArchiveDaily should be in the toolTipContainer1 to display tool tip correctly - if (!radioButtonArchiveDaily.Enabled && radioButtonArchiveDaily.Parent == tableLayoutPanel5) - { - tableLayoutPanel5.Controls.Remove(radioButtonArchiveDaily); - radioButtonArchiveDaily.Dock = DockStyle.Fill; - toolTipContainer1.Controls.Add(radioButtonArchiveDaily); - toolTipContainer1.Visible = true; - } - } - finally - { - tableLayoutPanel5.ResumeLayout(); - } - } - - private void RefreshDailyEnabled(vmpp_backup_frequency snapshotFrequency) - { - bool controlsEnabled = snapshotFrequency != vmpp_backup_frequency.weekly; - radioButtonArchiveDaily.Enabled = dateTimePickerDaily.Enabled = controlsEnabled; - RepositionArchiveDailyRadioButton(); - if (controlsEnabled) - toolTipContainer1.RemoveAll(); - else - toolTipContainer1.SetToolTip(Messages.CANNOT_CONFIGURE_MORE_FREQ_ARCHIVE); - } - - public vmpp_archive_frequency ArchiveFrequency - { - get - { - if (radioButtonDoNotArchive.Checked) - return vmpp_archive_frequency.never; - else if (radioButtonArchiveASAP.Checked) - return vmpp_archive_frequency.always_after_backup; - else if (radioButtonArchiveDaily.Checked) - return vmpp_archive_frequency.daily; - else if (radioButtonArchiveWeekly.Checked) - return vmpp_archive_frequency.weekly; - else return vmpp_archive_frequency.unknown; - } - } - - public Dictionary ArchiveConfig - { - get - { - var result = new Dictionary(); - if (ArchiveFrequency != vmpp_archive_frequency.never) - { - result.Add("location", textBoxPath.Text); - - if (ArchiveTargetType == vmpp_archive_target_type.cifs && checkBoxCredentials.Checked) - { - result.Add("username", textBoxUser.Text); - result.Add("password", textBoxPassword.Text); - } - } - return result; - } - } - - private bool ValidateArchiveScheduleDetails - { - get - { - return radioButtonArchiveDaily.Checked || radioButtonArchiveWeekly.Checked || - radioButtonArchiveASAP.Checked; - } - } - - private bool IsPathValid - { - get - { - return (pathTestStatus == PathTestStatus.NotStarted || pathTestStatus == PathTestStatus.Success) && - (ArchiveTargetType == vmpp_archive_target_type.cifs || - ArchiveTargetType == vmpp_archive_target_type.nfs); - } - } - - private bool DifferentUserCredentialsRequired - { - get { return ArchiveTargetType == vmpp_archive_target_type.cifs && checkBoxCredentials.Checked; } - } - - public override bool EnableNext() - { - if (pathTestStatus == PathTestStatus.InProgress) - return false; - - if (ValidateArchiveScheduleDetails) - { - if (!IsPathValid) - return false; - if (radioButtonArchiveWeekly.Checked && daysWeekCheckboxes1.Days == "") - return false; - if (radioButtonArchiveDaily.Checked && !radioButtonArchiveDaily.Enabled) - return false; - if (DifferentUserCredentialsRequired) - return !string.IsNullOrEmpty(textBoxUser.Text); - } - - return true; - } - - public Dictionary Schedule - { - get - { - var result = new Dictionary(); - if (ArchiveFrequency == vmpp_archive_frequency.daily || ArchiveFrequency == vmpp_archive_frequency.weekly) - { - result.Add("hour", radioButtonArchiveDaily.Checked ? dateTimePickerDaily.Value.Hour.ToString() : dateTimePickerWeekly.Value.Hour.ToString()); - result.Add("min", radioButtonArchiveDaily.Checked ? dateTimePickerDaily.Value.Minute.ToString() : dateTimePickerWeekly.Value.Minute.ToString()); - - } - if (ArchiveFrequency == vmpp_archive_frequency.weekly) - { - result.Add("days", daysWeekCheckboxes1.Days); - } - return result; - } - } - - private void RefreshTab(VMPP vmpp) - { - sectionLabelSchedule.LineColor = sectionLabelDest.LineColor = - PropertiesDialog == null ? SystemColors.Window : SystemColors.ActiveBorder; - - switch (vmpp.archive_frequency) - { - case vmpp_archive_frequency.always_after_backup: - radioButtonArchiveASAP.Checked = true; - break; - case vmpp_archive_frequency.daily: - - radioButtonArchiveDaily.Checked = true; - dateTimePickerDaily.Value = new DateTime(1970, 1, 1, Convert.ToInt32(vmpp.archive_schedule["hour"]), - Convert.ToInt32(vmpp.archive_schedule["min"]), 0); - break; - case vmpp_archive_frequency.weekly: - - radioButtonArchiveWeekly.Checked = true; - dateTimePickerWeekly.Value = new DateTime(1970, 1, 1, Convert.ToInt32(vmpp.archive_schedule["hour"]), - Convert.ToInt32(vmpp.archive_schedule["min"]), 0); - daysWeekCheckboxes1.Days = vmpp.archive_schedule["days"]; - - - break; - case vmpp_archive_frequency.never: - radioButtonDoNotArchive.Checked = true; - break; - } - if (vmpp.archive_frequency != vmpp_archive_frequency.never) - { - if (vmpp.archive_target_type == vmpp_archive_target_type.nfs) - { - textBoxPath.Text = vmpp.archive_target_config_location; - } - else - { - textBoxPath.Text = vmpp.archive_target_config_location; - } - if (vmpp.archive_target_type == vmpp_archive_target_type.cifs) - { - if (vmpp.archive_target_config_username != "") - { - checkBoxCredentials.Checked = true; - - textBoxUser.Text = vmpp.archive_target_config_username; - textBoxPassword.Text = vmpp.archive_target_config_password_value; - } - } - } - - RefreshDailyEnabled(vmpp.backup_frequency); - RefreshEnablementCheckBoxes(); - } - - private Pool _pool; - public Pool Pool - { - get { return _pool; } - set - { - _pool = value; - localServerTime1.Pool = value; - } - } - - private void buttonTest_Click(object sender, EventArgs e) - { - TestPath(); - } - - private enum PathTestStatus { NotStarted, InProgress, Success, Error } - private PathTestStatus pathTestStatus = PathTestStatus.NotStarted; - - private void ResetPathTestStatus() - { - if (pathTestStatus != PathTestStatus.NotStarted) - { - m_labelError.Visible = false; - pictureBoxTest.Visible = false; - pathTestStatus = PathTestStatus.NotStarted; - } - } - - private void TestPath() - { - textBoxPath.Enabled = false; - m_labelError.Visible = false; - pictureBoxTest.Image = Properties.Resources.ajax_loader; - pictureBoxTest.Visible = true; - var archiveConfig = ArchiveConfig; - - //todo: get string for archive destination - archiveConfig.Add("type", vmpp_archive_target_type_helper.ToString(ArchiveTargetType)); - var action = new TestArchiveTargetAction(Pool.Connection, archiveConfig); - action.Completed += action_Completed; - // mark test as in progress; this will disable the Next button (or OK button for Properties dialog) until the test is complete - pathTestStatus = PathTestStatus.InProgress; - OnPageUpdated(); - EnableOkButton(); - action.RunAsync(); - } - - private void action_Completed(ActionBase sender) - { - AsyncAction action = (AsyncAction)sender; - - Program.Invoke(this, () => - { - if (action.Result != "True" || action.Result == null) - { - m_labelError.Visible = true; - pathTestStatus = PathTestStatus.Error; - pictureBoxTest.Image = Properties.Resources._000_Abort_h32bit_16; - } - else - { - pathTestStatus = PathTestStatus.Success; - pictureBoxTest.Image = Properties.Resources._000_Tick_h32bit_16; - } - textBoxPath.Enabled = true; - OnPageUpdated(); - EnableOkButton(); - }); - } - - public vmpp_archive_target_type ArchiveTargetType { get; private set; } - - public AsyncAction SaveSettings() - { - _clone.archive_frequency = ArchiveFrequency; - _clone.archive_schedule = Schedule; - _clone.archive_target_type = ArchiveTargetType; - _clone.archive_target_config = ArchiveConfig; - return null; - } - - private VMPP _clone; - public void SetXenObjects(IXenObject orig, IXenObject clone) - { - if (_clone != null && clone == null) - { - RefreshDailyEnabled(_clone.backup_frequency); - RefreshEnablementCheckBoxes(); - } - else - { - _clone = (VMPP)clone; - RefreshTab(_clone); - } - } - - public bool ValidToSave - { - get - { - return EnableNext(); - } - } - - public void ShowLocalValidationMessages() - { - } - - public void Cleanup() - { - } - - public bool HasChanged - { - get - { - if (!Helper.AreEqual2(_clone.archive_frequency, ArchiveFrequency)) - return true; - if (!Helper.DictEquals(_clone.archive_schedule, Schedule)) - return true; - if (!ArchiveConfigIsEqual) - return true; - if (!Helper.AreEqual2(_clone.archive_target_type, ArchiveTargetType)) - return true; - return false; - } - } - - private bool ArchiveConfigIsEqual - { - get - { - var archiveConfig = ArchiveConfig; - - if (string.IsNullOrEmpty(_clone.archive_target_config_location)) - { - if (archiveConfig.ContainsKey("location") && !string.IsNullOrEmpty(archiveConfig["location"])) - return false; - } - else if (!archiveConfig.ContainsKey("location") || _clone.archive_target_config_location != archiveConfig["location"]) - return false; - - if (string.IsNullOrEmpty(_clone.archive_target_config_username)) - { - if (archiveConfig.ContainsKey("username") && !string.IsNullOrEmpty(archiveConfig["username"])) - return false; - } - else if (!archiveConfig.ContainsKey("username") || _clone.archive_target_config_username != archiveConfig["username"]) - return false; - - if (string.IsNullOrEmpty(_clone.archive_target_config_password_value)) - { - if (archiveConfig.ContainsKey("password") && !string.IsNullOrEmpty(archiveConfig["password"])) - return false; - } - else if (!archiveConfig.ContainsKey("password") || _clone.archive_target_config_password_value != archiveConfig["password"]) - return false; - - return true; - } - } - - private vmpp_archive_target_type GetArchiveTargetType(string path) - { - if (SrWizardHelpers.ValidateNfsSharename(path)) - return vmpp_archive_target_type.nfs; - if (SrWizardHelpers.ValidateCifsSharename(path)) - return vmpp_archive_target_type.cifs; - return vmpp_archive_target_type.none; - } - - private void textBoxPath_TextChanged(object sender, EventArgs e) - { - ResetPathTestStatus(); - ArchiveTargetType = GetArchiveTargetType(textBoxPath.Text); - buttonTest.Enabled = ArchiveTargetType == vmpp_archive_target_type.cifs || - ArchiveTargetType == vmpp_archive_target_type.nfs; - checkBoxCredentials.Enabled = m_tlpCredentials.Enabled = ArchiveTargetType == vmpp_archive_target_type.cifs; - OnPageUpdated(); - EnableOkButton(); - } - - private void textBoxUser_TextChanged(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(textBoxUser.Text)) - checkBoxCredentials.Checked = true; - OnPageUpdated(); - EnableOkButton(); - } - - private void checkBoxCredentials_CheckedChanged(object sender, EventArgs e) - { - OnPageUpdated(); - EnableOkButton(); - } - - private void radioButtonArchiveASAP_CheckedChanged(object sender, EventArgs e) - { - if (!radioButtonArchiveASAP.Checked) - return; - - //radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others - radioButtonArchiveDaily.Checked = false; - ToggleRecurranceVisible(false); - ToggleDestinationVisible(true); - OnPageUpdated(); - EnableOkButton(); - } - - private void radioButtonArchiveDaily_CheckedChanged(object sender, EventArgs e) - { - if (!radioButtonArchiveDaily.Checked) - return; - - //radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others - radioButtonArchiveASAP.Checked = radioButtonDoNotArchive.Checked = radioButtonArchiveWeekly.Checked = false; - ToggleRecurranceVisible(true); - ToggleDailyWeekly(true); - ToggleDestinationVisible(true); - OnPageUpdated(); - EnableOkButton(); - } - - private void radioButtonArchiveWeekly_CheckedChanged(object sender, EventArgs e) - { - if (!radioButtonArchiveWeekly.Checked) - return; - - //radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others - radioButtonArchiveDaily.Checked = false; - ToggleRecurranceVisible(true); - ToggleDailyWeekly(false); - ToggleDestinationVisible(true); - OnPageUpdated(); - EnableOkButton(); - } - - private void radioButtonDoNotArchive_CheckedChanged(object sender, EventArgs e) - { - if (!radioButtonDoNotArchive.Checked) - return; - - //radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others - radioButtonArchiveDaily.Checked = false; - ToggleRecurranceVisible(false); - ToggleDestinationVisible(false); - OnPageUpdated(); - EnableOkButton(); - } - - private void ToggleDestinationVisible(bool show) - { - sectionLabelDest.Visible = m_tlpDestination.Visible = show; - } - - private void ToggleRecurranceVisible(bool show) - { - labelDivider.Visible = m_tlpRecur.Visible = show; - } - - private void ToggleDailyWeekly(bool showDaily) - { - m_tlpRecur.SuspendLayout(); - labelRecurDaily.Visible = dateTimePickerDaily.Visible = showDaily; - labelRecurWeekly.Visible = dateTimePickerWeekly.Visible = labelDays.Visible = daysWeekCheckboxes1.Visible = !showDaily; - m_tlpRecur.ResumeLayout(); - } - - private void EnableOkButton() - { - if (PropertiesDialog != null) - PropertiesDialog.okButton.Enabled = EnableNext(); - } - - public PropertiesDialog PropertiesDialog { private get; set; } - - private void textBoxPassword_TextChanged(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(textBoxPassword.Text)) - checkBoxCredentials.Checked = true; - } - } -} diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.ja.resx b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.ja.resx deleted file mode 100644 index 0a2a67488..000000000 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyArchivePage.ja.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, 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..9578046bd 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,25 +52,11 @@ 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) @@ -88,5 +65,238 @@ namespace XenAdmin.Wizards.NewPolicyWizard SelectedVMs = selectedVMS; } + public string SubText + { + 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..4dcf742bc 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; + private readonly NewVMGroupVMsPage xenTabPageVMsPage; + private readonly NewPolicySnapshotTypePage xenTabPageSnapshotType; protected NewPolicySnapshotFrequencyPage xenTabPageSnapshotFrequency; - protected NewPolicyArchivePage xenTabPageArchive; - protected NewPolicyEmailPage xenTabPageEmail; protected NewPolicyFinishPage xenTabPageFinish; - protected RBACWarningPage xenTabPageRBAC; + protected RBACWarningPage xenTabPageRBAC; public readonly Pool Pool; public NewPolicyWizard(Pool pool) @@ -65,7 +56,185 @@ 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 int GetBackupDaysCount() + { + string days; + return xenTabPageSnapshotFrequency.Schedule.TryGetValue("days", out days) ? days.Split(',').Length : 0; + } + + 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"); + } + + + // 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, 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 49e542cdd..ba8917cf9 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -705,12 +705,6 @@ IntraPoolCopyPage.cs - - UserControl - - - Form - UserControl @@ -3673,18 +3667,6 @@ LocalServerTime.cs - - UserControl - - - NewPolicyArchivePage.cs - - - UserControl - - - NewPolicyEmailPage.cs - UserControl @@ -6340,25 +6322,6 @@ LocalServerTime.cs - - NewPolicyArchivePage.cs - - - NewPolicyArchivePage.cs - - - NewPolicyArchivePage.cs - - - NewPolicyEmailPage.cs - - - NewPolicyEmailPage.cs - Designer - - - NewPolicyEmailPage.cs - NewPolicyFinishPage.cs 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/AssignVMsToPolicyAction.cs b/XenModel/Actions/VMPP/AssignVMsToPolicyAction.cs index e82b05d24..f7c62ca69 100644 --- a/XenModel/Actions/VMPP/AssignVMsToPolicyAction.cs +++ b/XenModel/Actions/VMPP/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/ChangePolicyEnabledAction.cs b/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs index b4e5a5d44..3ee9ecd4b 100644 --- a/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs +++ b/XenModel/Actions/VMPP/ChangePolicyEnabledAction.cs @@ -29,20 +29,16 @@ * 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 + public class ChangePolicyEnabledAction : PureAsyncAction { - private IVMPolicy _policy; - public ChangePolicyEnabledAction(IVMPolicy policy) + private VMSS _policy; + public ChangePolicyEnabledAction(VMSS policy) : base(policy.Connection, string.Format(Messages.CHANGE_POLICY_STATUS, policy.Name)) { _policy = policy; @@ -51,14 +47,14 @@ namespace XenAdmin.Actions 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); + bool value = !_policy.enabled; + Description = value ? string.Format(Messages.ENABLING_VMSS, _policy.Name) : + string.Format(Messages.DISABLING_VMSS, _policy.Name); - _policy.set_is_enabled(Session, _policy.opaque_ref, !_policy.is_enabled); + VMSS.set_enabled(Session, _policy.opaque_ref, !_policy.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); + 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/VMPP/CreateVMPP.cs index 2a52292f2..ef00b16ac 100644 --- a/XenModel/Actions/VMPP/CreateVMPP.cs +++ b/XenModel/Actions/VMPP/CreateVMPP.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/VMPP/DestroyPolicyAction.cs index 6ffe44cea..b842a10c4 100644 --- a/XenModel/Actions/VMPP/DestroyPolicyAction.cs +++ b/XenModel/Actions/VMPP/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/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/RunPolicyNowAction.cs b/XenModel/Actions/VMPP/RunPolicyNowAction.cs index 3930c381b..af654bbdf 100644 --- a/XenModel/Actions/VMPP/RunPolicyNowAction.cs +++ b/XenModel/Actions/VMPP/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/Actions/VMPP/TestArchiveTargetAction.cs b/XenModel/Actions/VMPP/TestArchiveTargetAction.cs deleted file mode 100644 index 915ad1812..000000000 --- a/XenModel/Actions/VMPP/TestArchiveTargetAction.cs +++ /dev/null @@ -1,66 +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; - - -namespace XenAdmin.Actions -{ - public class TestArchiveTargetAction : 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) - { - _archiveConfig = archiveConfig; - - } - - protected override void Run() - { - try - { - Result = Pool.test_archive_target(Session, null, _archiveConfig); - } - catch(Exception e) - { - log.Error(e.Message, e); - } - } - - } -} diff --git a/XenModel/Alerts/PolicyAlert.cs b/XenModel/Alerts/PolicyAlert.cs index d312dcd23..a6c1d016f 100644 --- a/XenModel/Alerts/PolicyAlert.cs +++ b/XenModel/Alerts/PolicyAlert.cs @@ -177,15 +177,10 @@ namespace XenAdmin.Alerts 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); - } } - 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..9a668a48a 100644 --- a/XenModel/XenAPI-Extensions/VMSS.cs +++ b/XenModel/XenAPI-Extensions/VMSS.cs @@ -39,161 +39,23 @@ 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 +80,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 +160,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 +186,7 @@ namespace XenAPI { get { - return VMPP.TryGetKey(schedule, "min"); + return TryGetKey(schedule, "min"); } } @@ -288,7 +195,7 @@ namespace XenAPI get { - return VMPP.TryGetKey(schedule, "hour"); + return TryGetKey(schedule, "hour"); } } @@ -297,7 +204,7 @@ namespace XenAPI get { - return VMPP.TryGetKey(schedule, "days"); + return TryGetKey(schedule, "days"); } } private List _alerts = new List(); @@ -319,8 +226,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..97d3be656 100644 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -282,14 +282,11 @@ - - - @@ -330,7 +327,6 @@ - @@ -447,7 +443,6 @@ - From 71600b20deaa1878b4f56e25d3d2fa2bb7bcc1ac Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 25 May 2017 16:29:27 +0100 Subject: [PATCH 2/4] CA-242134: Rename some of the classes and files, following the removal of the VMPP support Signed-off-by: Mihaela Stoica --- .../DataGridViewTextAndImageCell.cs | 2 +- XenAdmin/Core/VMGroup.cs | 4 +-- XenAdmin/Dialogs/DRConfigureDialog.cs | 2 +- .../HealthCheck/HealthCheckOverviewDialog.cs | 2 +- .../PolicyHistory.Designer.cs | 2 +- .../PolicyHistory.cs | 16 +++++----- .../PolicyHistory.ja.resx | 0 .../PolicyHistory.resx | 0 .../PolicyHistory.zh-CN.resx | 0 .../ScheduledSnapshotsDialog.Designer.cs} | 15 +++++----- .../ScheduledSnapshotsDialog.cs} | 16 +++++----- .../ScheduledSnapshotsDialog.ja.resx} | 2 +- .../ScheduledSnapshotsDialog.resx} | 4 +-- .../ScheduledSnapshotsDialog.zh-CN.resx} | 2 +- .../VMAppliances/VMAppliancesDialog.cs | 2 +- XenAdmin/XenAdmin.csproj | 30 +++++++++---------- XenAdminTests/DialogTests/DialogsForPool.cs | 8 ++--- 17 files changed, 53 insertions(+), 54 deletions(-) rename XenAdmin/{Dialogs/VMProtectionRecovery => Controls}/DataGridViewTextAndImageCell.cs (96%) rename XenAdmin/Dialogs/{VMProtectionRecovery => ScheduledSnapshots}/PolicyHistory.Designer.cs (97%) rename XenAdmin/Dialogs/{VMProtectionRecovery => ScheduledSnapshots}/PolicyHistory.cs (96%) rename XenAdmin/Dialogs/{VMProtectionRecovery => ScheduledSnapshots}/PolicyHistory.ja.resx (100%) rename XenAdmin/Dialogs/{VMProtectionRecovery => ScheduledSnapshots}/PolicyHistory.resx (100%) rename XenAdmin/Dialogs/{VMProtectionRecovery => ScheduledSnapshots}/PolicyHistory.zh-CN.resx (100%) rename XenAdmin/Dialogs/{VMProtectionRecovery/VMProtectionPoliciesDialog.Designer.cs => ScheduledSnapshots/ScheduledSnapshotsDialog.Designer.cs} (95%) rename XenAdmin/Dialogs/{VMProtectionRecovery/VMProtectionPoliciesDialog.cs => ScheduledSnapshots/ScheduledSnapshotsDialog.cs} (95%) rename XenAdmin/Dialogs/{VMProtectionRecovery/VMProtectionPoliciesDialog.ja.resx => ScheduledSnapshots/ScheduledSnapshotsDialog.ja.resx} (97%) rename XenAdmin/Dialogs/{VMProtectionRecovery/VMProtectionPoliciesDialog.resx => ScheduledSnapshots/ScheduledSnapshotsDialog.resx} (97%) rename XenAdmin/Dialogs/{VMProtectionRecovery/VMProtectionPoliciesDialog.zh-CN.resx => ScheduledSnapshots/ScheduledSnapshotsDialog.zh-CN.resx} (97%) 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/VMGroup.cs b/XenAdmin/Core/VMGroup.cs index b1d673ad6..cf13fc96f 100644 --- a/XenAdmin/Core/VMGroup.cs +++ b/XenAdmin/Core/VMGroup.cs @@ -33,8 +33,8 @@ using System; using System.Collections.Generic; using XenAdmin.Actions; using XenAdmin.Dialogs; +using XenAdmin.Dialogs.ScheduledSnapshots; using XenAdmin.Dialogs.VMAppliances; -using XenAdmin.Dialogs.VMProtection_Recovery; using XenAdmin.Network; using XenAdmin.Wizards; using XenAdmin.Wizards.NewPolicyWizard; @@ -182,7 +182,7 @@ namespace XenAdmin.Core internal static XenDialogBase ManageGroupsDialog(Pool pool) { - return typeof(T) == typeof(VMSS) ? (XenDialogBase)(new VMProtectionPoliciesDialog(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool)); + return typeof(T) == typeof(VMSS) ? (XenDialogBase)(new ScheduledSnapshotsDialog(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool)); } internal static bool FeaturePossible(IXenConnection connection) 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/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 96% rename from XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.cs index 5240debe6..7121f0c57 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/PolicyHistory.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/PolicyHistory.cs @@ -30,17 +30,17 @@ */ 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 { 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 95% rename from XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs rename to XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.cs index 85d2d2dee..a150d9274 100644 --- a/XenAdmin/Dialogs/VMProtectionRecovery/VMProtectionPoliciesDialog.cs +++ b/XenAdmin/Dialogs/ScheduledSnapshots/ScheduledSnapshotsDialog.cs @@ -32,23 +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 XenAdmin.Core; -using XenAdmin.Dialogs.VMProtectionRecovery; -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; @@ -60,7 +60,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery policyHistory1.pool = pool; RefreshPoolTitle(pool); } - public VMProtectionPoliciesDialog() { } + public ScheduledSnapshotsDialog() { } public class PolicyRow : DataGridViewRow { 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 @@ - +