diff --git a/XenModel/Actions/Host/EditMultipathAction.cs b/XenModel/Actions/Host/EditMultipathAction.cs index ea45e9a17..89b5ed006 100644 --- a/XenModel/Actions/Host/EditMultipathAction.cs +++ b/XenModel/Actions/Host/EditMultipathAction.cs @@ -31,6 +31,7 @@ using System; using System.Collections.Generic; +using XenAdmin.Core; using XenAPI; @@ -71,18 +72,22 @@ namespace XenAdmin.Actions } // CA-19392: Multipath enablement / disablement - if (multipath) + + if (Helpers.KolkataOrGreater(host)) { - Host.remove_from_other_config(Session, host.opaque_ref, Host.MULTIPATH); - Host.add_to_other_config(Session, host.opaque_ref, Host.MULTIPATH, "true"); - Host.remove_from_other_config(Session, host.opaque_ref, Host.MULTIPATH_HANDLE); - Host.add_to_other_config(Session, host.opaque_ref, Host.MULTIPATH_HANDLE, DEFAULT_MULTIPATH_HANDLE); + Host.set_multipathing(Session, host.opaque_ref, multipath); } else { Host.remove_from_other_config(Session, host.opaque_ref, Host.MULTIPATH); - Host.add_to_other_config(Session, host.opaque_ref, Host.MULTIPATH, "false"); - Host.remove_from_other_config(Session, host.opaque_ref, Host.MULTIPATH_HANDLE); + Host.add_to_other_config(Session, host.opaque_ref, Host.MULTIPATH, multipath.ToString().ToLowerInvariant()); + } + + Host.remove_from_other_config(Session, host.opaque_ref, Host.MULTIPATH_HANDLE); + + if (multipath) + { + Host.add_to_other_config(Session, host.opaque_ref, Host.MULTIPATH_HANDLE, DEFAULT_MULTIPATH_HANDLE); } } diff --git a/XenModel/Actions/SR/SrRepairAction.cs b/XenModel/Actions/SR/SrRepairAction.cs index 53ef8ab7a..a6440abb3 100644 --- a/XenModel/Actions/SR/SrRepairAction.cs +++ b/XenModel/Actions/SR/SrRepairAction.cs @@ -32,6 +32,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using XenAdmin.Network; using XenAdmin.Core; using XenAPI; @@ -108,6 +109,23 @@ namespace XenAdmin.Actions int max = _hostList.Count * 2; int delta = 100 / max; + try + { + if (SR.GetSRType(true) == SR.SRTypes.gfs2) + { + var cluster = Connection.Cache.Clusters.FirstOrDefault(); + if (cluster != null) + { + Cluster.pool_resync(Session, cluster.opaque_ref); + } + } + } + + catch (Exception e) + { + log.DebugFormat("Cluster pool resync failed with {0}", e.Message); + } + foreach (Host host in _hostList) { if (!host.HasPBDTo(SR) && SR.shared && SR.PBDs.Count > 0) diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index f6da74f70..6c2e748b0 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -150,12 +150,23 @@ namespace XenAPI public string GetIscsiIqn() { + if (Helpers.KolkataOrGreater(this)) + { + return iscsi_iqn; + } return Get(other_config, "iscsi_iqn") ?? ""; } public void SetIscsiIqn(string value) { - other_config = SetDictionaryKey(other_config, "iscsi_iqn", value); + if (Helpers.KolkataOrGreater(this)) + { + iscsi_iqn = value; + } + else + { + other_config = SetDictionaryKey(other_config, "iscsi_iqn", value); + } } public override string ToString() @@ -493,6 +504,10 @@ namespace XenAPI public bool MultipathEnabled() { + if (Helpers.KolkataOrGreater(this)) + { + return multipathing; + } return BoolKey(other_config, MULTIPATH); }