# If Azure Scheduled Events are not used for 24 hours (e.g. because the cluster was asleep), it will be disabled for a VM.
# When the cluster wakes up and starts using it again, the DocumentIncarnation is reset.
# We need to remove it during cleanup, otherwise azure-events-az will not process the event after wakeup
self.node.setAttr(attr_lastDocVersion, None)
else:
ocf.logger.info("monitor: all local events finished, but some resources have not completed startup yet -> wait")
else:
if curState == AVAILABLE:
if len(localAzEventIds) > 0:
if clusterHelper.otherNodesAvailable(self.node):
ocf.logger.info("monitor: can handle local events %s -> set state STOPPING - %s" % (str(list(localAzEventIds.keys())), str(list(localAzEventIds.values()))))
# ... that still show in an event or shutting down resources ...
if curState in (STOPPING, IN_EVENT):
ocf.logger.info("removeOrphanedEvents: node %s has state %s" % (n, curState))
clusterEventIDs = self.getEventIDs(node=n)
stillActive = False
# ... but don't have any more events running according to Azure, ...
for p in clusterEventIDs:
if p in azEventIDs:
ocf.logger.info("removeOrphanedEvents: (at least) event %s on node %s has not yet finished" % (str(p), n))
stillActive = True
break
if not stillActive:
# ... put them back online.
ocf.logger.info("removeOrphanedEvents: clusterEvents %s on node %s are not in azEvents %s -> bring node back online" % (str(clusterEventIDs), n, str(azEventIDs)))