---
title: "KVM High Availability with SafeKit: Install the kvm.safe Module for Failover"
description: "SafeKit Video: Virtual Machine-Level Clustering with Hyper-V (5:15) In this video, discover how SafeKit implements high availability for Hyper-V without the complexity of a SAN. Learn to configure virtual machine replication across two nodes to ensure seamless failover for your critical virtualized workloads. Although this demonstration uses Hyper-V on Windows, the solution works identically with […]"
canonical: "https://safekit.eviden.com/quick-install/safekit-quick-installation-guide-with-kvm/"
topics: "High Availability Quick Installation Guide for KVM, SafeKit High Availability Limitations, Overview of the SafeKit / KVM solution, Installation of the SafeKit / KVM solution on Linux (kvm.safe), Step by step configuration of the SafeKit / KVM solution, Demonstration of a VM-level high availability solution, 🔍 SafeKit High Availability Navigation Hub"
category: "quick-install"
lang: "en"
---

<h1 id="kvm-high-availability-with-safekit-install-the-kvmsafe-module-for-failover">KVM High Availability with SafeKit: Install the kvm.safe Module for Failover</h1>
<h2 id="quick-guide">High Availability Quick Installation Guide for KVM</h2>
<p>This guide explains how to set up a <strong>kvm cluster</strong> for KVM using SafeKit, ensuring automatic failover and synchronous replication without the need for shared storage.</p>
<p>For help, you can use <a href="/resources/safekit-support/">SafeKit AI 🤖</a>.</p>
<h3 id="1-overview">1. Overview</h3>
<ul>
<li><strong>Architecture:</strong> Uses a two-node system (Primary/Secondary).</li>
<li><strong>Data Protection:</strong> Implements real-time synchronous replication for <strong>zero data loss</strong> (RPO=0).</li>
</ul>
<h3 id="2-installation">2. Installation</h3>
<ul>
<li><strong>Software:</strong> Install the SafeKit engine on both servers.</li>
<li><strong>Module:</strong> Download the pre-configured <code>kvm.safe</code> application module.</li>
</ul>
<h3 id="3-configuration">3. Configuration</h3>
<ul>
<li><strong>Web Console:</strong> Configure the specific folders containing the KVM files.</li>
<li><strong>Monitoring:</strong> Start monitoring and protecting the KVM application.</li>
</ul>
<h2 id="safekit-ha-limitations">SafeKit High Availability Limitations</h2>
<h3 id="why-a-replication-of-a-few-tera-bytes">Why a replication of a few Tera-bytes?</h3>
<p>Resynchronization time after a failure (<a href="/architectures/file-replication-byte-level-with-failover-kvm-cluster/#safekit-kvm-cluster">step 3</a>)</p>
<ul>
<li>1 Gb/s network ≈ 3 Hours for 1 Tera-bytes.</li>
<li>10 Gb/s network ≈ 1 Hour for 1 Tera-bytes or less depending on disk write performances.</li>
</ul>
<h4 id="alternative">Alternative</h4>
<ul>
<li>For a large volume of data, use <a href="/best-practises/san-vs-nas-shared-storage-for-a-failover-cluster/">external shared storage</a>.</li>
<li>More expensive, more complex.</li>
</ul>
<h3 id="why-a-replication-lt-1000000-files">Why a replication &lt; 1,000,000 files?</h3>
<ul>
<li>Resynchronization time performance after a failure (<a href="/architectures/file-replication-byte-level-with-failover-kvm-cluster/#safekit-kvm-cluster">step 3</a>).</li>
<li>Time to check each file between both nodes.</li>
</ul>
<h4 id="alternative-1">Alternative</h4>
<ul>
<li>Put the many files to replicate in a virtual hard disk / virtual machine.</li>
<li>Only the files representing the virtual hard disk / virtual machine will be replicated and resynchronized in this case.</li>
</ul>
<h3 id="why-a-failover--32-replicated-vms">Why a failover ≤ 32 replicated VMs?</h3>
<ul>
<li>Each VM runs in an independent kvm module.</li>
<li>Maximum of 32 kvm modules running on the same cluster.</li>
</ul>
<h4 id="alternative-2">Alternative</h4>
<ul>
<li>Use an external shared storage and another VM clustering solution.</li>
<li>More expensive, more complex.</li>
</ul>
<h3 id="why-a-lanvlan-network-between-remote-sites">Why a LAN/VLAN network between remote sites?</h3>
<ul>
<li>Automatic failover of the <a href="/best-practises/how-a-virtual-ip-address-works/">virtual IP address</a> with 2 nodes in the same subnet.</li>
<li>Good bandwidth for resynchronization (<a href="/architectures/file-replication-byte-level-with-failover-kvm-cluster/#safekit-kvm-cluster">step 3</a>) and good latency for <a href="/best-practises/synchronous-replication-vs-asynchronous-replication/">synchronous replication</a> (typically a round-trip of less than 2ms).</li>
</ul>
<h4 id="alternative-3">Alternative</h4>
<ul>
<li>Use a <a href="/best-practises/how-a-virtual-ip-address-works/">load balancer for the virtual IP address</a> if the 2 nodes are in 2 subnets (supported by SafeKit, especially in the cloud).</li>
<li>Use backup solutions with asynchronous replication for high latency network.</li>
</ul>
<h2 id="overview-of-the-safekit--kvm-solution">Overview of the SafeKit / KVM solution</h2>
<p>The solution is described here: <strong><a href="/solutions/linux-kvm-high-availability-replication-automatic-failover-load-balancing/">Simple Linux KVM High Availability without Shared Storage</a></strong></p>
<h2 id="installation-of-the-safekit--kvm-solution-on-linux-kvmsafe">Installation of the SafeKit / KVM solution on Linux (kvm.safe)</h2>
<h3 id="prerequisites">Prerequisites</h3>
<ul>
<li>KVM installed on 2 Linux nodes.</li>
<li>Critical applications installed inside one or more virtual machines.</li>
<li>Maximum 32 virtual machines per KVM host.</li>
<li>Total replicated data limited to a few terabytes — beyond this, resynchronization time becomes significant.</li>
<li>Minimum 1Gb/s interconnect between nodes (10Gb/s recommended for faster resynchronization).</li>
<li>IP failover requires both nodes on the same LAN or extended LAN (L2) — routed L3 networks not supported (except with <a href="/resources/safekit-user-guide-82/#Cloud">cloud load balancers</a>).</li>
</ul>
<h3 id="package-installation-on-linux">Package installation on Linux</h3>
<ul>
<li>Install the free version of SafeKit on 2 Linux nodes. Note: the free trial includes all SafeKit features. At the end of the trial, you can activate permanent license keys without uninstalling the package.</li>
<li>After the download of safekit_xx.bin package, execute it to extract the rpm and the safekitinstall script and then execute the <strong>safekitinstall</strong> script</li>
<li>Answer <strong>yes</strong> to firewall automatic configuration</li>
<li>Set the password for the web console and the default user <strong>admin</strong>. <strong>Set the same password on all nodes.</strong></li>
</ul>
<p><a href="/resources/safekit-free-trial/"> Download SafeKit (Linux) &gt; </a></p>
<h3 id="module-installation-on-linux">Module installation on Linux</h3>
<ul>
<li>Download the kvm.safe module.<br>
The module is free. It contains the files userconfig.xml and the restart scripts.</li>
<li>Put <strong>kvm.safe</strong> under <strong>/opt/safekit/Application_Modules/generic/</strong>.</li>
</ul>
<p><a class="btn-download" href="/wp-content/uploads/downloads_safekit/version-82/modules_linux/firebird.safe" download="kvm.safe">⬇️ Download kvm.safe (Linux) &gt;</a></p>
<h2 id="step-by-step-configuration-of-the-safekit--kvm-solution">Step by step configuration of the SafeKit / KVM solution</h2>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>The KVM configuration is presented with a virtual machine named `VM1` and containing the application to restart in case of failure.</span></div>
<p>You will have to repeat this configuration for all VMs that you want to replicate and to restart.</p>
<h3 id="prerequisite">1. Prerequisites</h3>
<p>The VM1 virtual machine image is in the file <code>/var/lib/libvirt/images/vm1.qcow2</code>. Before configuring SafeKit, you must perform the following configuration to place the virtual machine in a vm1-specific directory that will be replicated by SafeKit.</p>
<p>On node 1:</p>
<ul>
<li>
<p>Stop vm1:</p>
<pre><code>virsh shutdown vm1
</code></pre>
</li>
<li>
<p>Create a <code>vm1/</code> directory:</p>
<pre><code>mkdir -p /var/lib/libvirt/images/vm1/
</code></pre>
</li>
<li>
<p>Copy the vm1 image to the new location:</p>
<pre><code>cp -a /var/lib/libvirt/images/vm1.qcow2 /var/lib/libvirt/images/vm1/
</code></pre>
</li>
</ul>
<p>The original vm1 image can be deleted as soon as tests with the new location are successfull.</p>
<ul>
<li>
<p>Edit the vm1 configuration file:</p>
<pre><code>EDITOR=vi virsh edit vm1
</code></pre>
</li>
</ul>
<p>And change the line:</p>
<pre><code>    &lt;source file='/var/lib/libvirt/images/vm1.qcow2'&gt;
</code></pre>
<p>by :</p>
<pre><code>    &lt;source file='/var/lib/libvirt/images/vm1/vm1.qcow2'&gt;
</code></pre>
<ul>
<li>
<p>Set the <a href="/wp-content/uploads/2022/07/kvm-2.png">cache option to &rsquo;none&rsquo;</a> in the same file, for data integrity in case of crash:</p>
<pre><code>&lt;disk type='file' device='disk'&gt; &lt;driver name='qemu' type=’qcow2’ **cache='none'** /&gt;
</code></pre>
</li>
<li>
<p>Close the vm1 configuration file</p>
</li>
<li>
<p>Disable <a href="/wp-content/uploads/2022/07/kvm-3.png">vm1 automatic start</a>:</p>
<pre><code>virsh autostart vm1 --disable
</code></pre>
</li>
<li>
<p>Create a <code>vm1.xml</code> configuration file for vm1:</p>
<pre><code>virsh dumpxml vm1 &gt; vm1.xml
</code></pre>
</li>
</ul>
<p>On node 2:</p>
<ul>
<li>
<p>Copy the <code>vm1.xml</code> configuration file from node 1. Note: whenever vm1 configuration is changed on node 1, you must reapply the new configuration on node 2.</p>
</li>
<li>
<p>Create vm1 but do not start it:</p>
<pre><code>virsh define vm1.xml
</code></pre>
</li>
<li>
<p>Disable vm1 automatic start:</p>
<pre><code>virsh autostart vm1 --disable
</code></pre>
</li>
<li>
<p>Create the directory for the image location:</p>
<pre><code>mkdir -p /var/lib/libvirt/images/vm1/
</code></pre>
</li>
</ul>
<h3 id="2-launch-the-safekit-console">2. Launch the SafeKit console</h3>
<ul>
<li>Launch the web console in a browser on one cluster node by connecting to <code>http://localhost:9010</code>.</li>
<li>Enter <code>admin</code> as user name and the password defined during installation.</li>
</ul>
<p>You can also run the console in a browser on a workstation external to the cluster.</p>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>The configuration of SafeKit is done on both nodes from a single browser.</span></div>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>To secure the web console, see <a href="/resources/safekit-user-guide-82/#https">11. Securing the SafeKit web service</a> in the User's Guide.</span></div>
<img src="/wp-content/uploads/2024/03/01-login-large.png" alt="Start the SafeKit web console to configure the KVM cluster">
<h3 id="3-configure-node-addresses">3. Configure node addresses</h3>
<ul>
<li>Enter the node IP addresses, press the <code>Tab key</code> to check connectivity and fill node names. If either node1 or node2 has a red color, check connectivity of the browser to both nodes and check firewall on both nodes for <a href="/resources/safekit-user-guide-82/#Troubleshooting">troubleshooting</a>.</li>
<li>Then, click on <code>Save and apply</code> to save the configuration.</li>
<li>Check the <code>Success</code> ✅ message on both nodes.</li>
<li>If the configuration <code>Failure</code> ❌ occurs on one node, open the ▼ accordion for that node and review the messages. Note that you can use the SafeKit AI 🤖 for assistance.</li>
</ul>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>If you want, you can add a new `LAN and nodes` ( first ➕) to create a second heartbeat and a dedicated replication network.</span></div>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>If you click on `Advanced configuration`, the `cluster.xml` file is displayed. This file is automatically populated by the console and deployed on the nodes.</span></div>
<img src="/wp-content/uploads/2024/03/02-cluster-edit.png" alt="Enter the nodes of the KVM cluster">
<h3 id="4-select-a-module">4. Select a module</h3>
<ul>
<li>In <code>New module</code>, click on the <code>kvm.safe</code> module.</li>
</ul>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>In the blue banner at the top, 🛜 `node1` represents the console connection node. This node relays requests to `node2` when required.</span></div>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>The console looks for `xxx.safe` in the `Application_Modules/generic/` directory on the connection node (`node1`) if you placed a module there during installation.</span></div>
<img src="/wp-content/uploads/2024/03/04-module-new.png" alt="Choose the module for KVM">
<h3 id="5-configure-the-module">5. Configure the module</h3>
<ul>
<li>Choose an <code>Automatic</code> start of the module at boot without delay.</li>
<li>Normally, you have a single <code>Heartbeat</code> network on which the replication is made. But, you can define a private network if necessary (by adding a LAN at step 3).</li>
<li>Put in <code>VM_PATH</code>, the root path of the replicated directory (<code>/var/lib/libvirt/images</code>).</li>
<li>Enter in <code>VM_NAME</code>, the name of the virtual machine (<code>vm1</code>).</li>
</ul>
<p>We assume that the VM1 files are in <code>/var/lib/libvirt/image/vm1/</code> (see <a href="#prerequisite">prerequisites</a>). This directory will be replicated in real-time by SafeKit.</p>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>You do not need to configure a virtual IP address. VM1 will be rebooted on the secondary KVM with its physical IP address, and this IP address will be rerouted.</span></div>
<img src="/wp-content/uploads/2024/03/21-module-kvm-edit-config-1.png" alt="Enter the KVM parameters">
<h3 id="6-custom-checker-to-detect-vm-malfunction">6. Custom checker to detect VM malfunction</h3>
<p>The custom checker checks if the VM is running (with the &lsquo;virsh domstate&rsquo; command). If the VM is not running, the custom checker automatically restarts the VM on the same KVM node or on the other.</p>
<ul>
<li>Click on <code>Checkers / Custom</code> (see image).</li>
<li><code>Resource name</code> identifies the virtual machine with a resource name in SafeKit: <code>custom.VM_NAME_check</code>.</li>
<li>With <code>restart</code> in <code>Action</code>, the VM is restarted on the same KVM node. After 3 unsuccessful restarts in 24 hours, the SafeKit kvm module stops on the primary node and there is a failover of the VM on the secondary node.</li>
<li>If you set <code>stopstart</code> in <code>Action</code>, there is a direct failover on the other KVM node as soon as the VM is not running.</li>
</ul>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>For maintenance, if you want to stop the virtual machine, the custom checker will restart it automatically. To avoid that, you can temporarly <a href="/wp-content/uploads/2024/04/safekit-disable-checkers.png">suspend the checker 🖼️</a>. Or you can remove it by deleting the configuration line in the console.</span></div>
<img src="/wp-content/uploads/2024/12/custom-kvm-checker-2.png" alt="Enter the KVM custom checker parameters">
<h3 id="7-edit-scripts-optional">7. Edit scripts (optional)</h3>
<ul>
<li>Do not edit scripts.</li>
</ul>
<h3 id="8-communication-encryption-optional">8. Communication encryption (optional)</h3>
<ul>
<li>Keep encryption of communication between nodes.</li>
</ul>
<img src="/wp-content/uploads/2024/03/07-module-encryption.png" alt="Communication encryption of the KVM module">
<h3 id="9-save-and-apply">9. Save and apply</h3>
<ul>
<li><code>Save and apply</code> the configuration and scripts on both nodes.</li>
</ul>
<img src="/wp-content/uploads/2024/03/08-module-save.png" alt="Save and apply the KVM module configuration">
<h3 id="10-verify-successful-configuration">10. Verify successful configuration</h3>
<ul>
<li>Check the <code>Success</code> ✅ message on both nodes and click on <code>Monitor modules</code>.</li>
<li>If the configuration <code>Failure</code> ❌ occurs on one node, open the ▼ accordion for that node and review the messages. Note that you can use the SafeKit AI 🤖 for assistance.</li>
</ul>
<img src="/wp-content/uploads/2024/03/09-module-save-check.png" alt="Check the KVM module configuration success">
<h3 id="11-start-the-node-with-up-to-date-data">11. Start the node with up-to-date data</h3>
<ul>
<li>If node 1 has the up-to-date replicated directory for <code>vm1/</code>, select it and ⋯ <code>Force start</code> ▶ <code>As primary</code>.</li>
</ul>
<p>When node 2 will be started, all data will be copied from node 1 to node 2.</p>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>If you make the wrong choice, you run the risk of synchronizing outdated data on both nodes.</span></div>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>It is also assumed that `VM1` is stopped on node 1 so that SafeKit installs the replication mechanisms and then starts `VM1` in the `start_prim` script.</span></div>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>Use `Start` for subsequent starts: SafeKit retains the most up-to-date server. Starting `As primary` is a special start-up the first time or during exceptional operations.</span></div>
<img src="/wp-content/uploads/2024/03/10-monitoring-mirror-stop-stop-prim.png" alt="Start as primary the KVM node with the up-to-date data">
<h3 id="12-wait-for-the-transition-to-alone-green">12. Wait for the transition to ALONE (green)</h3>
<ul>
<li>Node 1 should reach the ALONE (green) state, which means that the <code>start_prim</code> script has been executed on node 1.</li>
</ul>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>If ALONE (green) is not reached or if VM1 is not started, analyze why with the <a href="/wp-content/uploads/2024/03/24-module-log-script.png">module log 🖼️</a> of node 1.</span></div>
<ul>
<li>Click the 🔍 <strong>log</strong> icon of <code>node1</code> to open the module log and look for error messages such as a checker detecting an error and stopping the module.</li>
<li>Click on <code>start_prim</code> in the log: output messages of the script are displayed on the right and errors can be detected such as VM1 incorrectly started.</li>
<li>Use the SafeKit AI 🤖 for assistance with log messages.</li>
</ul>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>If the cluster is in `WAIT (red) not uptodate, STOP (red) not uptodate` state, stop the WAIT node and <a href="/wp-content/uploads/2024/03/10-monitoring-mirror-stop-stop-prim.png">force its start as primary 🖼️</a>.</span></div>
<img src="/wp-content/uploads/2024/03/12-monitoring-alone-stop.png" alt="The first KVM node starts as primary and becomes ALONE">
<h3 id="13-start-node-2">13. Start node 2</h3>
<ul>
<li>⋯ <code>Start</code> node 2 with its contextual menu.</li>
<li>Wait for the SECOND (green) state.</li>
</ul>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>Node 2 stays in the SECOND (orange) state while resynchronizing the replicated directories (copy from node 1 to node 2).</span></div>
<p>This may take a while depending on the size of files to resynchronize in replicated directories and the network bandwidth.</p>
<p>To see the progress of the copy, see the <a href="/wp-content/uploads/2024/03/27-module-log-reintegration.png">module log 🖼️</a> and the <a href="/wp-content/uploads/2024/03/26-replication-resources-reintegration.png">replication resources 🖼️</a> of node 2. Use the SafeKit AI 🤖 for assistance with log messages.</p>
<img src="/wp-content/uploads/2024/03/13-monitoring-alone-stop-start.png" alt="Start the KVM node 2">
<h3 id="14-verify-that-the-cluster-is-operational">14. Verify that the cluster is operational</h3>
<ul>
<li>Check that the cluster is green/green with <code>VM1</code> running on the PRIM node and not running on the SECOND node.</li>
</ul>
<p>Only changes inside files are replicated in real time in this state.</p>
<img src="/wp-content/uploads/2024/03/14-monitoring-prim-second.png" alt="The KVM node 2 is SECOND (green)">
<h3 id="15-testing">15. Testing</h3>
<ul>
<li>Stop the PRIM node by scrolling down its contextual menu and clicking <code>Stop</code>.</li>
<li>Verify that there is a failover on the SECOND node which should become ALONE (green).</li>
<li>Check with KVM tools that <code>VM1</code> is running on node 2.</li>
</ul>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>If ALONE (green) is not reached on node2 or if VM1 is not started, analyze why with the <a href="/wp-content/uploads/2024/03/38-module-log-script-second.png">module log 🖼️</a> of node 2.</span></div>
<ul>
<li>Click the 🔍 <strong>log</strong> icon of <code>node2</code> to open the module log and look for error messages such as a checker detecting an error and stopping the module.</li>
<li>Click on <code>start_prim</code> in the log: output messages of the script are displayed on the right and errors can be detected such as VM1 incorrectly started.</li>
<li>Use the SafeKit AI 🤖 for assistance with log messages.</li>
</ul>
<div class="callout callout-warning"><img src="/wp-content/uploads/2022/07/warning-small.png" alt="Warning"><span>If everything is okay, initiate a start on node1, which will resynchronize the replicated directories from node2.</span></div>
<p>If things go wrong, stop node2 and <a href="/wp-content/uploads/2024/03/10-monitoring-mirror-stop-stop-prim.png">force the start as primary 🖼️</a> of node1, which will restart with its locally healthy data at the time of the stop.</p>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span>Note that you have a 🕒 **<a href="/wp-content/uploads/2026/05/safekit-console-timeline.png">timeline 🖼️</a>** that can be helpful to understand what happens in the cluster.</span></div>
<img src="/wp-content/uploads/2024/03/16-monitoring-prim-second-stop.png" alt="Stop the KVM module on the PRIM server">
<h3 id="16-if-necessary-configure-a-splitbrain-checker">16. If necessary, configure a splitbrain checker</h3>
<ul>
<li>See <a href="/best-practises/power-outage-and-network-isolation-in-a-cluster/">What are the different scenarios in case of network isolation in a cluster?</a> to know if you need to configure a splitbrain checker.</li>
<li>Go to the module configuration and click on <code>Checkers / Splitbrain</code> (see image) to edit the splitbrain parameters.</li>
<li><code>Save and apply</code> the new configuration to redeploy it on both nodes (module must be stopped on both nodes to save and apply).</li>
</ul>
<p><strong>Parameters</strong> :</p>
<ul>
<li><code>Resource name</code> identifies the witness with a resource name: <code>splitbrain.witness</code>. You can change this value to identify the witness.</li>
<li><code>Witness address</code> is the argument for a ping when a node goes from PRIM to ALONE or from SECOND to ALONE. Change this value with the IP of the witness (a robust element, typically a router).</li>
<li>Note: you can set several IPs separated by white spaces. Pay attention that the IP addresses must be accessible from one node but not from the other in the event of network isolation.</li>
</ul>
<img src="/wp-content/uploads/2024/04/safekit-split-brain-checker.png" alt="Enter the KVM splitbrain parameters">
<h3 id="17-replicating-snapshots">17. Replicating snapshots</h3>
<p>The directory that contains the snapshot xml files is:</p>
<pre><code>/var/lib/libvirt/qemu/snapshot/%VM_NAME%
</code></pre>
<p>where <code>VM_NAME</code> is the name of the virtual machine (vm1).</p>
<p>Note: If no snapshot has been created, create one to generate the directory (else the SafeKit configuration will fail).</p>
<p>To replicate it:</p>
<ul>
<li>
<p>In the module configuration, click on <code>Advanced Configuration</code> (see image) to edit <code>userconfig.xml</code>.</p>
</li>
<li>
<p>Insert the lines below into the <code>&lt;rfs&gt;</code> section of userconfig.xml:</p>
<pre><code>&lt;replicated dir=&quot;/var/lib/libvirt/qemu/snapshot/%VM_NAME%&quot; mode=&quot;read_only&quot;&gt; &lt;/replicated&gt;
</code></pre>
</li>
<li>
<p><code>Save and apply</code> the new configuration to redeploy the modified userconfig.xml file on both nodes (module must be stopped on both nodes to save and apply).</p>
</li>
<li>
<p>Create snapshots on the PRIM node either through virt-manager or a command line:</p>
<pre><code>virsh snapshot-create-as vm1 snapshot-name
</code></pre>
</li>
</ul>
<p>Note: when creating a snapshot with a command line, you have to refresh the snapshot view into virt-manager.</p>
<p>Snapshots created on the PRIM node are operationnal on node 2 after failover, but not listed on node 2.</p>
<ul>
<li>
<p>For importing a snapshot on node 2, you have to run the command:</p>
<pre><code>virsh snapshot-create --redefine vm1 /var/lib/libvirt/qemu/snapshot/vm1/snapshot-name
</code></pre>
</li>
<li>
<p>The command line for listing all snapshots of vm1 is:</p>
<pre><code>virsh snapshot-list vm1
</code></pre>
</li>
</ul>
<img src="/wp-content/uploads/2024/03/21-module-kvm-edit-config-1.png" alt="Enter the KVM parameters">
<h3 id="18-support">18. Support</h3>
<ul>
<li>For getting support, take 2 SafeKit <code>Snapshots</code> (2 .zip files), one for each node.</li>
</ul>
<div class="callout"><img src="/wp-content/uploads/2022/07/note.png" alt="Note"><span><a href="/resources/safekit-support/">More information on the support here</a>.</span></div>
<img src="/wp-content/uploads/2024/03/30-snapshots-mirror.png" alt="Take the KVM snaphots for support">
<h2 id="demonstration-of-a-vm-level-high-availability-solution">Demonstration of a VM-level high availability solution</h2>
<h3 id="demo-hyperv">SafeKit Video: Virtual Machine-Level Clustering with Hyper-V (5:15)</h3>
<p>In this video, discover how SafeKit implements <strong>high availability for Hyper-V</strong> without the complexity of a SAN. Learn to configure <strong>virtual machine replication</strong> across two nodes to ensure seamless failover for your critical virtualized workloads. Although this demonstration uses Hyper-V on Windows, the solution works identically with KVM on Linux.</p>
<h3 id="chapters">Chapters</h3>
<ol>
<li><a href="https://www.youtube.com/watch?v=H18s_-_CpmU&amp;amp;t=0s" target="_blank" rel="noopener">Architecture overview: 2 Hyper-V nodes and 2 virtual machines</a> (0:49)</li>
<li><a href="https://www.youtube.com/watch?v=H18s_-_CpmU&amp;amp;t=49s" target="_blank" rel="noopener">Configuring the cluster and the hyperv.safe modules</a> (1:59)</li>
<li><a href="https://www.youtube.com/watch?v=H18s_-_CpmU&amp;amp;t=168s" target="_blank" rel="noopener">Live testing: VM replication, migration, and automatic failover on crash</a> (2:26)</li>
</ol>
<h3 id="step-by-step-implementation">Step-by-Step Implementation</h3>
<ul>
<li><a href="/quick-install/safekit-quick-installation-guide-with-hyper-v/">Read the guide to set up a mirrored Hyper-V cluster on Windows.</a></li>
<li><a href="/quick-install/safekit-quick-installation-guide-with-kvm/">Read the guide to set up a mirrored KVM cluster on Linux.</a></li>
</ul>
<p>&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;</p>
<h2 id="hub">🔍 SafeKit High Availability Navigation Hub</h2>
<p><strong>Explore SafeKit: Features, technical videos, documentation, and free trial</strong></p>
<table>
<thead>
<tr>
<th>Resource Type</th>
<th>Description</th>
<th>Direct Link</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Key Features</strong></td>
<td>Why Choose SafeKit for Simple and Cost-Effective High Availability?</td>
<td><a href="/#why-choose-safekit-for-ha" title="Discover SafeKit features for simple and cost-effective high availability">See Why Choose SafeKit for High Availability</a></td>
</tr>
<tr>
<td><strong>Use Cases</strong></td>
<td>Explore How SafeKit Ensures the High Availability of Critical Infrastructure</td>
<td><a href="/#safekit-use-cases" title="Explore SafeKit high availability use cases">See All Use Cases (OEM Software, Edge Servers, SCADA, and more)</a></td>
</tr>
<tr>
<td><strong>Deployment Model</strong></td>
<td>All-in-One SANless HA: Shared-Nothing Software Clustering</td>
<td><a href="/#all-in-one-sanless-ha" title="Learn about all-in-one SANless high availability with shared-nothing software clustering">See SafeKit All-in-One SANless HA</a></td>
</tr>
<tr>
<td><strong>HA Strategies</strong></td>
<td>SafeKit: Infrastructure (VM) vs. Application-Level High Availability</td>
<td><a href="/#safekit-ha-redundancy-choices" title="Compare VM-level redundancy with SafeKit application-level high availability strategies">See SafeKit HA &amp; Redundancy: VM vs. Application Level</a></td>
</tr>
<tr>
<td><strong>Technical Specifications</strong></td>
<td>Technical Limitations for SafeKit Clustering</td>
<td><a href="/#safekit-ha-limitations" title="Technical requirements and limitations for SafeKit application clustering">See SafeKit High Availability Limitations</a></td>
</tr>
<tr>
<td><strong>Proof of Concept</strong></td>
<td>SafeKit: High Availability Configuration &amp; Failover Demos</td>
<td><a href="/#safekit-failover-tutorials" title="Step-by-step videos on SafeKit high availability, from installation to automated failover">See SafeKit Failover Tutorials</a></td>
</tr>
<tr>
<td><strong>Architecture</strong></td>
<td>How the SafeKit Mirror Cluster works (Real-Time Replication &amp; Failover)</td>
<td><a href="/#safekit-mirror-cluster" title="See technical architecture and failover mechanism of SafeKit Mirror Cluster">See SafeKit Mirror Cluster: Real-Time Replication &amp; Failover</a></td>
</tr>
<tr>
<td><strong>Architecture</strong></td>
<td>How the SafeKit Farm Cluster works (Network Load Balancing &amp; Failover)</td>
<td><a href="/#safekit-farm-cluster" title="Technical overview of SafeKit Farm Cluster architecture with network load balancing">See SafeKit Farm Cluster: Network Load Balancing &amp; Failover</a></td>
</tr>
<tr>
<td><strong>Competitive Advantages</strong></td>
<td>Comparison: SafeKit vs. Traditional High Availability (HA) Clusters</td>
<td><a href="/#safekit-ha-comparison" title="Detailed comparison of SafeKit software vs traditional hardware-based HA clusters">See SafeKit vs. Traditional HA Cluster Comparison</a></td>
</tr>
<tr>
<td><strong>Technical Resources</strong></td>
<td>SafeKit High Availability: Documentation, Downloads &amp; Trial</td>
<td><a href="/#safekit-ha-technical-resources" title="Access SafeKit free trial, technical documentation, and high availability white papers">See SafeKit HA Free Trial &amp; Technical Documentation</a></td>
</tr>
<tr>
<td><strong>Pre-configured Solutions</strong></td>
<td>SafeKit Application Module Library: Ready-to-Use HA Solutions</td>
<td><a href="/#safekit-ha-application-modules" title="Browse the library of pre-configured SafeKit modules for automated application failover">See SafeKit High Availability Application Modules</a></td>
</tr>
</tbody>
</table>
<div class="button-row">
  <a class="btn-action" href="https://safekit.eviden.com/contact-us-for-safekit/">🧑 Contact us</a>
  <a class="btn-action" href="/resources/safekit-free-trial/">🎁 SafeKit free trial</a>
  <a class="btn-action" href="https://training.my.evidian.com/mod/page/view.php?id=712">🏅 Free certification</a>
  <a class="btn-action" href="https://safekit.eviden.com/get-a-quote-safekit/">💰 Perpetual license cost</a>
</div>

