Exemple #1
0
        protected override Problem RunCheck()
        {
            if (!Host.IsLive())
            {
                return(new HostNotLiveWarning(this, Host));
            }

            IEnumerable <VM> runningOrPausedVMs = GetRunningOrPausedVMs(Host);
            IEnumerable <SR> brokenSRs          = PBD.GetSRs(PBD.GetUnpluggedPBDsFor(runningOrPausedVMs));

            foreach (SR sr in brokenSRs)
            {
                if ((sr.shared && !sr.CanBeSeenFrom(Host)) || (!sr.shared && sr.GetStorageHost() == Host && !sr.CanBeSeenFrom(Host)))
                {
                    return(new BrokenSR(this, sr, Host));
                }
            }

            if (srUploadedUpdates != null &&
                ((srUploadedUpdates.shared && !srUploadedUpdates.CanBeSeenFrom(Host)) ||
                 (!srUploadedUpdates.shared && srUploadedUpdates.IsBroken())))
            {
                return(new BrokenSR(this, srUploadedUpdates, Host));
            }

            return(null);
        }
Exemple #2
0
        protected override Problem RunCheck()
        {
            if (!Host.IsLive())
            {
                return(new HostNotLiveWarning(this, Host));
            }

            IEnumerable <VM> runningOrPausedVMs = GetRunningOrPausedVMs(Host);
            IEnumerable <SR> brokenSRs          = PBD.GetSRs(PBD.GetUnpluggedPBDsFor(runningOrPausedVMs));

            foreach (SR sr in brokenSRs)
            {
                return(new BrokenSR(this, sr));
            }
            return(null);
        }