public override bool Show(bool showHiddenVMs) { if (name_label.StartsWith(Helpers.GuiTempObjectPrefix)) { return(false); } SRTypes srType = GetSRType(false); // CA-15012 - dont show cd drives of type local on miami (if dont get destroyed properly on upgrade) if (srType == SRTypes.local) { return(false); } // Hide Memory SR if (srType == SRTypes.tmpfs) { return(false); } if (showHiddenVMs) { return(true); } //CP-2458: hide SRs that were introduced by a DR_task if (introduced_by != null && introduced_by.opaque_ref != Helper.NullOpaqueRef) { return(false); } return(!IsHidden()); }
public string Target() { SR sr = Connection.Resolve(new XenRef <SR>(this.opaque_ref)); if (sr == null) { return(String.Empty); } foreach (PBD pbd in sr.Connection.ResolveAll(sr.PBDs)) { SRTypes type = sr.GetSRType(false); if ((type == SR.SRTypes.netapp || type == SR.SRTypes.lvmoiscsi || type == SR.SRTypes.equal) && pbd.device_config.ContainsKey("target")) // netapp or iscsi { return(pbd.device_config["target"]); } else if (type == SR.SRTypes.iso && pbd.device_config.ContainsKey("location")) // cifs or nfs iso { String target = Helpers.HostnameFromLocation(pbd.device_config["location"]); // has form //ip_address/path if (String.IsNullOrEmpty(target)) { continue; } return(target); } else if (type == SR.SRTypes.nfs && pbd.device_config.ContainsKey("server")) { return(pbd.device_config["server"]); } } return(String.Empty); }
public bool IsLocalSR() { SRTypes typ = GetSRType(false); return(typ == SRTypes.local || typ == SRTypes.ext || typ == SRTypes.lvm || typ == SRTypes.udev || typ == SRTypes.egeneracd || typ == SRTypes.dummy); }
/// <summary> /// Can create with XC, or is citrix storage link gateway. Special case alert! /// </summary> public bool CanCreateWithXenCenter() { SRTypes typ = GetSRType(false); return(typ == SRTypes.iso || typ == SRTypes.lvmoiscsi || typ == SRTypes.nfs || typ == SRTypes.equal || typ == SRTypes.netapp || typ == SRTypes.lvmohba || typ == SRTypes.cslg || typ == SRTypes.smb || typ == SRTypes.lvmofcoe); }
/// <summary> /// True if there is less than 0.5GB free. Always false for dummy and ebs SRs. /// </summary> public bool IsFull() { SRTypes t = GetSRType(false); return(t != SRTypes.dummy && t != SRTypes.ebs && FreeSpace() < XenAdmin.Util.BINARY_GIGA / 2); }
/// <summary> /// A friendly (internationalized) name for the SR type. /// </summary> public static string GetFriendlyTypeName(SRTypes srType) { return(FriendlyNameManager.GetFriendlyName(string.Format("Label-SR.SRTypes-{0}", srType.ToString()))); }
public bool Physical() { SRTypes typ = GetSRType(false); return(typ == SRTypes.local || (typ == SRTypes.udev && SMConfigType() == SM_Config_Type_CD)); }
/// <summary> /// Is an iSL type or legacy iSl adapter type /// </summary> public static bool IsIslOrIslLegacy(SR sr) { SRTypes currentType = sr.GetSRType(true); return(currentType == SRTypes.cslg || currentType == SRTypes.equal || currentType == SRTypes.netapp); }
/// <summary> /// A friendly (internationalized) name for the SR type. /// </summary> public static string getFriendlyTypeName(SRTypes srType) { return(PropertyManager.GetFriendlyName(string.Format("Label-SR.SRTypes-{0}", srType.ToString()), "Label-SR.SRTypes-unknown")); }