<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SRE Archives - OVHcloud Blog</title>
	<atom:link href="https://blog.ovhcloud.com/tag/sre/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ovhcloud.com/tag/sre/</link>
	<description>Innovation for Freedom</description>
	<lastBuildDate>Fri, 08 Jan 2021 11:14:46 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ovhcloud.com/wp-content/uploads/2019/07/cropped-cropped-nouveau-logo-ovh-rebranding-32x32.gif</url>
	<title>SRE Archives - OVHcloud Blog</title>
	<link>https://blog.ovhcloud.com/tag/sre/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Warden: the self-healing framework for local actions</title>
		<link>https://blog.ovhcloud.com/warden-the-self-healing-framework-for-local-actions/</link>
		
		<dc:creator><![CDATA[Alexandre Gauthier]]></dc:creator>
		<pubDate>Wed, 09 Dec 2020 11:23:14 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Self-heal at Webhosting]]></category>
		<category><![CDATA[SRE]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=19951</guid>

					<description><![CDATA[This article is the follow up to Selfheal at Webhosting &#8211; The External Part published on 2020-07-17.Part two below covers the local self-healing system. Introduction With over 15-000 servers dedicated to providing services for 6 million websites and web applications of all sorts, across multiple data-centers and geographical zones, a certain amount of software failures [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwarden-the-self-healing-framework-for-local-actions%2F&amp;action_name=Warden%3A%20the%20self-healing%20framework%20for%20local%20actions&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>This article is the follow up to <a href="https://www.ovh.com/blog/selfheal-at-webhosting-the-external-part/" data-wpel-link="exclude">Selfheal at Webhosting &#8211; The External Part</a> published on 2020-07-17.<br>Part two below covers the local self-healing system.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img fetchpriority="high" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/11/IMG_0392-1024x537.png" alt="Warden: the self-healing framework for local actions" class="wp-image-20157" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392.png 1200w" sizes="(max-width: 768px) 100vw, 768px" /></figure></div>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Introduction">Introduction</h3>



<p>With over 15-000 servers dedicated to providing services for 6 million websites and web applications of all sorts, across multiple data-centers and geographical zones, a certain amount of software failures are inevitable. They must be handled to ensure the servers are in a functional state to provide continuity-of-service.</p>



<p>The overhead only increases once you account for supporting pieces of the infrastructure that provide the service, or by clients to access and manage their data.</p>



<p>Generally speaking, restarting failed services and reacting to health checks failing with automatic operations can be done swiftly with a simple install of, for example &#8211; <em>Monit</em>, or <em>Systemd</em> Unit Parameters.</p>



<p>Web-hosting infrastructure, however, poses unique challenges that require a holistic response.</p>



<p>It&#8217;s not only large, but it&#8217;s distributed and&nbsp;<a href="https://www.ovh.com/blog/web-hosting-how-to-host-3-million-websites/" data-wpel-link="exclude">highly available</a>. A web host encountering a failure will not degrade the service, as another node in a cluster will immediately take its place to service client requests.</p>



<p>Additionally, providing Shared Hosting as a service means you are mostly running Unknown Workloads. No two websites have the same requirements, performance, or behavior. You can&#8217;t therefore make assumptions about what is normal, and what isn&#8217;t, which in turn makes establishing a baseline for Abnormal Behavior difficult.</p>



<p>In this context, it is generally&nbsp;an inevitable fact of life that sometimes those workloads will misbehave, crash, or put the system into a state it cannot recover from without intervention.</p>



<p>Trying to prevent this is therefore futile. Facilitating recovery within isolated fault domains is a more productive approach and is where self-healing becomes useful. </p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Self-healingsystems">Self-healing systems</h3>



<p>While the highly available nature of the infrastructure means failure states don&#8217;t necessarily degrade the service &#8211; the cause still needs to be investigated and the system recovered before being returned to the pool of available hosts to serve requests.</p>



<p>Without automated systems in place to achieve this, it can easily turn into a battle of attrition. Systems to diagnose and clear can pile up and eat into actual time spent on improvements and long-term mitigation of failure states.</p>



<p>We therefore employ two self-healing systems at Webhosting to automate the process:</p>



<ul class="wp-block-list"><li><a href="https://www.ovh.com/blog/selfheal-at-webhosting-the-external-part/" data-wpel-link="exclude">Healer: External self-healing</a>, which handles hardware problems, the absence of connectivity, and anything the local systems can&#8217;t resolve locally.</li><li>Warden: A local agent that exposes a framework for self-healing on local nodes.  Warden is the component we will be exploring today.</li></ul>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-EnterWarden">Enter Warden</h3>



<div class="wp-block-image"><figure class="alignright size-large is-resized"><img decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0393.png" alt="" class="wp-image-20161" width="302" height="236" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0393.png 604w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0393-300x234.png 300w" sizes="(max-width: 302px) 100vw, 302px" /></figure></div>



<p>Warden was designed as a simple, lightweight daemon process that exposes a plugin API, allowing members of the SRE team to quickly write small pluggable python scripts that handle specific conditions found on the local system. It is meant to exist as an agent on every single server of the web-hosting fleet, where it will work to maintain integrity and record information about failure states.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Goals">Goals</h3>



<p>Warden has a few specific long term goals, which are worth going over.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-MaximizeSystemAvailability">Maximize system availability</h4>



<p>Warden attempts to detect scenarios that would degrade or otherwise disrupt the service and responds to fault events from the monitoring system. This allows for the quick return of the system to a functional, clean state; allowing it to reintegrate the available hosts pool and serve requests again. Being a local, per-server process, Warden is able to be reactive and process events in a timely fashion, avoiding network round trips and monitoring delays. This contributes to the general health of the infrastructure by keeping the amount of hosts in a failure state at a bare minimum. </p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Logdiagnosticdataforlateranalysis">Log diagnostic data for later analysis</h4>



<p>Being a local agent present on every system, Warden is in the enviable position of being able to collect all sorts of surrounding data for export upon detecting a failure state.</p>



<p>Warden keeps a detailed record of the failure state and surrounding system state, to be queried later. This ensures diagnosis is not a blocking point for returning the host to duty. It is also important to remember the goal is&nbsp;<strong>not</strong>&nbsp;to sweep failure states under the carpet, or mask them.</p>



<p>Additionally, since many of these failure states are non-critical (as other hosts take over transparently), it may be&nbsp;<em>multiple days</em>&nbsp;by the time someone gets to look at it, at which point the relevant state to inspect is long gone, and we&#8217;re just left with an empty, yet offline server.</p>



<p>The primary goal here is actually to increase visibility into failure states, and to be able to quickly identify trends and underlying issues that must be mitigated or resolved, while ensuring the relevant data is kept while fresh.</p>



<p>At runtime, Warden generates snapshots of interesting system aspects. A long term goal is to capture a meaningful representation of the entire system state at the time of event, preventing the need to perform diagnostics directly on affected hosts.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-MinimizeHumanOverhead">Minimise human overhead</h4>



<p>Analysis of failure states can be highly time consuming, especially if you&#8217;re flooded by hundreds of systems reporting mostly the same issue. It can also be irritating to constantly deal with transient failure states that are considered &#8220;normal&#8221;, either due to known popular application bugs, or other known circumstances. Just sorting the signal from the noise can be a full time job, especially if your team is actively trying to maintain general health and resolve the issue long term.</p>



<p>This can quickly turn into a battle of attrition where resources are expended on managing the alerts, failure states and problems over actively working to mitigate and resolve them.</p>



<p>Warden hopes to streamline this process massively, allowing SRE people to focus on what actually matters and makes a difference in terms of Quality of Service.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Makewritingself-healingpluginseasy">Make writing self-healing plugins easy</h4>



<p>The API Warden is meant to be simple. It abstracts much of the nuts and bolts of the implementation process involved in execution.</p>



<p>Plugin authors should not have to worry about scheduling their own run, or writing complex logic to obtain the information they are after, nor should they have to write solid logging code.</p>



<p>All of this should be handled by Warden. Plugin authors should be able to focus on describing their conditions, selecting what relevant data they want to record, and writing an action that hopefully restores functionality.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Howdoesitwork?">How does it work?</h3>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="462" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0394-1024x462.png" alt="Warden - How does it work?" class="wp-image-20164" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-1024x462.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-300x135.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-768x346.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-1536x693.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394.png 1905w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-WardenCore">Warden Core</h4>



<p>As previously mentioned, Warden is a small daemon written entirely in Python. On boot, it will enumerate the plugins it is configured to activate, and place them in a queue.</p>



<p>Plugins may have configuration values as well, exposing easily tunable thresholds for response, or other settings. The Warden Core essentially serves to orchestrate everything, as well as provide the plugin API.</p>



<p>It also keeps track of various internal decisions, plugin states and how many times a plugin has done a self-healing action.</p>



<p>Then, once booted, the main workflow starts.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-StateCollection">State Collection</h4>



<p>Warden immediately goes and collects system states from its available sources. This could be, for example, a monitoring probe sink &#8211; which can be queried remotely as well as locally &#8211; or a snapshot of the process table.</p>



<p>Some deeper information is also generated, on demand, to keep the system load as light as possible.</p>



<p>This information is then sent to plugins matching the type of state collector. For example, plugins that operate on the process table will be gently fed this information.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Pluginhandoff">Plugin hand off</h4>



<p>A Warden plugin consists of essentially three primary callbacks, which should be easy to implement.</p>



<p>Plugins are encouraged to terminate early if they do not find actionable items in the system state.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-ScanPhase">Scan Phase</h5>



<p>In this phase, a Warden plugin will receive information about the system state, in a form it can easily digest, using standard Python data structures.<br>The plugin can select some particular pieces of information it would like to further analyze, if necessary.</p>



<p>If an event is detected that the plugin can respond to immediately, then this is recorded to a&nbsp;<strong>Central Store</strong>&nbsp;(provided by our own Logs Data Platform product)</p>



<p>If at this point, a self-heal action is necessary, the plugin can signal it by setting its internal state accordingly.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-AnalysisPhase">Analysis Phase</h5>



<p>During this phase, the plugin will further dissect the received status, and/or collect information about the system &#8211; either requesting them from Warden, or collecting them itself.</p>



<p>This is where the diagnostic information will be exported to a&nbsp;<strong>Central Store</strong>, alongside a plethora of useful metadata (where, when, who, how).</p>



<p>At this point, if not already signaled by the previous phase, the plugin can mark its internal state as requiring an action.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-HealPhase">Heal Phase</h5>



<p>Warden will then check the internal state of the plugin, and if it needs to perform an action, this final phase will be executed.<br>This is where the logic to resolve the situation is written. Services get restarted, processes get terminated, maintenance scripts called, etc.<br><br>Success (or failure) is reported, and Warden will dutifully log the Action and its results to the&nbsp;<strong>Central Store.</strong></p>



<p>At this point, if an action was taken, Warden will refresh the corresponding state before moving on to the next plugin in the queue.</p>



<p>This process is repeated at configurable intervals that can be kept short, since plugins are lightweight and exit quickly if no issue is found.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-DashboardsandVisibility">Dashboards and Visibility</h4>



<p>Extensive Grafana dashboards as well as Graylog interfaces have been built to closely monitor everything the Warden does.</p>



<p>They simply query the Central Store where every single system reports its events and actions.</p>



<p>We can tell how frequently a specific self-heal is triggered, for example, on what amount of systems, and where they occur the most.</p>



<p>We can also easily tell where self-heals fail the most, between individual failure domains, or down to individual systems within a cluster.</p>



<p>They are made to be easy to drill down into, to get a bird eye&#8217;s view of the global state as well as a detailed view of the exact actions taken by a single plugin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="540" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1024x540.png" alt="" class="wp-image-20168" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1024x540.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-300x158.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-768x405.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1536x810.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana.png 1893w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Keeping this up on a TV Monitor in office has been of incredible value when it comes to casually noticing trends, as well as identifying which problems are recurrent and which are transient.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-APracticalExample">A Practical Example</h3>



<p>As a practical example of how Warden can be tied into existing systems and handling their events, there exists a probe on our servers that verifies the availability of the hosting runtime stack, ensuring it functions and is in the correct state to process requests.</p>



<p>It would often raise an alarm after some specific code in our hosting stack either terminates abnormally, or creates a scenario where the stack was incapable of recovering on its own. This would generate an alert, mark the server as unavailable, and remove it from the active pool.</p>



<p>Rebooting the server or restarting the entire stack would obviously resolve the situation and return the system to the pool of available hosts, but this robs us of the opportunity to inspect the issue. Existing metrics and logs only shed partial light into what exactly had occurred in order to cause this; especially since reproducing it will often be dependent on specific applications we host. Not to mention that by the time someone got to look at it, the chances are that the interesting state has long left the system.</p>



<p>In order to mitigate this, a Warden plugin was written with the following logic:</p>



<ul class="wp-block-list"><li>It scans the local alert sink for the failure state (exiting if it is not present)</li><li>During the analysis phase, crash dumps are collected, the filesystem state is recorded, relevant logs are extracted.<br>The exact version of the hosting stack is also collected, alongside everything relevant.<br>This is then sent to the Central Store alongside information about the host, the site, and timestamps.<br>The plugin then marks itself as needing to take action.</li><li>Everything relevant having been collected will mean that the hosting stack is destroyed, cleaned, and relaunched.</li><li>Afterwards, the probe that raised the alert is refreshed. Congratulations, the system is now back online, and in a matter of minutes!</li></ul>



<p>The turnaround time for writing the plugin was also reasonably short, and was deemed complete in two iterations (mostly to collect more data).</p>



<p>This information helped our developers pin-point exactly what was happening, as well as continuing to be a solid metric for gauging the health of our infrastructure.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-InConclusion">In Conclusion</h3>



<p>So far, Warden has helped not only lower the amount of human resources expended towards diagnosing and resolving issues, but has generated targeted improvements to various components of our stack.</p>



<p>It has also identified issues that would otherwise have gone unnoticed simply by graphing a visual trend of certain non-fatal states, which has led to more fixes and improvements.</p>



<p>On-call duty cycles have also been reasonably more peaceful as the bar for accessibility has been significantly lowered when it comes to automating resolution of simple issues.</p>



<p>It has generally allowed us to better focus our energy where we are able to make a difference, and through further improvements, will hopefully continue to do so.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwarden-the-self-healing-framework-for-local-actions%2F&amp;action_name=Warden%3A%20the%20self-healing%20framework%20for%20local%20actions&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Selfheal at Webhosting &#8211; The external part</title>
		<link>https://blog.ovhcloud.com/selfheal-at-webhosting-the-external-part/</link>
		
		<dc:creator><![CDATA[Florian Chardin]]></dc:creator>
		<pubDate>Fri, 17 Jul 2020 12:34:38 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Self-heal at Webhosting]]></category>
		<category><![CDATA[SRE]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=18726</guid>

					<description><![CDATA[Introduction With almost 6000000 websites hosted on more than 15000 servers, the OVHcloud Webhosting SRE team manage lots of alerts during their working day. Our infrastructure is constantly growing, but to scale smoothly, the amount of time spent solving alerts should not increase proportionally. We need, therefore, some tools to help us.&#160;&#160;In our team, we [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fselfheal-at-webhosting-the-external-part%2F&amp;action_name=Selfheal%20at%20Webhosting%20%26%238211%3B%20The%20external%20part&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Introduction">Introduction</h3>



<p>With almost 6000000 websites hosted on more than 15000 servers, the OVHcloud Webhosting SRE team manage lots of alerts during their working day. </p>



<p>Our infrastructure is constantly growing, but to scale smoothly, the amount of time spent solving alerts should not increase proportionally.</p>



<p>We need, therefore, some tools to help us.&nbsp;&nbsp;In our team, we call it the <em>selfheal</em>.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="537" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-1024x537.jpeg" alt="Selfheal at Webhosting – The external part" class="wp-image-18848" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-1024x537.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-300x157.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-768x403.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F.jpeg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Whatistheselfheal?">What is the <em>selfheal</em>?</h3>



<p>The <em>selfheal </em>refers to the automation of alert solving in our production environments. The automated process is able to fix well-known issues, with no admin interaction.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Whydoweneedit?">Why do we need it?</h3>



<p>We must limit the time we spend to solve alerts as far as possible. Not only so we have the time to run and maintain the infrastructure, but also to stay up to date.</p>



<p>With the number of servers we manage, a small issue can represent dozens of alerts.</p>



<p>We need to be efficient by automating as many production chores as possible.</p>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Hardware">Hardware</h4>



<p>Serving billions of HTTP requests each day requires a lot of resources, which is why we often use physical servers in our datacenters. </p>



<p>Even a single physical server requires a big follow up. It takes a lot of time to diagnose, schedule downtime, request and manage an intervention with datacenter teams, or even to reinstall the operating system when a disk is faulty.</p>



<p>We cannot afford to spend hours on repetitive tasks when they can be automated.</p>



<h4 class="wp-block-heading">Software</h4>



<p>Even if software seems predictable, it will still encounter failure. This is true even when managing the underlying infrastructure&nbsp;that hosts millions of lines of unknown code provided by our client.</p>



<p>While we try to have a stable software stack, we cannot predict all behaviour. Many of the software problems can be solved with a restart or a quick fix, and lots of these operations can also be automated.</p>



<p>We should alert the on-call admin staff as little as possible, only when it&#8217;s absolutely necessary.</p>



<p>The idea is is to log each action done by the <em>selfheal </em>to identify bug or error patterns and then work on longer term fixes.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Theselfhealatwebhosting">The <em>selfheal </em>at Webhosting</h3>



<p>At Webhosting we split <em>selfheal </em>in two part:</p>



<ol class="wp-block-list"><li>External <em>selfheal </em>which handles hardware problems or anything that can not be solved by the host itself.</li><li>Internal <em>selfheal </em>which is intended to solve software problems on a given system.</li></ol>



<p>In this article, we will discuss the the external part.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Externalselfheal">External <em>selfheal</em></h3>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Context">Context:</h4>



<p>As we said earlier, the external part of our <em>selfheal </em>is mainly intended to solve hardware problems that cannot be solved by the server alone.</p>



<p>To accomplish this, we created a small micro-service application that listens &#8211; monitoring events.</p>



<p>We could have chosen an existing tool (like StackStorm), but we didn&#8217;t. Here&#8217;s why:</p>



<ul class="wp-block-list"><li>Building micro-services is really simple and fast at OVH.</li><li>Structured, detailed and simple logs with a uniq uuid to follow each selfheal task in our internal logging system (which allow us to graph them easily).&nbsp;</li><li>Simple integration with our existing tools and ecosystem&nbsp;</li><li>Fast and easy deployment in all our regions</li><li>Simple CI/CD (unit-testing, etc)</li><li>Custom notifications, like chat-bot</li><li>Intelligence and history</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="280" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1024x280.png" alt="External Selfheal" class="wp-image-18826" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1024x280.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-300x82.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-768x210.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1536x419.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Howitworks">How it works</h4>



<p>Everything starts with our monitoring, which scraps the servers probes and sends all alerts in a Kafka topic.</p>



<p>The application consumes Kafka events and then reacts instantly with the correct workflow, depending on the problem.</p>



<p>The app will react with the appropriate workflow depending on the alert it gets. It does this by performing the correct API call to our different services and tools.</p>



<p>All actions performed are stored. This prevents having to do the same fix several times on a given server and to identify complex problems.</p>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Concreteexampleonfaultydiskreplacement">Concrete example on faulty disk replacement</h4>



<p>One of the top time-consuming alerts we&#8217;ve had to solve was the replacement of unhealthy HDD found by SMART checks.</p>



<p>Being stateless, lots of our servers use a single disk with no raid setup.&nbsp;It also means replacing a disk to reinstall the host; but hopefully, it can be done with a single API call.</p>



<p>To manage this alert, an admin had to do the following actions:</p>



<ol class="wp-block-list"><li>Put the server in maintenance to drain client requests</li><li>Create a datacenter request to replace the HDD</li><li>Reinstall the server</li></ol>



<p>This whole process can take up to 3 hours and is hard to execute manually (managing several issues at once).&nbsp;</p>



<p>The first thing we did, was to automate the check with a probe.</p>



<p>Then, we decided to automate the whole thing with a simple workflow in our self-healing application, then to orchestrate the API call.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="352" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1024x352.png" alt="Internal Selfheal" class="wp-image-18827" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1024x352.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-300x103.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-768x264.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1536x528.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>With this process, we are able to replace disks every day without any manual tasks performed by an admin.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Toconclude">To conclude</h3>



<p>Last month, our external <em>selfheal </em>tool requested more than 70 datacenter interventions to datacenter teams which represents a big time saving.</p>



<p>We won in reactivity. No more lag between the time an alert is detected and when it&#8217;s handled.</p>



<p>Alerts are handled instantly when detected by the monitoring system. It helps us to keep a clean monitoring backlog and to avoid &#8220;batches&#8221; of alert solving, which were complicated for both us and DC.</p>



<p>Now, we just handle alerts that cannot be solved through automation and focus on corner cases, where admin interactions are valuable and required.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fselfheal-at-webhosting-the-external-part%2F&amp;action_name=Selfheal%20at%20Webhosting%20%26%238211%3B%20The%20external%20part&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
