diff --git a/XenAdmin/Controls/XenSearch/GroupingControl.cs b/XenAdmin/Controls/XenSearch/GroupingControl.cs index a8fc20e74..c004de2ba 100644 --- a/XenAdmin/Controls/XenSearch/GroupingControl.cs +++ b/XenAdmin/Controls/XenSearch/GroupingControl.cs @@ -79,6 +79,7 @@ namespace XenAdmin.Controls.XenSearch potentialGroups.Add(new XenModelObjectPropertyGroupingType(ObjectTypes.VM, PropertyNames.disks, srGroup)); potentialGroups.Add(new PropertyGroupingType(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); potentialGroups.Add(new PropertyGroupingType(ObjectTypes.AllExcFolders, PropertyNames.tags)); potentialGroups.Add(new XenModelObjectPropertyGroupingType( diff --git a/XenAdmin/Controls/XenSearch/QueryElement.cs b/XenAdmin/Controls/XenSearch/QueryElement.cs index b16a6f845..41de764ca 100644 --- a/XenAdmin/Controls/XenSearch/QueryElement.cs +++ b/XenAdmin/Controls/XenSearch/QueryElement.cs @@ -79,6 +79,7 @@ namespace XenAdmin.Controls.XenSearch queryTypes.Add(new ValuePropertyQueryType(3, ObjectTypes.VM, PropertyNames.os_name)); queryTypes.Add(new EnumPropertyQueryType(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(3, /*ObjectTypes.LocalSR | ObjectTypes.RemoteSR*/ ObjectTypes.None, PropertyNames.sr_type)); queryTypes.Add(new LongQueryType(4, ObjectTypes.VDI, Messages.SIZE, PropertyNames.size, Util.BINARY_GIGA, Messages.VAL_GIGB)); diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 964eb8b73..03fd6e749 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -34327,6 +34327,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to VMs by Windows Update Capability. + /// + public static string VMS_BY_WINDOWS_UPDATE_CAPABILITY { + get { + return ResourceManager.GetString("VMS_BY_WINDOWS_UPDATE_CAPABILITY", resourceCulture); + } + } + /// /// Looks up a localized string similar to VMs in pool '{0}':. /// @@ -34687,6 +34696,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Windows Update capable. + /// + public static string WINDOWS_UPDATE_CAPABLE { + get { + return ResourceManager.GetString("WINDOWS_UPDATE_CAPABLE", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not Windows Update capable. + /// + public static string WINDOWS_UPDATE_CAPABLE_NOT { + get { + return ResourceManager.GetString("WINDOWS_UPDATE_CAPABLE_NOT", resourceCulture); + } + } + /// /// Looks up a localized string similar to &Next >. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 396a1fc04..9a35eb0fa 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -12017,6 +12017,15 @@ To learn more about the XenServer Dynamic Workload Balancing feature or to start Weekly; at {0} every {1} + + VMs by Windows Update Capability + + + Windows Update capable + + + Not Windows Update capable + &Next > diff --git a/XenModel/XenAPI-Extensions/VM.cs b/XenModel/XenAPI-Extensions/VM.cs index 45a743672..93b647348 100644 --- a/XenModel/XenAPI-Extensions/VM.cs +++ b/XenModel/XenAPI-Extensions/VM.cs @@ -1920,6 +1920,15 @@ namespace XenAPI this.IsHVM && BoolKey(this.platform, "viridian"); } } + + public bool WindowsUpdateCapable + { + get + { + return + this.has_vendor_device && this.IsWindows; + } + } } public struct VMStartupOptions diff --git a/XenModel/XenSearch/Common.cs b/XenModel/XenSearch/Common.cs index c3ab95eb0..8ca962df3 100644 --- a/XenModel/XenSearch/Common.cs +++ b/XenModel/XenSearch/Common.cs @@ -169,7 +169,10 @@ namespace XenAdmin.XenSearch has_custom_fields, [HelpString("Whether the VM is in any vApp")] - in_any_appliance + in_any_appliance, + + [HelpString("Windows Update capability")] + vendor_device_state, } public enum ColumnNames @@ -268,6 +271,8 @@ namespace XenAdmin.XenSearch PropertyNames_i18n[PropertyNames.folders] = Messages.ANCESTOR_FOLDERS; PropertyNames_i18n[PropertyNames.has_custom_fields] = Messages.HAS_CUSTOM_FIELDS; PropertyNames_i18n[PropertyNames.in_any_appliance] = Messages.IN_ANY_APPLIANCE; + PropertyNames_i18n[PropertyNames.vendor_device_state] = Messages.WINDOWS_UPDATE_CAPABLE; + PropertyNames_i18n_false[PropertyNames.vendor_device_state] = Messages.WINDOWS_UPDATE_CAPABLE_NOT; VM_power_state_images[vm_power_state.Halted] = Icons.PowerStateHalted; VM_power_state_images[vm_power_state.Paused] = Icons.PowerStateSuspended; @@ -325,6 +330,15 @@ namespace XenAdmin.XenSearch return vm.power_state; }); }; + + properties[PropertyNames.vendor_device_state] = delegate(IXenObject o) + { + return GetForRealVM(o, delegate(VM vm, IXenConnection conn) + { + return (bool?)vm.WindowsUpdateCapable; + }); + }; + properties[PropertyNames.virtualisation_status] = delegate(IXenObject o) { return GetForRealVM(o, delegate(VM vm, IXenConnection conn) diff --git a/XenModel/XenSearch/Search.cs b/XenModel/XenSearch/Search.cs index 9ab95c016..5d676c018 100644 --- a/XenModel/XenSearch/Search.cs +++ b/XenModel/XenSearch/Search.cs @@ -868,6 +868,18 @@ namespace XenAdmin.XenSearch searches["dead-beef-1234-snapshotsbyvm"] = SnapshotsByVM; + // VMs by Windows Update capability + + Search VMsByWindowsUpdateCapability = new Search( + new Query( + new QueryScope(ObjectTypes.VM), + null), + new PropertyGrouping(PropertyNames.vendor_device_state, null), + false, Messages.VMS_BY_WINDOWS_UPDATE_CAPABILITY, "dead-beef-1234-vmsbywinupdate", true + ); + + searches["dead-beef-1234-vmsbywinupdate"] = VMsByWindowsUpdateCapability; + /* //Docker containers by VM Search dockerContainersByVM = new Search(