mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-21 17:11:29 +01:00
Merge pull request #3250 from xenserver/feature/64-vcpus
Merge full 64 vCPUs support
This commit is contained in:
commit
93da92f1bc
@ -78,7 +78,7 @@ namespace XenAdmin.Commands
|
||||
return false;
|
||||
}
|
||||
|
||||
return !vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED);
|
||||
return !vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled);
|
||||
}
|
||||
|
||||
private bool CanRun(VBD vbd)
|
||||
@ -139,7 +139,7 @@ namespace XenAdmin.Commands
|
||||
return Messages.TOOLTIP_DEACTIVATE_SYSVDI;
|
||||
|
||||
if (AreIODriversNeededAndMissing(vm))
|
||||
return vm.HasNewVirtualisationStates()
|
||||
return vm.HasNewVirtualizationStates()
|
||||
? string.Format(Messages.CANNOT_ACTIVATE_VD_VM_NEEDS_IO_DRIVERS, Helpers.GetName(vm).Ellipsise(50))
|
||||
: string.Format(Messages.CANNOT_ACTIVATE_VD_VM_NEEDS_TOOLS, BrandManager.VmTools, Helpers.GetName(vm).Ellipsise(50));
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace XenAdmin.Commands
|
||||
return false;
|
||||
}
|
||||
|
||||
return !vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED);
|
||||
return !vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled);
|
||||
}
|
||||
|
||||
private bool CanRun(VBD vbd)
|
||||
@ -140,7 +140,7 @@ namespace XenAdmin.Commands
|
||||
return Messages.TOOLTIP_DEACTIVATE_SYSVDI;
|
||||
|
||||
if (AreIODriversNeededAndMissing(vm))
|
||||
return vm.HasNewVirtualisationStates()
|
||||
return vm.HasNewVirtualizationStates()
|
||||
? string.Format(Messages.CANNOT_DEACTIVATE_VDI_NEEDS_IO_DRIVERS, Helpers.GetName(vm).Ellipsise(50))
|
||||
: string.Format(Messages.CANNOT_DEACTIVATE_VDI_NEEDS_TOOLS, BrandManager.VmTools, Helpers.GetName(vm).Ellipsise(50));
|
||||
|
||||
|
@ -275,10 +275,10 @@ namespace XenAdmin.Commands
|
||||
if (vm == null || vm.is_a_template || vm.Locked || vm.power_state != vm_power_state.Running)
|
||||
return false;
|
||||
|
||||
var vStatus = vm.GetVirtualisationStatus(out _);
|
||||
var vStatus = vm.GetVirtualizationStatus(out _);
|
||||
|
||||
if (vStatus.HasFlag(VM.VirtualisationStatus.UNKNOWN) ||
|
||||
vStatus.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED) && vStatus.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
if (vStatus.HasFlag(VM.VirtualizationStatus.Unknown) ||
|
||||
vStatus.HasFlag(VM.VirtualizationStatus.IoDriversInstalled) && vStatus.HasFlag(VM.VirtualizationStatus.ManagementInstalled))
|
||||
return false;
|
||||
|
||||
var vmHome = vm.Home();
|
||||
|
@ -162,19 +162,19 @@ namespace XenAdmin.Commands
|
||||
if (vm == null)
|
||||
return null;
|
||||
|
||||
var status = vm.GetVirtualisationStatus(out _);
|
||||
var status = vm.GetVirtualizationStatus(out _);
|
||||
//trying to guess the reason
|
||||
if (vm.HasNewVirtualisationStates())
|
||||
if (vm.HasNewVirtualizationStates())
|
||||
{
|
||||
if (!status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)) //note: this will also be true when the enum is in Unknown state
|
||||
if (!status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled)) //note: this will also be true when the enum is in Unknown state
|
||||
return Messages.VM_MISSING_IO_DRIVERS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (status == VM.VirtualisationStatus.NOT_INSTALLED || status.HasFlag(VM.VirtualisationStatus.UNKNOWN))
|
||||
if (status == VM.VirtualizationStatus.NotInstalled || status.HasFlag(VM.VirtualizationStatus.Unknown))
|
||||
return FriendlyErrorNames.VM_MISSING_PV_DRIVERS;
|
||||
|
||||
if (status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
if (status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
return FriendlyErrorNames.VM_OLD_PV_DRIVERS;
|
||||
}
|
||||
|
||||
|
@ -87,11 +87,11 @@ namespace XenAdmin.Controls.Ballooning
|
||||
{
|
||||
// If all the Virtualisation Statuses are the same, report that reason.
|
||||
// Otherwise give a generic message.
|
||||
VM.VirtualisationStatus vs0 = vm0.GetVirtualisationStatus(out _);
|
||||
VM.VirtualizationStatus vs0 = vm0.GetVirtualizationStatus(out _);
|
||||
bool identical = true;
|
||||
foreach (VM vm in vms)
|
||||
{
|
||||
if (vm.GetVirtualisationStatus(out _) != vs0)
|
||||
if (vm.GetVirtualizationStatus(out _) != vs0)
|
||||
{
|
||||
identical = false;
|
||||
break;
|
||||
@ -99,14 +99,14 @@ namespace XenAdmin.Controls.Ballooning
|
||||
}
|
||||
if (identical)
|
||||
{
|
||||
var status = vm0.GetVirtualisationStatus(out _);
|
||||
if (status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
var status = vm0.GetVirtualizationStatus(out _);
|
||||
if (status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
labelDMCUnavailable.Text = Messages.DMC_UNAVAILABLE_NOTSUPPORTED_PLURAL;
|
||||
else if (!status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
labelDMCUnavailable.Text = vm0.HasNewVirtualisationStates()
|
||||
else if (!status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
labelDMCUnavailable.Text = vm0.HasNewVirtualizationStates()
|
||||
? Messages.DMC_UNAVAILABLE_NO_IO_NO_MGMNT_PLURAL
|
||||
: string.Format(Messages.DMC_UNAVAILABLE_NOTOOLS_PLURAL, BrandManager.VmTools);
|
||||
else if (status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
else if (status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
labelDMCUnavailable.Text = string.Format(Messages.DMC_UNAVAILABLE_OLDTOOLS_PLURAL, BrandManager.VmTools);
|
||||
else
|
||||
labelDMCUnavailable.Text = Messages.DMC_UNAVAILABLE_VMS;
|
||||
@ -123,15 +123,15 @@ namespace XenAdmin.Controls.Ballooning
|
||||
}
|
||||
else
|
||||
{
|
||||
var status = vm0.GetVirtualisationStatus(out _);
|
||||
var status = vm0.GetVirtualizationStatus(out _);
|
||||
|
||||
if (status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if (status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
labelDMCUnavailable.Text = Messages.DMC_UNAVAILABLE_NOTSUPPORTED;
|
||||
else if (!status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
labelDMCUnavailable.Text = vm0.HasNewVirtualisationStates()
|
||||
else if (!status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
labelDMCUnavailable.Text = vm0.HasNewVirtualizationStates()
|
||||
? Messages.DMC_UNAVAILABLE_NO_IO_NO_MGMNT
|
||||
: string.Format(Messages.DMC_UNAVAILABLE_NOTOOLS, BrandManager.VmTools);
|
||||
else if (status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
else if (status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
labelDMCUnavailable.Text = string.Format(Messages.DMC_UNAVAILABLE_OLDTOOLS, BrandManager.VmTools);
|
||||
else
|
||||
labelDMCUnavailable.Text = Messages.DMC_UNAVAILABLE_VM;
|
||||
|
@ -93,7 +93,7 @@ namespace XenAdmin.Controls.Ballooning
|
||||
|
||||
editButton.Visible = vms.All(vm =>
|
||||
vm.power_state == vm_power_state.Halted ||
|
||||
vm.power_state == vm_power_state.Running && !vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.UNKNOWN));
|
||||
vm.power_state == vm_power_state.Running && !vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.Unknown));
|
||||
|
||||
vmShinyBar.Populate(vms, false);
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace XenAdmin.Controls
|
||||
protected long ntolMax = -1;
|
||||
protected long ntol = -1;
|
||||
private IXenConnection connection;
|
||||
private Dictionary<VM, VM.HA_Restart_Priority> settings;
|
||||
private Dictionary<VM, VM.HaRestartPriority> settings;
|
||||
|
||||
private readonly CollectionChangeEventHandler VM_CollectionChangedWithInvoke;
|
||||
|
||||
@ -111,13 +111,13 @@ namespace XenAdmin.Controls
|
||||
/// ha_compute_hypothetical_max_host_failures_to_tolerate. May not be null.
|
||||
/// </summary>
|
||||
[Browsable(false), ReadOnly(true)]
|
||||
public Dictionary<VM, VM.HA_Restart_Priority> Settings
|
||||
public Dictionary<VM, VM.HaRestartPriority> Settings
|
||||
{
|
||||
get { return settings; }
|
||||
set
|
||||
{
|
||||
System.Diagnostics.Trace.Assert(value != null);
|
||||
settings = new Dictionary<VM, VM.HA_Restart_Priority>(value);
|
||||
settings = new Dictionary<VM, VM.HaRestartPriority>(value);
|
||||
// Trigger ntol update
|
||||
waitingNtolUpdate.Set();
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ namespace XenAdmin.Controls.NetworkingTab
|
||||
if (vm.power_state == vm_power_state.Suspended)
|
||||
{
|
||||
RemoveButtonContainer.SetToolTip(Messages.TOOLTIP_REMOVE_NETWORK_SUSPENDED);
|
||||
EditButtonContainer.SetToolTip(vm.HasNewVirtualisationStates()
|
||||
EditButtonContainer.SetToolTip(vm.HasNewVirtualizationStates()
|
||||
? Messages.TOOLTIP_EDIT_NETWORK_IO_DRIVERS
|
||||
: string.Format(Messages.TOOLTIP_EDIT_NETWORK_TOOLS, BrandManager.VmTools));
|
||||
toolTipContainerActivateToggle.SetToolTip(vif.currently_attached
|
||||
@ -438,12 +438,12 @@ namespace XenAdmin.Controls.NetworkingTab
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vm.power_state == vm_power_state.Running && !vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if (vm.power_state == vm_power_state.Running && !vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
{
|
||||
RemoveButtonContainer.SetToolTip(vm.HasNewVirtualisationStates()
|
||||
RemoveButtonContainer.SetToolTip(vm.HasNewVirtualizationStates()
|
||||
? Messages.TOOLTIP_REMOVE_NETWORK_IO_DRIVERS
|
||||
: string.Format(Messages.TOOLTIP_REMOVE_NETWORK_TOOLS, BrandManager.VmTools));
|
||||
EditButtonContainer.SetToolTip(vm.HasNewVirtualisationStates()
|
||||
EditButtonContainer.SetToolTip(vm.HasNewVirtualizationStates()
|
||||
? Messages.TOOLTIP_EDIT_NETWORK_IO_DRIVERS
|
||||
: string.Format(Messages.TOOLTIP_EDIT_NETWORK_TOOLS, BrandManager.VmTools));
|
||||
toolTipContainerActivateToggle.SetToolTip(vif.currently_attached
|
||||
|
@ -71,14 +71,14 @@ namespace XenAdmin.Controls.XenSearch
|
||||
potentialGroups.Add(hostGroup);
|
||||
potentialGroups.Add(new PropertyGroupingType<String>(ObjectTypes.VM, PropertyNames.os_name));
|
||||
potentialGroups.Add(new PropertyGroupingType<vm_power_state>(ObjectTypes.VM, PropertyNames.power_state));
|
||||
potentialGroups.Add(new PropertyGroupingType<VM.VirtualisationStatus>(ObjectTypes.VM, PropertyNames.virtualisation_status));
|
||||
potentialGroups.Add(new PropertyGroupingType<VM.VirtualizationStatus>(ObjectTypes.VM, PropertyNames.virtualisation_status));
|
||||
potentialGroups.Add(new PropertyGroupingType<ObjectTypes>(ObjectTypes.AllExcFolders, PropertyNames.type));
|
||||
potentialGroups.Add(new XenModelObjectPropertyGroupingType<XenAPI.Network>(ObjectTypes.VM, PropertyNames.networks, poolGroup));
|
||||
XenModelObjectPropertyGroupingType<SR> srGroup =
|
||||
new XenModelObjectPropertyGroupingType<SR>(ObjectTypes.VM | ObjectTypes.VDI, PropertyNames.storage, poolGroup);
|
||||
potentialGroups.Add(srGroup);
|
||||
potentialGroups.Add(new XenModelObjectPropertyGroupingType<VDI>(ObjectTypes.VM, PropertyNames.disks, srGroup));
|
||||
potentialGroups.Add(new PropertyGroupingType<VM.HA_Restart_Priority>(ObjectTypes.VM, PropertyNames.ha_restart_priority));
|
||||
potentialGroups.Add(new PropertyGroupingType<VM.HaRestartPriority>(ObjectTypes.VM, PropertyNames.ha_restart_priority));
|
||||
potentialGroups.Add(new BoolGroupingType(ObjectTypes.VM, PropertyNames.read_caching_enabled));
|
||||
potentialGroups.Add(new BoolGroupingType(ObjectTypes.VM, PropertyNames.vendor_device_state));
|
||||
potentialGroups.Add(applianceGroup);
|
||||
|
@ -74,9 +74,9 @@ namespace XenAdmin.Controls.XenSearch
|
||||
queryTypes.Add(new IPAddressQueryType(3, ObjectTypes.VM | ObjectTypes.Server | ObjectTypes.LocalSR | ObjectTypes.RemoteSR, PropertyNames.ip_address));
|
||||
queryTypes.Add(new DatePropertyQueryType(3, ObjectTypes.VM, PropertyNames.start_time));
|
||||
queryTypes.Add(new EnumPropertyQueryType<vm_power_state>(3, ObjectTypes.VM, PropertyNames.power_state));
|
||||
queryTypes.Add(new EnumPropertyQueryType<VM.VirtualisationStatus>(3, ObjectTypes.VM, PropertyNames.virtualisation_status));
|
||||
queryTypes.Add(new EnumPropertyQueryType<VM.VirtualizationStatus>(3, ObjectTypes.VM, PropertyNames.virtualisation_status));
|
||||
queryTypes.Add(new ValuePropertyQueryType(3, ObjectTypes.VM, PropertyNames.os_name));
|
||||
queryTypes.Add(new EnumPropertyQueryType<VM.HA_Restart_Priority>(3, ObjectTypes.VM, PropertyNames.ha_restart_priority));
|
||||
queryTypes.Add(new EnumPropertyQueryType<VM.HaRestartPriority>(3, ObjectTypes.VM, PropertyNames.ha_restart_priority));
|
||||
queryTypes.Add(new BooleanQueryType(3, ObjectTypes.VM, PropertyNames.read_caching_enabled));
|
||||
queryTypes.Add(new BooleanQueryType(3, ObjectTypes.VM, PropertyNames.vendor_device_state));
|
||||
queryTypes.Add(new EnumPropertyQueryType<SR.SRTypes>(3, /*ObjectTypes.LocalSR | ObjectTypes.RemoteSR*/ ObjectTypes.None, PropertyNames.sr_type));
|
||||
|
@ -235,7 +235,7 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
private static CannotMigrateVM.CannotMigrateVMReason GetMoreSpecificReasonForCannotMigrateVm(VM vm, CannotMigrateVM.CannotMigrateVMReason reason)
|
||||
{
|
||||
var gm = vm.Connection.Resolve(vm.guest_metrics);
|
||||
var status = vm.GetVirtualisationStatus(out _);
|
||||
var status = vm.GetVirtualizationStatus(out _);
|
||||
|
||||
if (vm.IsWindows())
|
||||
{
|
||||
@ -244,7 +244,7 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
reason = CannotMigrateVM.CannotMigrateVMReason.CannotMigrateVmNoTools;
|
||||
}
|
||||
}
|
||||
else if (status == VM.VirtualisationStatus.NOT_INSTALLED || status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
else if (status == VM.VirtualizationStatus.NotInstalled || status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
{
|
||||
reason = CannotMigrateVM.CannotMigrateVMReason.CannotMigrateVmNoTools;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ namespace XenAdmin.Dialogs
|
||||
break;
|
||||
|
||||
case Solution.InstallPVDrivers:
|
||||
error = vm.HasNewVirtualisationStates()
|
||||
error = vm.HasNewVirtualizationStates()
|
||||
? string.Format(Messages.EVACUATE_HOST_INSTALL_MGMNT_PROMPT, message)
|
||||
: string.Format(Messages.EVACUATE_HOST_INSTALL_TOOLS_PROMPT, message, BrandManager.VmTools);
|
||||
break;
|
||||
@ -839,8 +839,8 @@ namespace XenAdmin.Dialogs
|
||||
case Solution.InstallPVDriversNoSolution:
|
||||
// if the state is not unknown we have metrics and can show a detailed message.
|
||||
// Otherwise go with the server and just say they aren't installed
|
||||
error = !vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.UNKNOWN)
|
||||
? vm.GetVirtualisationWarningMessages()
|
||||
error = !vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.Unknown)
|
||||
? vm.GetVirtualizationWarningMessages()
|
||||
: string.Format(Messages.PV_DRIVERS_NOT_INSTALLED, BrandManager.VmTools);
|
||||
break;
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ namespace XenAdmin.Dialogs
|
||||
labelQuiesceInfo.Text = Messages.FIELD_DISABLED;
|
||||
else if (_VM.power_state != vm_power_state.Running)
|
||||
labelQuiesceInfo.Text = Messages.INFO_QUIESCE_MODE_POWER_STATE;
|
||||
else if (!_VM.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
labelQuiesceInfo.Text = _VM.HasNewVirtualisationStates()
|
||||
else if (!_VM.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.ManagementInstalled))
|
||||
labelQuiesceInfo.Text = _VM.HasNewVirtualizationStates()
|
||||
? Messages.INFO_QUIESCE_MODE_NO_MGMNT
|
||||
: string.Format(Messages.INFO_QUIESCE_MODE_NO_TOOLS, BrandManager.VmTools);
|
||||
else
|
||||
@ -149,8 +149,8 @@ namespace XenAdmin.Dialogs
|
||||
labelCheckpointInfo.Text = Messages.FIELD_DISABLED;
|
||||
else if (_VM.power_state != vm_power_state.Running)
|
||||
labelCheckpointInfo.Text = Messages.INFO_DISKMEMORY_MODE_POWER_STATE;
|
||||
else if (!_VM.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
labelCheckpointInfo.Text = _VM.HasNewVirtualisationStates()
|
||||
else if (!_VM.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
labelCheckpointInfo.Text = _VM.HasNewVirtualizationStates()
|
||||
? Messages.INFO_DISKMEMORY_MODE_NO_IO_DRIVERS
|
||||
: string.Format(Messages.INFO_DISKMEMORY_MODE_NO_TOOLS, BrandManager.VmTools);
|
||||
else
|
||||
|
@ -366,7 +366,7 @@ namespace XenAdmin.SettingsPanels
|
||||
foreach (VIF v in network.Connection.ResolveAll<VIF>(network.VIFs))
|
||||
{
|
||||
VM vm = network.Connection.Resolve<VM>(v.VM);
|
||||
if (vm.power_state != vm_power_state.Running || vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if (vm.power_state != vm_power_state.Running || vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
continue;
|
||||
|
||||
runningVMsWithoutTools = true;
|
||||
|
@ -69,7 +69,7 @@ namespace XenAdmin.SettingsPanels
|
||||
}
|
||||
}
|
||||
|
||||
public VM.HA_Restart_Priority SelectedPriority { private get; set; }
|
||||
public VM.HaRestartPriority SelectedPriority { private get; set; }
|
||||
|
||||
#region IEditPage Members
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace XenAdmin.SettingsPanels
|
||||
public partial class USBEditPage : XenTabPage, IEditPage
|
||||
{
|
||||
private VM _vm;
|
||||
public VM.HA_Restart_Priority SelectedPriority { private get; set; }
|
||||
public VM.HaRestartPriority SelectedPriority { private get; set; }
|
||||
|
||||
public USBEditPage()
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ namespace XenAdmin.SettingsPanels
|
||||
|
||||
private VM vm;
|
||||
private bool vmIsAgile;
|
||||
private VM.HA_Restart_Priority origRestartPriority;
|
||||
private VM.HaRestartPriority origRestartPriority;
|
||||
private long origNtol;
|
||||
private long origOrder;
|
||||
private long origStartDelay;
|
||||
@ -263,7 +263,7 @@ namespace XenAdmin.SettingsPanels
|
||||
m_comboBoxProtectionLevel.Items.Clear();
|
||||
ToggleScanningVmAgile(false);
|
||||
|
||||
List<VM.HA_Restart_Priority> restartPriorities = VM.GetAvailableRestartPriorities(vm.Connection);
|
||||
List<VM.HaRestartPriority> restartPriorities = VM.GetAvailableRestartPriorities(vm.Connection);
|
||||
foreach (var restartPriority in restartPriorities)
|
||||
{
|
||||
// add "restart" priorities only is vm is agile
|
||||
@ -392,7 +392,7 @@ namespace XenAdmin.SettingsPanels
|
||||
return nudOrder.Value != origOrder || nudStartDelay.Value != origStartDelay;
|
||||
}
|
||||
|
||||
public VM.HA_Restart_Priority SelectedPriority { get; private set; }
|
||||
public VM.HaRestartPriority SelectedPriority { get; private set; }
|
||||
|
||||
public List<VGPU> VGpus { private get; set; }
|
||||
|
||||
@ -586,9 +586,9 @@ namespace XenAdmin.SettingsPanels
|
||||
|
||||
private class PriorityWrapper
|
||||
{
|
||||
public readonly VM.HA_Restart_Priority Priority;
|
||||
public readonly VM.HaRestartPriority Priority;
|
||||
|
||||
public PriorityWrapper(VM.HA_Restart_Priority priority)
|
||||
public PriorityWrapper(VM.HaRestartPriority priority)
|
||||
{
|
||||
this.Priority = priority;
|
||||
}
|
||||
|
@ -1646,27 +1646,27 @@ namespace XenAdmin.TabPages
|
||||
if (vm != null && vm.Connection != null)
|
||||
{
|
||||
//For Dundee or higher Windows VMs
|
||||
if (vm.HasNewVirtualisationStates())
|
||||
if (vm.HasNewVirtualizationStates())
|
||||
{
|
||||
var status = vm.GetVirtualisationStatus(out var statusString);
|
||||
var status = vm.GetVirtualizationStatus(out var statusString);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (vm.power_state == vm_power_state.Running)
|
||||
{
|
||||
if (status.HasFlag(VM.VirtualisationStatus.UNKNOWN))
|
||||
if (status.HasFlag(VM.VirtualizationStatus.Unknown))
|
||||
{
|
||||
sb.AppendLine(statusString);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Row 1 : I/O Drivers
|
||||
sb.AppendLine(status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)
|
||||
sb.AppendLine(status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled)
|
||||
? Messages.VIRTUALIZATION_STATE_VM_IO_OPTIMIZED
|
||||
: Messages.VIRTUALIZATION_STATE_VM_IO_NOT_OPTIMIZED);
|
||||
|
||||
//Row 2: Management Agent
|
||||
sb.AppendLine(status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)
|
||||
sb.AppendLine(status.HasFlag(VM.VirtualizationStatus.ManagementInstalled)
|
||||
? Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_INSTALLED
|
||||
: Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_NOT_INSTALLED);
|
||||
}
|
||||
@ -1685,12 +1685,12 @@ namespace XenAdmin.TabPages
|
||||
string installMessage = string.Empty;
|
||||
var canInstall = InstallToolsCommand.CanRun(vm);
|
||||
|
||||
if (canInstall && !status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if (canInstall && !status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
{
|
||||
installMessage = Messages.VIRTUALIZATION_STATE_VM_INSTALL_IO_DRIVERS_AND_MANAGEMENT_AGENT;
|
||||
}
|
||||
else if (canInstall && status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED) &&
|
||||
!status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
else if (canInstall && status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled) &&
|
||||
!status.HasFlag(VM.VirtualizationStatus.ManagementInstalled))
|
||||
{
|
||||
installMessage = Messages.VIRTUALIZATION_STATE_VM_INSTALL_MANAGEMENT_AGENT;
|
||||
}
|
||||
@ -1721,9 +1721,9 @@ namespace XenAdmin.TabPages
|
||||
//for everything else (All VMs on pre-Dundee hosts & All non-Windows VMs on any host)
|
||||
else if (vm.power_state == vm_power_state.Running)
|
||||
{
|
||||
var status = vm.GetVirtualisationStatus(out var statusString);
|
||||
var status = vm.GetVirtualizationStatus(out var statusString);
|
||||
|
||||
if (status == VM.VirtualisationStatus.NOT_INSTALLED || status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
if (status == VM.VirtualizationStatus.NotInstalled || status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
{
|
||||
if (InstallToolsCommand.CanRun(vm))
|
||||
{
|
||||
|
@ -124,21 +124,21 @@ namespace XenAdmin.Wizards
|
||||
xenTabPageHaFinish.Ntol = xenTabPageAssignPriorities.Ntol;
|
||||
|
||||
int alwaysRestartHighPriority = 0, alwaysRestart = 0, bestEffort = 0, doNotRestart = 0;
|
||||
foreach (VM.HA_Restart_Priority priority in xenTabPageAssignPriorities.CurrentSettings.Values)
|
||||
foreach (VM.HaRestartPriority priority in xenTabPageAssignPriorities.CurrentSettings.Values)
|
||||
{
|
||||
switch (priority)
|
||||
{
|
||||
case VM.HA_Restart_Priority.AlwaysRestartHighPriority:
|
||||
case VM.HaRestartPriority.AlwaysRestartHighPriority:
|
||||
alwaysRestartHighPriority++;
|
||||
break;
|
||||
case VM.HA_Restart_Priority.AlwaysRestart:
|
||||
case VM.HA_Restart_Priority.Restart:
|
||||
case VM.HaRestartPriority.AlwaysRestart:
|
||||
case VM.HaRestartPriority.Restart:
|
||||
alwaysRestart++;
|
||||
break;
|
||||
case VM.HA_Restart_Priority.BestEffort:
|
||||
case VM.HaRestartPriority.BestEffort:
|
||||
bestEffort++;
|
||||
break;
|
||||
case VM.HA_Restart_Priority.DoNotRestart:
|
||||
case VM.HaRestartPriority.DoNotRestart:
|
||||
doNotRestart++;
|
||||
break;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
|
||||
private void UpdateMenuItems()
|
||||
{
|
||||
List<VM.HA_Restart_Priority> restartPriorities = VM.GetAvailableRestartPriorities(connection);
|
||||
List<VM.HaRestartPriority> restartPriorities = VM.GetAvailableRestartPriorities(connection);
|
||||
|
||||
//When this line: m_dropDownButtonRestartPriority.ContextMenuStrip = this.contextMenuStrip
|
||||
//was called in the designer a "dummy" item was added to the contextMenuStrip by the m_dropDownButtonRestartPriority,
|
||||
@ -126,7 +126,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
/// <summary>
|
||||
/// The current (uncommitted) VM restart priorities.
|
||||
/// </summary>
|
||||
public Dictionary<VM, VM.HA_Restart_Priority> CurrentSettings
|
||||
public Dictionary<VM, VM.HaRestartPriority> CurrentSettings
|
||||
{
|
||||
get { return haNtolIndicator.Settings; }
|
||||
}
|
||||
@ -246,7 +246,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
// The first case is for the HA wizard when priorities are being configured for the first time,
|
||||
// the second is for the edit dialog, when HA is already enabled.
|
||||
|
||||
VM.HA_Restart_Priority? priority = firstTime ? (VM.HA_Restart_Priority?)null : vm.HARestartPriority();
|
||||
VM.HaRestartPriority? priority = firstTime ? (VM.HaRestartPriority?)null : vm.HARestartPriority();
|
||||
var row = new VmWithSettingsRow(vm, priority);
|
||||
newRows.Add(row);
|
||||
}
|
||||
@ -335,16 +335,16 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
{
|
||||
Debug.Assert(ProtectVmsByDefault);
|
||||
|
||||
var priority = isNowAgile ? VM.HaHighestProtectionAvailable(connection) : VM.HA_Restart_Priority.BestEffort;
|
||||
var priority = isNowAgile ? VM.HaHighestProtectionAvailable(connection) : VM.HaRestartPriority.BestEffort;
|
||||
|
||||
row.UpdateRestartPriority(priority);
|
||||
haNtolIndicator.Settings = getCurrentSettings();
|
||||
}
|
||||
else if (!isNowAgile
|
||||
&& row.RestartPriority != VM.HA_Restart_Priority.BestEffort
|
||||
&& row.RestartPriority != VM.HA_Restart_Priority.DoNotRestart)
|
||||
&& row.RestartPriority != VM.HaRestartPriority.BestEffort
|
||||
&& row.RestartPriority != VM.HaRestartPriority.DoNotRestart)
|
||||
{
|
||||
row.UpdateRestartPriority(VM.HA_Restart_Priority.BestEffort);
|
||||
row.UpdateRestartPriority(VM.HaRestartPriority.BestEffort);
|
||||
haNtolIndicator.Settings = getCurrentSettings();
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
var vms = connection.Cache.VMs.Where(v => v.HaCanProtect(Properties.Settings.Default.ShowHiddenVMs));
|
||||
bool firstTime = IsHaActivatedFirstTime(vms);
|
||||
|
||||
VM.HA_Restart_Priority? priority = firstTime ? (VM.HA_Restart_Priority?)null : vm.HARestartPriority();
|
||||
VM.HaRestartPriority? priority = firstTime ? (VM.HaRestartPriority?)null : vm.HARestartPriority();
|
||||
var row = new VmWithSettingsRow(vm, priority);
|
||||
dataGridViewVms.Rows.Add(row);
|
||||
UpdateVMsAgility(new List<VM> {vm});
|
||||
@ -485,7 +485,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
private void priority_Click(object sender, EventArgs e)
|
||||
{
|
||||
var menuitem = (ToolStripMenuItem)sender;
|
||||
VM.HA_Restart_Priority pri = (VM.HA_Restart_Priority)menuitem.Tag;
|
||||
VM.HaRestartPriority pri = (VM.HaRestartPriority)menuitem.Tag;
|
||||
|
||||
bool changesMade = false;
|
||||
foreach (var row in dataGridViewVms.SelectedRows.Cast<VmWithSettingsRow>())
|
||||
@ -509,16 +509,16 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
/// <summary>
|
||||
/// Gets the current (uncommitted) VM restart priorities. Must be called on the GUI thread.
|
||||
/// </summary>
|
||||
private Dictionary<VM, VM.HA_Restart_Priority> getCurrentSettings()
|
||||
private Dictionary<VM, VM.HaRestartPriority> getCurrentSettings()
|
||||
{
|
||||
Program.AssertOnEventThread();
|
||||
Dictionary<VM, VM.HA_Restart_Priority> result = new Dictionary<VM, VM.HA_Restart_Priority>();
|
||||
Dictionary<VM, VM.HaRestartPriority> result = new Dictionary<VM, VM.HaRestartPriority>();
|
||||
|
||||
foreach (var row in dataGridViewVms.Rows.Cast<VmWithSettingsRow>())
|
||||
{
|
||||
// If the restart priority is null, it means we don't know if the VM is agile yet, and we have
|
||||
// protectVmsByDefault == true.
|
||||
result[row.Vm] = row.RestartPriority ?? VM.HA_Restart_Priority.BestEffort;
|
||||
result[row.Vm] = row.RestartPriority ?? VM.HaRestartPriority.BestEffort;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -534,7 +534,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
|
||||
foreach (ToolStripMenuItem item in contextMenuStrip.Items)
|
||||
{
|
||||
var itemRestartPriority = ((VM.HA_Restart_Priority)item.Tag);
|
||||
var itemRestartPriority = ((VM.HaRestartPriority)item.Tag);
|
||||
item.Checked = selectedRows.Count > 0 && selectedRows.All(s => s.RestartPriority == itemRestartPriority);
|
||||
}
|
||||
}
|
||||
@ -573,7 +573,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
|
||||
foreach (ToolStripMenuItem item in contextMenuStrip.Items)
|
||||
{
|
||||
VM.HA_Restart_Priority itemRestartPriority = (VM.HA_Restart_Priority)item.Tag;
|
||||
VM.HaRestartPriority itemRestartPriority = (VM.HaRestartPriority)item.Tag;
|
||||
|
||||
if (selectedRows.All(r => r.RestartPriority == itemRestartPriority))
|
||||
{
|
||||
@ -603,7 +603,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
// Now set the buttons and tooltips)
|
||||
foreach (ToolStripMenuItem menuItem in contextMenuStrip.Items)
|
||||
{
|
||||
var priority = (VM.HA_Restart_Priority)menuItem.Tag;
|
||||
var priority = (VM.HaRestartPriority)menuItem.Tag;
|
||||
|
||||
if (VM.HaPriorityIsRestart(connection, priority))
|
||||
{
|
||||
@ -675,7 +675,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
if (curRow.HasChanged())
|
||||
result[curRow.Vm] = new VMStartupOptions(curRow.StartOrder,
|
||||
curRow.StartDelay,
|
||||
curRow.RestartPriority ?? VM.HA_Restart_Priority.BestEffort);
|
||||
curRow.RestartPriority ?? VM.HaRestartPriority.BestEffort);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -737,7 +737,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
public VM Vm { get; private set; }
|
||||
public long StartDelay { get; private set; }
|
||||
public long StartOrder { get; private set; }
|
||||
public VM.HA_Restart_Priority? RestartPriority { get; private set; }
|
||||
public VM.HaRestartPriority? RestartPriority { get; private set; }
|
||||
public bool IsAgile { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@ -781,7 +781,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
}
|
||||
}
|
||||
|
||||
public VmWithSettingsRow(VM vm, VM.HA_Restart_Priority? priority)
|
||||
public VmWithSettingsRow(VM vm, VM.HaRestartPriority? priority)
|
||||
{
|
||||
cellImage = new DataGridViewImageCell {ValueType = typeof(Image)};
|
||||
cellVm = new DataGridViewTextBoxCell();
|
||||
@ -817,7 +817,7 @@ namespace XenAdmin.Wizards.HAWizard_Pages
|
||||
cellStartOrder.Value = startOrder.ToString();
|
||||
}
|
||||
|
||||
public void UpdateRestartPriority(VM.HA_Restart_Priority? restartPriority)
|
||||
public void UpdateRestartPriority(VM.HaRestartPriority? restartPriority)
|
||||
{
|
||||
RestartPriority = restartPriority;
|
||||
cellRestartPriority.Value = Helpers.RestartPriorityI18n(restartPriority);
|
||||
|
@ -99,31 +99,31 @@ namespace XenAdmin.XenSearch
|
||||
VM vm = o as VM;
|
||||
if (vm != null)
|
||||
{
|
||||
VM.VirtualisationStatus status = vm.GetVirtualisationStatus(out _);
|
||||
VM.VirtualizationStatus status = vm.GetVirtualizationStatus(out _);
|
||||
if (vm.power_state != vm_power_state.Running ||
|
||||
status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED | VM.VirtualisationStatus.MANAGEMENT_INSTALLED) ||
|
||||
status.HasFlag(VM.VirtualisationStatus.UNKNOWN))
|
||||
status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled | VM.VirtualizationStatus.ManagementInstalled) ||
|
||||
status.HasFlag(VM.VirtualizationStatus.Unknown))
|
||||
return false;
|
||||
|
||||
if (property == PropertyNames.memoryValue && status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
if (property == PropertyNames.memoryValue && status.HasFlag(VM.VirtualizationStatus.ManagementInstalled))
|
||||
return false;
|
||||
|
||||
if ((property == PropertyNames.diskText || property == PropertyNames.networkText) && status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if ((property == PropertyNames.diskText || property == PropertyNames.networkText) && status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
return false;
|
||||
|
||||
string warningMessage;
|
||||
int colSpan;
|
||||
|
||||
if (property == PropertyNames.memoryValue && !status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
if (property == PropertyNames.memoryValue && !status.HasFlag(VM.VirtualizationStatus.ManagementInstalled))
|
||||
{
|
||||
if (vm.HasNewVirtualisationStates())
|
||||
if (vm.HasNewVirtualizationStates())
|
||||
{
|
||||
warningMessage = Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_NOT_INSTALLED;
|
||||
colSpan = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
warningMessage = vm.GetVirtualisationWarningMessages();
|
||||
warningMessage = vm.GetVirtualizationWarningMessages();
|
||||
colSpan = 3;
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ namespace XenAdmin.XenSearch
|
||||
}
|
||||
}
|
||||
|
||||
if (property == PropertyNames.diskText && vm.HasNewVirtualisationStates() && !status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED))
|
||||
if (property == PropertyNames.diskText && vm.HasNewVirtualizationStates() && !status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled))
|
||||
{
|
||||
warningMessage = Messages.VIRTUALIZATION_STATE_VM_IO_NOT_OPTIMIZED;
|
||||
colSpan = 2;
|
||||
|
@ -222,12 +222,12 @@ namespace XenAdminTests.SearchTests
|
||||
[TestCase("Fully optimized", new[] {"vm1", "vm5"})]
|
||||
public void TestVirtStatusIs(string filter, string[] expectedVmNames)
|
||||
{
|
||||
var dict = PropertyAccessors.Geti18nFor(PropertyNames.virtualisation_status) as Dictionary<string, VM.VirtualisationStatus>;
|
||||
var dict = PropertyAccessors.Geti18nFor(PropertyNames.virtualisation_status) as Dictionary<string, VM.VirtualizationStatus>;
|
||||
|
||||
Assert.NotNull(dict, "Did not find i18n for VM.VirtualisationStatus");
|
||||
Assert.IsTrue(dict.TryGetValue(filter, out var status), $"Did not find i18n for {filter}");
|
||||
|
||||
var query = new EnumPropertyQuery<VM.VirtualisationStatus>(PropertyNames.virtualisation_status, status, true);
|
||||
var query = new EnumPropertyQuery<VM.VirtualizationStatus>(PropertyNames.virtualisation_status, status, true);
|
||||
CheckMatch(query, expectedVmNames);
|
||||
}
|
||||
|
||||
@ -240,21 +240,21 @@ namespace XenAdminTests.SearchTests
|
||||
[TestCase("Fully optimized", new[] {"vm0", "vm2", "vm3", "vm4", "vm6"})]
|
||||
public void TestVirtStatusIsNot(string filter, string[] expectedVmNames)
|
||||
{
|
||||
var dict = PropertyAccessors.Geti18nFor(PropertyNames.virtualisation_status) as Dictionary<string, VM.VirtualisationStatus>;
|
||||
var dict = PropertyAccessors.Geti18nFor(PropertyNames.virtualisation_status) as Dictionary<string, VM.VirtualizationStatus>;
|
||||
|
||||
Assert.NotNull(dict, "Did not find i18n for VM.VirtualisationStatus");
|
||||
Assert.IsTrue(dict.TryGetValue(filter, out var status), $"Did not find i18n for {filter}");
|
||||
|
||||
var query = new EnumPropertyQuery<VM.VirtualisationStatus>(PropertyNames.virtualisation_status, status, false);
|
||||
var query = new EnumPropertyQuery<VM.VirtualizationStatus>(PropertyNames.virtualisation_status, status, false);
|
||||
CheckMatch(query, expectedVmNames);
|
||||
}
|
||||
|
||||
private void CheckMatch(EnumPropertyQuery<VM.VirtualisationStatus> query, string[] expectedVmNames)
|
||||
private void CheckMatch(EnumPropertyQuery<VM.VirtualizationStatus> query, string[] expectedVmNames)
|
||||
{
|
||||
foreach (var moqVm in _allVms)
|
||||
{
|
||||
var vm = moqVm.Object;
|
||||
bool? match = query.MatchProperty(vm.GetVirtualisationStatus(out _));
|
||||
bool? match = query.MatchProperty(vm.GetVirtualizationStatus(out _));
|
||||
Assert.True(match.HasValue);
|
||||
|
||||
var name = vm.Name();
|
||||
|
@ -292,6 +292,11 @@ namespace XenAdmin.Actions.OvfActions
|
||||
OVF.AddOtherSystemSettingData(ovfEnv, vsId, "recommendations", vm.recommendations, hypervisorInfo);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(vm.reference_label))
|
||||
{
|
||||
OVF.AddOtherSystemSettingData(ovfEnv, vsId, "reference_label", vm.reference_label, hypervisorInfo);
|
||||
}
|
||||
|
||||
if (vm.has_vendor_device)
|
||||
{
|
||||
//serialise it with a different name to avoid it being deserialised automatically and getting the wrong type
|
||||
|
@ -84,7 +84,7 @@ namespace XenAdmin.Actions
|
||||
foreach (VM vm in startupOptions.Keys)
|
||||
{
|
||||
log.DebugFormat("Setting HA priority on {0} to {1}", vm.Name(), startupOptions[vm].HaRestartPriority);
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HA_Restart_Priority)startupOptions[vm].HaRestartPriority);
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HaRestartPriority)startupOptions[vm].HaRestartPriority);
|
||||
|
||||
log.DebugFormat("Setting start order on {0} to {1}", vm.Name(), startupOptions[vm].Order);
|
||||
VM.set_order(Session, vm.opaque_ref, startupOptions[vm].Order);
|
||||
|
@ -39,7 +39,7 @@ namespace XenAdmin.Actions
|
||||
|
||||
public HAUnprotectVMAction(VM vm)
|
||||
: base(vm.Connection, string.Format(Messages.ACTION_HA_UNPROTECT_VM_TITLE, Helpers.GetName(vm),
|
||||
Helpers.RestartPriorityI18n(VM.HA_Restart_Priority.DoNotRestart)), Messages.ACTION_HA_UNPROTECT_VM_DESCRIPTION)
|
||||
Helpers.RestartPriorityI18n(VM.HaRestartPriority.DoNotRestart)), Messages.ACTION_HA_UNPROTECT_VM_DESCRIPTION)
|
||||
{
|
||||
VM = vm;
|
||||
ApiMethodsToRoleCheck.Add("VM.set_ha_restart_priority");
|
||||
|
@ -86,7 +86,7 @@ namespace XenAdmin.Actions
|
||||
|
||||
// Check the version (if any) of the PV tools already on this host...
|
||||
VM_guest_metrics guestMetrics = Connection.Resolve(VM.guest_metrics);
|
||||
if (guestMetrics != null && !VM.HasNewVirtualisationStates() && guestMetrics.PV_drivers_installed() && guestMetrics.PV_drivers_up_to_date)
|
||||
if (guestMetrics != null && !VM.HasNewVirtualizationStates() && guestMetrics.PV_drivers_installed() && guestMetrics.PV_drivers_up_to_date)
|
||||
{
|
||||
this.Description = string.Format(Messages.INSTALLTOOLS_EXIST, BrandManager.VmTools);
|
||||
return;
|
||||
|
@ -71,12 +71,12 @@ namespace XenAdmin.Actions
|
||||
int i = 0;
|
||||
foreach (VM vm in settings.Keys)
|
||||
{
|
||||
if (VM.HaPriorityIsRestart(vm.Connection, (VM.HA_Restart_Priority)settings[vm].HaRestartPriority))
|
||||
if (VM.HaPriorityIsRestart(vm.Connection, (VM.HaRestartPriority)settings[vm].HaRestartPriority))
|
||||
continue;
|
||||
|
||||
Description = string.Format(Messages.HA_SETTING_PRIORITY_ON_X, Helpers.GetName(vm));
|
||||
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HA_Restart_Priority)settings[vm].HaRestartPriority);
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HaRestartPriority)settings[vm].HaRestartPriority);
|
||||
VM.set_order(Session, vm.opaque_ref, settings[vm].Order);
|
||||
VM.set_start_delay(Session, vm.opaque_ref, settings[vm].StartDelay);
|
||||
|
||||
@ -90,12 +90,12 @@ namespace XenAdmin.Actions
|
||||
// Then move any VMs from unprotected -> protected
|
||||
foreach (VM vm in settings.Keys)
|
||||
{
|
||||
if (!VM.HaPriorityIsRestart(vm.Connection, (VM.HA_Restart_Priority)settings[vm].HaRestartPriority))
|
||||
if (!VM.HaPriorityIsRestart(vm.Connection, (VM.HaRestartPriority)settings[vm].HaRestartPriority))
|
||||
continue;
|
||||
|
||||
Description = string.Format(Messages.HA_SETTING_PRIORITY_ON_X, Helpers.GetName(vm));
|
||||
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HA_Restart_Priority)settings[vm].HaRestartPriority);
|
||||
VM.SetHaRestartPriority(Session, vm, (VM.HaRestartPriority)settings[vm].HaRestartPriority);
|
||||
VM.set_order(Session, vm.opaque_ref, settings[vm].Order);
|
||||
VM.set_start_delay(Session, vm.opaque_ref, settings[vm].StartDelay);
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ namespace XenAdmin.Core
|
||||
/// </summary>
|
||||
/// <param name="priority"></param>
|
||||
/// <returns></returns>
|
||||
public static string RestartPriorityI18n(VM.HA_Restart_Priority? priority)
|
||||
public static string RestartPriorityI18n(VM.HaRestartPriority? priority)
|
||||
{
|
||||
if (priority == null)
|
||||
{
|
||||
@ -1078,7 +1078,7 @@ namespace XenAdmin.Core
|
||||
}
|
||||
}
|
||||
|
||||
public static string RestartPriorityDescription(VM.HA_Restart_Priority? priority)
|
||||
public static string RestartPriorityDescription(VM.HaRestartPriority? priority)
|
||||
{
|
||||
if (priority == null)
|
||||
{
|
||||
@ -1096,9 +1096,9 @@ namespace XenAdmin.Core
|
||||
/// </summary>
|
||||
/// <param name="connection">Must not be null.</param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<VM, VM.HA_Restart_Priority> GetVmHaRestartPriorities(IXenConnection connection, bool showHiddenVMs)
|
||||
public static Dictionary<VM, VM.HaRestartPriority> GetVmHaRestartPriorities(IXenConnection connection, bool showHiddenVMs)
|
||||
{
|
||||
Dictionary<VM, VM.HA_Restart_Priority> result = new Dictionary<VM, VM.HA_Restart_Priority>();
|
||||
Dictionary<VM, VM.HaRestartPriority> result = new Dictionary<VM, VM.HaRestartPriority>();
|
||||
foreach (VM vm in connection.Cache.VMs)
|
||||
{
|
||||
if (vm.HaCanProtect(showHiddenVMs))
|
||||
@ -1115,12 +1115,12 @@ namespace XenAdmin.Core
|
||||
/// </summary>
|
||||
/// <param name="settings">Must not be null.</param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<XenRef<VM>, string> GetVmHaRestartPrioritiesForApi(Dictionary<VM, VM.HA_Restart_Priority> settings)
|
||||
public static Dictionary<XenRef<VM>, string> GetVmHaRestartPrioritiesForApi(Dictionary<VM, VM.HaRestartPriority> settings)
|
||||
{
|
||||
Dictionary<XenRef<VM>, string> result = new Dictionary<XenRef<VM>, string>();
|
||||
foreach (VM vm in settings.Keys)
|
||||
{
|
||||
if (settings[vm] == VM.HA_Restart_Priority.BestEffort || settings[vm] == VM.HA_Restart_Priority.DoNotRestart)
|
||||
if (settings[vm] == VM.HaRestartPriority.BestEffort || settings[vm] == VM.HaRestartPriority.DoNotRestart)
|
||||
{
|
||||
// The server doesn't want to know about best-effort/do not restart VMs.
|
||||
// (They don't influence the plan, and sending in the dictionary gives an error).
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -178,9 +178,9 @@ namespace XenAdmin.XenSearch
|
||||
private static Dictionary<PropertyNames, Func<IXenObject, IComparable>> properties = new Dictionary<PropertyNames, Func<IXenObject, IComparable>>();
|
||||
|
||||
public static readonly Dictionary<String, vm_power_state> VM_power_state_i18n = new Dictionary<string, vm_power_state>();
|
||||
public static readonly Dictionary<String, VM.VirtualisationStatus> VirtualisationStatus_i18n = new Dictionary<string, VM.VirtualisationStatus>();
|
||||
public static readonly Dictionary<String, VM.VirtualizationStatus> VirtualisationStatus_i18n = new Dictionary<string, VM.VirtualizationStatus>();
|
||||
public static readonly Dictionary<String, ObjectTypes> ObjectTypes_i18n = new Dictionary<string, ObjectTypes>();
|
||||
public static readonly Dictionary<String, VM.HA_Restart_Priority> HARestartPriority_i18n = new Dictionary<string, VM.HA_Restart_Priority>();
|
||||
public static readonly Dictionary<String, VM.HaRestartPriority> HARestartPriority_i18n = new Dictionary<string, VM.HaRestartPriority>();
|
||||
public static readonly Dictionary<String, SR.SRTypes> SRType_i18n = new Dictionary<string, SR.SRTypes>();
|
||||
|
||||
public static readonly Dictionary<PropertyNames, String> PropertyNames_i18n = new Dictionary<PropertyNames, string>();
|
||||
@ -198,12 +198,12 @@ namespace XenAdmin.XenSearch
|
||||
foreach (SR.SRTypes type in Enum.GetValues(typeof(SR.SRTypes)))
|
||||
SRType_i18n[SR.GetFriendlyTypeName(type)] = type;
|
||||
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_NOT_OPTIMIZED] = VM.VirtualisationStatus.NOT_INSTALLED;
|
||||
VirtualisationStatus_i18n[Messages.OUT_OF_DATE] = VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE;
|
||||
VirtualisationStatus_i18n[Messages.UNKNOWN] = VM.VirtualisationStatus.UNKNOWN;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_IO_OPTIMIZED_ONLY] = VM.VirtualisationStatus.IO_DRIVERS_INSTALLED;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_INSTALLED_ONLY] = VM.VirtualisationStatus.MANAGEMENT_INSTALLED;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_OPTIMIZED] = VM.VirtualisationStatus.IO_DRIVERS_INSTALLED | VM.VirtualisationStatus.MANAGEMENT_INSTALLED;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_NOT_OPTIMIZED] = VM.VirtualizationStatus.NotInstalled;
|
||||
VirtualisationStatus_i18n[Messages.OUT_OF_DATE] = VM.VirtualizationStatus.PvDriversOutOfDate;
|
||||
VirtualisationStatus_i18n[Messages.UNKNOWN] = VM.VirtualizationStatus.Unknown;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_IO_OPTIMIZED_ONLY] = VM.VirtualizationStatus.IoDriversInstalled;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_INSTALLED_ONLY] = VM.VirtualizationStatus.ManagementInstalled;
|
||||
VirtualisationStatus_i18n[Messages.VIRTUALIZATION_STATE_VM_OPTIMIZED] = VM.VirtualizationStatus.IoDriversInstalled | VM.VirtualizationStatus.ManagementInstalled;
|
||||
|
||||
ObjectTypes_i18n[Messages.VMS] = ObjectTypes.VM;
|
||||
ObjectTypes_i18n[string.Format(Messages.XENSERVER_TEMPLATES, BrandManager.ProductBrand)] = ObjectTypes.DefaultTemplate;
|
||||
@ -220,7 +220,7 @@ namespace XenAdmin.XenSearch
|
||||
ObjectTypes_i18n[Messages.VM_APPLIANCE] = ObjectTypes.Appliance;
|
||||
|
||||
|
||||
foreach (VM.HA_Restart_Priority p in VM.GetAvailableRestartPriorities(null)) //CA-57600 - From Boston onwards, the HA restart priorities list contains Restart instead of AlwaysRestartHighPriority and AlwaysRestart
|
||||
foreach (VM.HaRestartPriority p in VM.GetAvailableRestartPriorities(null)) //CA-57600 - From Boston onwards, the HA restart priorities list contains Restart instead of AlwaysRestartHighPriority and AlwaysRestart
|
||||
{
|
||||
HARestartPriority_i18n[Helpers.RestartPriorityI18n(p)] = p;
|
||||
}
|
||||
@ -284,11 +284,11 @@ namespace XenAdmin.XenSearch
|
||||
property_types.Add(PropertyNames.host, typeof(Host));
|
||||
property_types.Add(PropertyNames.os_name, typeof(string));
|
||||
property_types.Add(PropertyNames.power_state, typeof(vm_power_state));
|
||||
property_types.Add(PropertyNames.virtualisation_status, typeof(VM.VirtualisationStatus));
|
||||
property_types.Add(PropertyNames.virtualisation_status, typeof(VM.VirtualizationStatus));
|
||||
property_types.Add(PropertyNames.type, typeof(ObjectTypes));
|
||||
property_types.Add(PropertyNames.networks, typeof(XenAPI.Network));
|
||||
property_types.Add(PropertyNames.storage, typeof(SR));
|
||||
property_types.Add(PropertyNames.ha_restart_priority, typeof(VM.HA_Restart_Priority));
|
||||
property_types.Add(PropertyNames.ha_restart_priority, typeof(VM.HaRestartPriority));
|
||||
property_types.Add(PropertyNames.read_caching_enabled, typeof(bool));
|
||||
property_types.Add(PropertyNames.appliance, typeof(VM_appliance));
|
||||
property_types.Add(PropertyNames.tags, typeof(string));
|
||||
@ -304,7 +304,7 @@ namespace XenAdmin.XenSearch
|
||||
properties[PropertyNames.os_name] = o => o is VM vm && vm.IsRealVm() ? vm.GetOSName() : null;
|
||||
properties[PropertyNames.power_state] = o => o is VM vm && vm.IsRealVm() ? (IComparable)vm.power_state : null;
|
||||
properties[PropertyNames.vendor_device_state] = o => o is VM vm && vm.IsRealVm() ? (bool?)vm.WindowsUpdateCapable() : null;
|
||||
properties[PropertyNames.virtualisation_status] = o => o is VM vm && vm.IsRealVm() ? (IComparable)vm.GetVirtualisationStatus(out _) : null;
|
||||
properties[PropertyNames.virtualisation_status] = o => o is VM vm && vm.IsRealVm() ? (IComparable)vm.GetVirtualizationStatus(out _) : null;
|
||||
properties[PropertyNames.start_time] = o => o is VM vm && vm.IsRealVm() ? (DateTime?)vm.GetStartTime() : null;
|
||||
properties[PropertyNames.read_caching_enabled] = o => o is VM vm && vm.IsRealVm() ? (bool?)vm.ReadCachingEnabled() : null;
|
||||
|
||||
@ -343,7 +343,7 @@ namespace XenAdmin.XenSearch
|
||||
{
|
||||
Pool pool = Helpers.GetPool(vm.Connection);
|
||||
if (pool != null && pool.ha_enabled)
|
||||
return vm.HaPriorityIsRestart() ? VM.HA_Restart_Priority.Restart : vm.HARestartPriority();
|
||||
return vm.HaPriorityIsRestart() ? VM.HaRestartPriority.Restart : vm.HARestartPriority();
|
||||
|
||||
// CA-57600 - From Boston onwards, the HA_restart_priority enum contains Restart instead of
|
||||
// AlwaysRestartHighPriority and AlwaysRestart. When searching in a pre-Boston pool for VMs
|
||||
@ -465,7 +465,7 @@ namespace XenAdmin.XenSearch
|
||||
{
|
||||
return vm.IsRealVm() &&
|
||||
vm.power_state == vm_power_state.Running &&
|
||||
vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)
|
||||
vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.ManagementInstalled)
|
||||
? PropertyAccessorHelper.vmMemoryUsageString(vm)
|
||||
: null;
|
||||
}
|
||||
@ -487,7 +487,7 @@ namespace XenAdmin.XenSearch
|
||||
{
|
||||
return vm.IsRealVm() &&
|
||||
vm.power_state == vm_power_state.Running &&
|
||||
vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)
|
||||
vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.ManagementInstalled)
|
||||
? (IComparable)PropertyAccessorHelper.vmMemoryUsageRank(vm)
|
||||
: null;
|
||||
}
|
||||
@ -509,7 +509,7 @@ namespace XenAdmin.XenSearch
|
||||
{
|
||||
return vm.IsRealVm() &&
|
||||
vm.power_state == vm_power_state.Running &&
|
||||
vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)
|
||||
vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.ManagementInstalled)
|
||||
? (IComparable)PropertyAccessorHelper.vmMemoryUsageValue(vm)
|
||||
: null;
|
||||
}
|
||||
@ -531,7 +531,7 @@ namespace XenAdmin.XenSearch
|
||||
{
|
||||
return vm.IsRealVm() &&
|
||||
vm.power_state == vm_power_state.Running &&
|
||||
vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)
|
||||
vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled)
|
||||
? PropertyAccessorHelper.vmNetworkUsageString(vm)
|
||||
: null;
|
||||
}
|
||||
@ -549,7 +549,7 @@ namespace XenAdmin.XenSearch
|
||||
return o is VM vm &&
|
||||
vm.IsRealVm() &&
|
||||
vm.power_state == vm_power_state.Running &&
|
||||
vm.GetVirtualisationStatus(out _).HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)
|
||||
vm.GetVirtualizationStatus(out _).HasFlag(VM.VirtualizationStatus.IoDriversInstalled)
|
||||
? PropertyAccessorHelper.vmDiskUsageString(vm)
|
||||
: null;
|
||||
}
|
||||
@ -1007,12 +1007,12 @@ namespace XenAdmin.XenSearch
|
||||
});
|
||||
|
||||
case PropertyNames.virtualisation_status:
|
||||
return (Func<VM.VirtualisationStatus, Icons>)(status =>
|
||||
return (Func<VM.VirtualizationStatus, Icons>)(status =>
|
||||
{
|
||||
if (status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED | VM.VirtualisationStatus.MANAGEMENT_INSTALLED))
|
||||
if (status.HasFlag(VM.VirtualizationStatus.IoDriversInstalled | VM.VirtualizationStatus.ManagementInstalled))
|
||||
return Icons.ToolInstalled;
|
||||
|
||||
if (status.HasFlag(VM.VirtualisationStatus.PV_DRIVERS_OUT_OF_DATE))
|
||||
if (status.HasFlag(VM.VirtualizationStatus.PvDriversOutOfDate))
|
||||
return Icons.ToolsOutOfDate;
|
||||
|
||||
return Icons.ToolsNotInstalled;
|
||||
@ -1025,7 +1025,7 @@ namespace XenAdmin.XenSearch
|
||||
return (Func<string, Icons>)(_ => Icons.Tag);
|
||||
|
||||
case PropertyNames.ha_restart_priority:
|
||||
return (Func<VM.HA_Restart_Priority, Icons>)(_ => Icons.HA);
|
||||
return (Func<VM.HaRestartPriority, Icons>)(_ => Icons.HA);
|
||||
|
||||
case PropertyNames.read_caching_enabled:
|
||||
return (Func<bool, Icons>)(_ => Icons.VDI);
|
||||
|
@ -785,9 +785,9 @@ namespace XenAdmin.XenSearch
|
||||
new GroupQuery(
|
||||
new QueryFilter[] {
|
||||
new EnumPropertyQuery<vm_power_state>(PropertyNames.power_state, vm_power_state.Running, true),
|
||||
new EnumPropertyQuery<VM.VirtualisationStatus>(PropertyNames.virtualisation_status, VM.VirtualisationStatus.IO_DRIVERS_INSTALLED | VM.VirtualisationStatus.MANAGEMENT_INSTALLED, false)
|
||||
new EnumPropertyQuery<VM.VirtualizationStatus>(PropertyNames.virtualisation_status, VM.VirtualizationStatus.IoDriversInstalled | VM.VirtualizationStatus.ManagementInstalled, false)
|
||||
}, GroupQuery.GroupQueryType.And)),
|
||||
new PropertyGrouping<VM.VirtualisationStatus>(PropertyNames.virtualisation_status, null),
|
||||
new PropertyGrouping<VM.VirtualizationStatus>(PropertyNames.virtualisation_status, null),
|
||||
string.Format(Messages.DEFAULT_SEARCH_VMS_WO_XS_TOOLS, BrandManager.VmTools),
|
||||
"dead-beef-1234-vmswotools", true
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user