<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>The open-source hyperconverged infrastructure solution for a cloud-native world Blog</title>
        <link>https://harvesterhci.io/kb</link>
        <description>The open-source hyperconverged infrastructure solution for a cloud-native world Blog</description>
        <lastBuildDate>Wed, 05 Aug 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <item>
            <title><![CDATA[How To Delete One Harvester Node]]></title>
            <link>https://harvesterhci.io/kb/how_to_delete_one_harvester_node</link>
            <guid>how_to_delete_one_harvester_node</guid>
            <pubDate>Wed, 05 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How to delete one node from the Harvester cluster effectively.]]></description>
            <content:encoded><![CDATA[<div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><ol><li><p><strong>Documentation Reference:</strong> Review the official <a href="https://docs.harvesterhci.io/v1.8/host/#deleting-a-node" target="_blank" rel="noopener noreferrer">Harvester Deleting a Node Documentation</a> for critical prerequisites and safety considerations.</p></li><li><p><strong>Strict Execution Sequence:</strong> All steps in this document must be executed in strict numerical sequence. If any step encounters an error or produces unexpected output, stop immediately and consult Harvester support or your cluster administration team before proceeding.</p></li></ol></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="cluster-baseline">Cluster Baseline<a class="hash-link" href="#cluster-baseline" title="Direct link to heading">​</a></h2><p>Before initiating any node removal, verify that the cluster state is healthy and that all active Kubernetes <code>node</code> objects align 1:1 with their corresponding Cluster API <code>machine</code> objects. If any stale or redundant <code>machine</code> objects exist from previous failed deployments, delete them before proceeding.</p><p>The sample cluster has two nodes, and worker node <code>harv21</code> will be removed.</p><p><img loading="lazy" alt="node-warning" src="/assets/images/node-removal-ready-cluster-b450eb124ea6c8663f229f6ea3ba60d3.png" width="2178" height="586"></p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl get nodes -A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME     STATUS   ROLES                AGE   VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv21   Ready    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">none</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain">               15m   v1.36.3+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv31   Ready    control-plane,etcd   56m   v1.36.3+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl get machines -A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE     NAME                  CLUSTER   NODE NAME   FAILURE DOMAIN   READY   AVAILABLE   UP-TO-DATE   PHASE     AGE   VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">fleet-local   custom-2b108e6cb5d9   </span><span class="token builtin class-name">local</span><span class="token plain">     harv21                       True    True                     Running   15m   </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">fleet-local   custom-d9d1ba8f7563   </span><span class="token builtin class-name">local</span><span class="token plain">     harv31                       True    True                     Running   51m</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-important alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p><strong>2-Node Cluster</strong>: In this 2-node sample environment (<code>harv21</code> + <code>harv31</code>), <code>harv31</code> is the sole control-plane and etcd node. You <strong>CANNOT</strong> delete harv31. Removing the only control-plane node will instantly collapse the Kubernetes API server and permanently break cluster quorum. In a 2-node setup, only worker nodes (like harv21) can be safely decommissioned.</p><p><strong>Single-Node Cluster</strong>: Needless to say, you cannot delete the only node from a single-node cluster. Removing the node destroys the entire cluster control plane and storage layer simultaneously.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="removing-a-control-plane-node-in-3-node-clusters">Removing a Control-Plane Node in 3+ Node Clusters<a class="hash-link" href="#removing-a-control-plane-node-in-3-node-clusters" title="Direct link to heading">​</a></h3><p>If your cluster has 3 or more control-plane nodes (e.g., a High-Availability setup with harv11, harv21, harv31), deleting a control-plane node is supported, but extra precautions apply:</p><ul><li><p><strong>Quorum Health</strong>: etcd requires a strict majority to maintain quorum ($N/2 + 1$). Ensure the remaining control-plane count after removal will form an odd number (or maintain quorum requirements) before taking a node down.</p></li><li><p><strong>Proactive etcd Leadership Transfer</strong>: If the control-plane node scheduled for removal currently holds the active etcd leader role, you MUST explicitly transfer leadership to a surviving control node before executing uninstallation scripts.</p></li></ul><h4 class="anchor anchorWithStickyNavbar_mojV" id="control-plane--etcd-leadership-transfer-control-plane-nodes-only">Control Plane &amp; ETCD Leadership Transfer (Control-Plane Nodes Only)<a class="hash-link" href="#control-plane--etcd-leadership-transfer-control-plane-nodes-only" title="Direct link to heading">​</a></h4><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><p>Do not rely on automatic <code>etcd</code> election timeouts when taking down a control-plane node. Terminating the active <code>etcd</code> leader without prior transfer causes a temporary control-plane freeze while remaining nodes wait for election timeouts. Proactively transferring leadership guarantees zero API server disruption.</p></div></div><p>If the target node to be removed holds the <code>control-plane</code> / <code>etcd</code> role, perform leadership verification and manual handover <strong>before</strong> draining or uninstalling software.</p><ol><li><p><strong>Check Current ETCD Leadership</strong></p><p>Log in to any active control-plane node and query the member list inside the static etcd pod:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># ETCDCTL_API=3 kubectl exec -n kube-system etcd-harv31 -- etcdctl \</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --cacert</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --cert</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-client.crt </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --key</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-client.key </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    endpoint status --cluster -w table</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The following example output displays the endpoint status for a three-node control plane cluster:</p><p><img loading="lazy" alt="etcd-endpoint-status" src="/assets/images/node-removal-etcd-endpoint-status-1-48b13862b1f512fb4375df1b817646a3.png" width="2822" height="608"></p><p>Locate the target node by its IP address in the ENDPOINT column and evaluate the following:</p><ul><li><p>If the target control-plane node has <strong>IS LEADER</strong> set to false, proceed directly to <a href="#prepare-the-target-node">Prepare the Target Node</a>.</p></li><li><p>If the target control-plane node has <strong>IS LEADER</strong> set to true, proceed next step to transfer leadership.</p></li></ul></li><li><p><strong>Proactively Move ETCD Leadership</strong></p><ol><li><p>Select a surviving member node from the endpoint status --cluster table that has <strong>IS LEADER</strong> set to <code>false</code> and <strong>IS LEARNER</strong> set to <code>false</code>. Record its hexadecimal ID.</p></li><li><p>Transfer leadership away from the target host to the surviving member ID:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># ETCDCTL_API=3 kubectl exec -n kube-system etcd-harv31 -- etcdctl \</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --cacert</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --cert</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-client.crt </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    --key</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">/var/lib/rancher/rke2/server/tls/etcd/server-client.key </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    move-leader </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">TARGET_SURVIVING_MEMBER_ID</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Re-run <code>endpoint status --cluster -w table</code> to confirm that <strong>IS LEADER</strong> has successfully shifted to the surviving node before proceeding.</p></li></ol></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="prepare-the-target-node">Prepare the Target Node<a class="hash-link" href="#prepare-the-target-node" title="Direct link to heading">​</a></h2><p>Check the official <a href="https://docs.harvesterhci.io/v1.8/host/#deleting-a-node" target="_blank" rel="noopener noreferrer">Harvester Deleting a Node Documentation</a> steps before <a href="https://docs.harvesterhci.io/v1.8/host/#5-evict-workloads-from-the-node-to-be-removed" target="_blank" rel="noopener noreferrer">5. Evict workloads from the node to be removed</a>.</p><div class="admonition admonition-important alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Before cordoning or draining the node, backup/export any critical diagnostic data, custom host configs or persistent host path data to a secure remote host. Once workloads are evicted or the node is uninstalled, local ephemeral data and pod logs might no longer be accessible.</p></div></div><p>Whenever possible, enable <a href="https://docs.harvesterhci.io/v1.8/host/#node-maintenance" target="_blank" rel="noopener noreferrer">Maintenance mode</a> on the target node directly from the Harvester UI via <strong>Hosts</strong> &gt; <strong>Action</strong> &gt; <strong>Enable Maintenance Mode</strong>.</p><p>If UI maintenance mode is not accessible/not allowed, prepare the node manually using kubectl</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Cordon the target node to prevent new pod scheduling</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl cordon harv21</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Verify that the node status reflects 'SchedulingDisabled'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get </span><span class="token function" style="color:#d73a49">node</span><span class="token plain"> harv21</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Drain active workloads and local data storage from the node</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl drain harv21 --ignore-daemonsets --delete-emptydir-data</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="verify-post-maintenance-cluster-health">Verify Post-Maintenance Cluster Health<a class="hash-link" href="#verify-post-maintenance-cluster-health" title="Direct link to heading">​</a></h2><p>Once the target node successfully enters <code>Maintenance Mode</code> (or completes its <code>kubectl drain</code> cycle), <strong>do not proceed directly to node uninstallation</strong>. Workload migration places extra CPU, memory, network, and disk I/O pressure on surviving nodes. You must verify that the cluster has stabilized before taking irreversible deletion steps.</p><p>Perform the following system-level checks on an active control-plane node:</p><ol><li><p><strong>Node Readiness &amp; Resource Overhead:</strong>
Verify that all remaining nodes report <code>Ready</code> and have sufficient CPU and memory headroom to handle the re-located workloads:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl get nodes</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl top nodes</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p><strong>Pod &amp; Workload Status:</strong>
Ensure no evicted pods or virtual machine instances are stuck in <code>Pending</code>, <code>CrashLoopBackOff</code>, or unschedulable states:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl get pods -A | grep -v -E 'Running|Completed'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p><strong>Abnormal Cluster Events:</strong>
Check for recent scheduling warnings, resource exhaustion alerts, or failed volume mounts triggered by the eviction:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv31:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># kubectl get events -A --field-selector type=Warning --sort-by='.metadata.creationTimestamp'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p><strong>Longhorn Storage Health or Third-Party Storage:</strong>
In the Harvester UI (or Longhorn dashboard / third-party storage management console), verify that all storage volume replicas have finished rebuilding across the remaining hosts and that no volumes remain degraded, degraded-syncing, or in a <code>Faulted</code> state.</p></li><li><p><strong>Critical System Services &amp; Business Workloads:</strong>
Confirm that core cluster add-ons and critical business applications have successfully re-established quorum and connectivity:</p><ul><li><strong>Core Infrastructure:</strong> Verify that ingress controllers, CNI networking components (e.g., Canal/Flannel/Cilium), and monitoring stacks are fully functional across surviving nodes.</li><li><strong>VIP / Ingress Traffic:</strong> Ensure VIP services or external load balancer targets have updated and are actively serving production traffic without packet drop or high latency.</li><li><strong>Stateful Workloads:</strong> Validate that stateful applications (e.g., databases, message queues, key-value stores) have re-attached their persistent volumes and recovered cluster synchronization.</li></ul></li><li><p><strong>VM Auto-Balance &amp; Migration Thrashing Check:</strong>
If the <a href="https://docs.harvesterhci.io/v1.8/advanced/addons/virtual-machine-auto-balance" target="_blank" rel="noopener noreferrer">Virtual Machine Auto-Balance addon</a> is enabled, monitor active migrations in the Harvester UI. Pay close attention to ensure that workload shifts do not trigger cascading, hyper-frequent VM re-balancing migrations across the remaining hosts due to tight CPU/memory thresholds.</p></li><li><p><strong>Observation &amp; Stability Window:</strong>
Allow an observation window (e.g., 30 minutes) before initiating permanent node uninstallation or deletion. Monitor real-time metrics, node load averages, and VM responsiveness to guarantee cluster stability under sustained operational load.</p></li></ol><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><p><strong>STOP / GO GATE:</strong></p><p>If the cluster exhibits degraded storage, abnormal pods, or resource saturation following workload eviction, <strong>stop immediately</strong>. Fix and recover cluster health before deleting machine or node objects.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="execute-node-uninstallation-script">Execute Node Uninstallation Script<a class="hash-link" href="#execute-node-uninstallation-script" title="Direct link to heading">​</a></h2><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><ol><li><p><strong>Target Node Only (<code>harv21</code>):</strong>
The uninstall script <code>/opt/rke2/bin/rke2-uninstall.sh</code> <strong>MUST ONLY BE RUN DIRECTLY ON THE TARGET NODE BEING REMOVED (<code>harv21</code>)</strong>. Running this on <code>harv31</code> or another active control node will destroy that node's local cluster services.</p></li><li><p><strong>Immediate Destruction (No Confirmation Prompt):</strong>
The uninstall script <code>/opt/rke2/bin/rke2-uninstall.sh</code> <strong>does NOT ask for double confirmation or prompt <code>y/n</code></strong> before execution. Once invoked, it immediately stops services and tears down the node environment. Double-check your active hostname (<code>hostname</code>) before pressing Enter.</p></li></ol></div></div><p>Log in to <code>harv21</code> via SSH/console as the <code>root</code> user and execute the pre-installed script:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv21:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># hostname</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv21</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv21:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># /opt/rke2/bin/rke2-uninstall.sh</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">++ </span><span class="token function" style="color:#d73a49">id</span><span class="token plain"> -u</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+ </span><span class="token builtin class-name">echo</span><span class="token plain"> -e </span><span class="token string" style="color:#e3116c">'\e[31mCleanup didn'</span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain">'</span><span class="token string" style="color:#e3116c">'t complete successfully\e[0m'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Cleanup didn</span><span class="token string" style="color:#e3116c">'t complete successfully</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">+ log '</span><span class="token plain">Removing uninstall script</span><span class="token string" style="color:#e3116c">'</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">++ date '</span><span class="token plain">+%Y-%m-%d %H:%M:%S</span><span class="token string" style="color:#e3116c">'</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">+ echo '</span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">2026</span><span class="token plain">-08-05 </span><span class="token number" style="color:#36acaa">13</span><span class="token plain">:25:09</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Removing uninstall script'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">2026</span><span class="token plain">-08-05 </span><span class="token number" style="color:#36acaa">13</span><span class="token plain">:25:09</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Removing uninstall script</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+ </span><span class="token function" style="color:#d73a49">rm</span><span class="token plain"> -f -- /opt/rke2/bin/rke2-uninstall.sh</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If the script outputs errors (e.g., Cleanup didn't complete successfully), re-run the script or contact Harvester Support.</p></div></div><p><strong>Verification</strong>:</p><p>Once the script finishes, verify that RKE2 services and virtual interfaces have been stopped.</p><ol><li><p>Check process termination:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv21:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># ps aux | grep kubelet</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Expected output: Only the grep process itself should return</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Check network interfaces:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harv21:/home/rancher </span><span class="token comment" style="color:#999988;font-style:italic"># ip link</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Expected output: Only physical interfaces and management bridges remain active</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># no output like `56: cali05b22ce82b3@if2:`</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Check Harvester UI.</p><p>The host <code>harv21</code> displays a red <strong>Maintenance</strong> status with the warning message <code>Kubelet stopped posting node status</code>.</p></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="remove-the-node-object">Remove the Node Object<a class="hash-link" href="#remove-the-node-object" title="Direct link to heading">​</a></h2><p>To complete the <code>node</code> removal from the cluster, you must explicitly delete the Kubernetes <code>node</code> object using one of the following methods:</p><p><strong>Option A: Via Harvester UI (Recommended)</strong></p><ol><li><p>Navigate to the <strong>Hosts</strong> page in the Harvester UI.</p></li><li><p>Locate the target node (<code>harv21</code>).</p></li><li><p>Select <strong>⋮ &gt; Delete</strong>.</p></li></ol><p><strong>Option B: Via <code>kubectl</code> CLI</strong></p><ol><li><p>Verify the current node list:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get nodes</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Delete the <code>node</code> object:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete </span><span class="token function" style="color:#d73a49">node</span><span class="token plain"> harv21</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Confirm that <code>harv21</code> is no longer listed in the cluster.</p></li></ol><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If the deleted node still appears as a stale entry record in the Harvester UI, force refresh your browser page (<code>Ctrl+F5</code> or <code>Cmd+Shift+R</code>) to reload the <strong>Hosts</strong> list.</p></div></div><p><img loading="lazy" alt="new-cluster-ready" src="/assets/images/node-removal-after-ready-again-0b4f86e97ad1e1d20663b9f777d0f937.png" width="3156" height="616"></p><h3 class="anchor anchorWithStickyNavbar_mojV" id="known-issue-1-node-stuck-in-draining-state-during-removal">Known Issue 1: Node stuck in "Draining" state during removal<a class="hash-link" href="#known-issue-1-node-stuck-in-draining-state-during-removal" title="Direct link to heading">​</a></h3><p><strong>Symptom</strong></p><p>During node deletion, the host status on the UI normally shows <code>Kubelet stopped posting node status</code>.</p><p><img loading="lazy" alt="node-removal-normally-uninstalled" src="/assets/images/node-removal-normally-uninstalled-fbf1dad4f8fca51248e935ed88fb569d.png" width="1994" height="264"></p><p>If the UI displays <code>Node is draining due to kubelet/node not ready</code>, or toggles between <code>Kubelet stopped posting node status</code> and <code>Node is draining due to kubelet/node not ready</code> for more than 5 minutes without removing the host, you have encountered a known issue. Refer to the <a href="https://docs.harvesterhci.io/v1.8/host/#8-known-issue-node-stuck-in-draining-state-during-removal" target="_blank" rel="noopener noreferrer">Node Draining Workaround Guide</a> for resolution steps.</p><p><img loading="lazy" alt="node-removal-node-draining" src="/assets/images/node-removal-node-draining-1132021b1ccefef9bfebf6f67c875083.png" width="2020" height="232"></p><h3 class="anchor anchorWithStickyNavbar_mojV" id="known-issue-2-longhorn-node-resource-persists-after-host-removal">Known Issue 2: Longhorn node resource persists after host removal<a class="hash-link" href="#known-issue-2-longhorn-node-resource-persists-after-host-removal" title="Direct link to heading">​</a></h3><p><strong>Symptom</strong></p><p>After a node is removed from the Harvester cluster, its corresponding Longhorn node resource (<code>nodes.longhorn.io</code>) may persist in the <code>longhorn-system</code> namespace.</p><p>When you attempt to manually delete the resource, the Longhorn admission webhook blocks the deletion with an error:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl get nodes.longhorn -n longhorn-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE         NAME     READY   ALLOWSCHEDULING   SCHEDULABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   harv21   False   true              False         13d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   harv31   True    true              True          13d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl delete nodes.longhorn -n longhorn-system harv21</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">The request is invalid: : could not delete node harv21 with node ready condition is False, reason is KubernetesNodeGone, node schedulable true, and 0 replica, 0 engine running on it</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Attempts to force-delete the object by manually removing its finalizers (<code>metadata.finalizers</code>)` will also fail, as the admission webhook continues to intercept and reject the update request.</p><p>Furthermore, if you re-add the host to the cluster using the same node name while this stale object remains, Longhorn may report that the node's disks are not ready or fail to provision storage pools for the newly added node.</p><p><strong>Cause</strong></p><p>Longhorn's validation webhook prevents node resource deletion while allowScheduling is set to true (even if the underlying Kubernetes node is gone and no replicas or engines are running on it).</p><p><strong>Workaround</strong></p><ol><li><p>Disable scheduling on the stale Longhorn node by setting allowScheduling to false:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl patch nodes.longhorn.io harv21 -n longhorn-system --type=merge -p '{"spec":{"allowScheduling":false}}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Delete the Longhorn node resource:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl delete nodes.longhorn.io harv21 -n longhorn-system</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="post-removal-disk-cleanup">Post-Removal Disk Cleanup<a class="hash-link" href="#post-removal-disk-cleanup" title="Direct link to heading">​</a></h2><p>The uninstallation script tears down container runtimes and Kubernetes configurations, but it <strong>does not</strong> wipe local storage drives or bootloader partitions.</p><p>If <code>harv21</code> is rebooted without disk formatting, it will load leftover installation data locally (as shown on its physical or virtual console below). However, this is strictly a local artifact—the Harvester cluster is not affected by it.</p><p><img loading="lazy" alt="standalone-leftover" src="/assets/images/node-removal-leftover-f1c7106f360f955b2312ae4ff0c579e0.png" width="1446" height="704"></p><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><p>To prevent residual storage conflicts (such as stale Longhorn volume metadata) or unexpected data leakage when hardware is repurposed:</p><ol><li><p><strong>Hand Off to Infrastructure / Storage Admins:</strong>
Forward the decommissioned host to your IT infrastructure or system administration team to perform drive sanitization according to your organization's data retention and hardware lifecycle policies.</p></li><li><p><strong>OS Drive Safety:</strong>
Avoid attempting to run raw disk-wiping utilities (such as <code>wipefs</code> or <code>dd</code>) on the active OS root disk while booted into the system, as destroying mounted filesystems will cause immediate kernel panics and data corruption.</p></li><li><p><strong>Re-imaging:</strong></p><p>If the node is being re-added to a Harvester cluster, the target OS drive can be safely wiped and reformatted directly via the Harvester installer ISO during the standard boot setup.</p></li></ol></div></div>]]></content:encoded>
            <category>harvester</category>
            <category>cluster</category>
            <category>node removal</category>
            <category>node delete</category>
            <category>delete a node</category>
            <category>host management</category>
            <category>maintenance</category>
        </item>
        <item>
            <title><![CDATA[Januscape: Guest-to-Host Escape in KVM/x86 - CVE-2026-53359]]></title>
            <link>https://harvesterhci.io/kb/2026/07/13/januscape-cve</link>
            <guid>/2026/07/13/januscape-cve</guid>
            <pubDate>Mon, 13 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[This article provides information on the CVE-2026-53359 vulnerability in Harvester.]]></description>
            <content:encoded><![CDATA[<p>This article provides information and mitigation steps for the following vulnerabilities in Harvester:</p><ul><li>CVE-2026-53359</li></ul><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>On July 6, 2026, researcher Hyunwoo Kim (@v4bel) publicly disclosed Januscape, a vulnerability in the Linux kernel’s KVM/x86 memory-management code, which allows a malicious virtual machine to break out of the guest and run code as root on the host it runs on. On hosts where the KVM device node <code>/dev/kvm</code> is world-accessible, an unprivileged local user can exploit the vulnerability to crash the host.</p><p>All supported versions of Harvester are affected, including 1.6.1 and earlier, 1.7.2 and earlier, and 1.8.1 and earlier.</p><p>Januscape is the latest in a series of Linux kernel privilege-escalation vulnerabilities that required a patch and a reboot of the affected hosts.</p><p>SUSE is working on fixing this issue. Meanwhile, apply the mitigation steps described in this article to protect your clusters.</p></div></div><p>The mitigation steps involves disabling the nested virtualization feature of the KVM kernel module on your Harvester hosts.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Nested virtualization is not supported on virtual machines running on Harvester. Disabling this feature will not affect the functionality of your Harvester cluster.</p></div></div><p>On your Harvester hosts, use the following commands to confirm that the KVM kernel module is loaded with nested virtualization enabled:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">lsmod | grep -iE "kvm_amd|kvm_intel"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">sudo grep -H '' /sys/module/{kvm_amd|kvm_intel}/parameters/* 2&gt;&amp;1 |grep nested</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If the above commands return module and parameter information about the KVM kernel module, then your host is affected by this vulnerability.</p><p>Deploy the following <code>CloudInit</code> configuration to disable the nested virtualization feature of the KVM kernel module on all your Harvester hosts:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> disabled</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">nested</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">virtualization</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">matchSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">harvesterhci.io/managed</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">filename</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 99</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">disabled</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">nested</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">virtualization</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    stages:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      initramfs:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      - name: "disable nested virtualization in kvm modules"</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        files:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        - path: "/etc/modprobe.d/99-disabled-nested-virtualization.conf"</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          content: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            options kvm_amd nested=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            options kvm_intel nested=0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Once the configuration is applied, reboot your Harvester hosts for the changes to take effect.</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>warning</h5></div><div class="admonition-content"><p>Do not disable the KVM kernel module on your Harvester hosts, as it is required for running virtual machines. Only disable the nested virtualization feature using the configuration provided above.</p></div></div><p>Once you have upgraded to a fixed version of Harvester, you can re-enable the nested virtualization feature by deleting the <code>CloudInit</code> configuration and rebooting your Harvester hosts:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete cloudinit disabled-nested-virtualization</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://support.scc.suse.com/s/kb/Security-Vulnerability-x86-64-kvm-Guest-to-Host-escape-aka-Januscape-CVE-2026-53359" target="_blank" rel="noopener noreferrer">https://support.scc.suse.com/s/kb/Security-Vulnerability-x86-64-kvm-Guest-to-Host-escape-aka-Januscape-CVE-2026-53359</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-53359.html" target="_blank" rel="noopener noreferrer">https://www.suse.com/security/cve/CVE-2026-53359.html</a></li></ul>]]></content:encoded>
            <category>security</category>
            <category>cve</category>
        </item>
        <item>
            <title><![CDATA[How Harvester Eliminates Virtual Machine OOM Killers]]></title>
            <link>https://harvesterhci.io/kb/how_harvester_eliminates_vm_oom_killers</link>
            <guid>how_harvester_eliminates_vm_oom_killers</guid>
            <pubDate>Wed, 24 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How VM OOM happens and how Harvester eliminates it effectively.]]></description>
            <content:encoded><![CDATA[<p>When running production workloads on virtualized infrastructure like <strong>Harvester</strong>, memory management is critical. In Harvester versions prior to v1.4.0, certain workloads experienced sudden Virtual Machine (VM) terminations due to the host Linux operating system triggering <strong>Out-Of-Memory (OOM)</strong> kills.</p><p>What is <strong>KubeVirt</strong>? Harvester uses KubeVirt as its core virtualization engine. KubeVirt is an open-source technology that allows Kubernetes to run and manage traditional Virtual Machines inside standard containers, translating VM specifications directly into Pod configurations.</p><p>This article explores why these OOM events occur in a Kubernetes-native virtualization environment and how Harvester provides granular tools to eliminate them.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="anatomy-of-a-vm-oom-event">Anatomy of a VM OOM Event<a class="hash-link" href="#anatomy-of-a-vm-oom-event" title="Direct link to heading">​</a></h2><p>When a VM is terminated due to insufficient memory at the host level, the Linux kernel logs specific keywords that help pinpoint the fault. In Harvester, these logs generally fall into two distinct categories depending on which process triggered the exhaustion.</p><p>Example 1: <code>virt-launcher invoked oom-killer</code></p><p>The <code>virt-launcher</code> process runs inside the dedicated Kubernetes Pod backing the VM. If this component or its direct sub-processes run out of the memory allocated to their cgroup, the kernel triggers a memory cgroup (memcg) OOM event.</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: virt-launcher invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=986</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: CPU: 40 PID: 40785 Comm: virt-launcher Tainted: G          I    X    5.14.21-150400.24.60-default #1 SLE15-SP4 9096397fa6646928cc6d185ba417f2af65b536f1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: memory: usage 17024340kB, limit 17024340kB, failcnt 1243</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: memory+swap: usage 17024340kB, limit 9007199254740988kB, failcnt 0                                                                 </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: kmem: usage 143556kB, limit 9007199254740988kB, failcnt 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: Memory cgroup stats for /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod968a06fb_9ab9_4819_8caf_0392ddff3d9b.slice:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: Tasks state (memory values in pages):</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  38886]     0 38886      243        1    28672        0          -998 pause</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  38917]     0 38917   310400     6921   192512        0           986 virt-launcher-m</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  38934]     0 38934  1200940    25126   954368        0           986 virt-launcher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  38951]     0 38951   386525     8247   466944        0           986 libvirtd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  38952]     0 38952    33619     3940   290816        0           986 virtlogd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: [  39079]   107 39079  4457263  4201766 34439168        0           986 qemu-system-x86</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Feb 03 19:57:08 ** kernel: oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=cri-containerd-0f32894de86edf3d3832702af794874ef8d400b4969acdea4976b12040756e0d.scope,mems_allowed=0-1,oom_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod968a06fb_9ab9_4819_8caf_0392ddff3d9b.slice,task_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod968a06fb_9ab9_4819_8caf_0392ddff3d9b.slice/cri-containerd-0f32894de86edf3d3832702af794874ef8d400b4969acdea4976b12040756e0d.scope,task=qemu-system-x86,pid=39079,uid=107</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Example 2: <code>CPU X/KVM invoked oom-killer</code></p><p>This occurs when a vCPU execution thread inside qemu-system-x86_64 attempts a memory operation that pushes the entire container beyond its Kubernetes memory limit.</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] CPU 11/KVM invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=830</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] CPU: 60 PID: 70888 Comm: CPU 11/KVM Not tainted 5.3.18-150300.59.101-default #1 SLE15-SP3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] memory: usage 67579904kB, limit 67579904kB, failcnt 67391</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] memory+swap: usage 0kB, limit 9007199254740988kB, failcnt 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] kmem: usage 633636kB, limit 9007199254740988kB, failcnt 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] Tasks state (memory values in pages):</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70675]     0 70675      243        1    28672        0          -998 pause</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70728]     0 70728   310400     5467   188416        0           830 virt-launcher-m</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70746]     0 70746  1242373    25104  1073152        0           830 virt-launcher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70762]     0 70762   455279    14110   770048        0           830 libvirtd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70763]     0 70763    37704     3916   339968        0           830 virtlogd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] [  70870]   107 70870 18302464 16718510 135278592        0           830 qemu-system-x86</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=cri-containerd-100093783c22a3ae1a42e21dd887b7c26eef52d56ba44c7273ef54507b6efe7c.scope,mems_allowed=0-3,oom_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podef91e487_dec5_4613_800b_eb23e1a1617d.slice,task_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podef91e487_dec5_4613_800b_eb23e1a1617d.slice/cri-containerd-100093783c22a3ae1a42e21dd887b7c26eef52d56ba44c7273ef54507b6efe7c.scope,task=qemu-system-x86,pid=70870,uid=107</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] Memory cgroup out of memory: Killed process 70870 (qemu-system-x86) total-vm:73209856kB, anon-rss:66852088kB, file-rss:21948kB, shmem-rss:4kB</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">[Thu May  9 14:52:38 2024] oom_reaper: reaped process 70870 (qemu-system-x86), now anon-rss:0kB, file-rss:132kB, shmem-rss:4kB</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="root-cause-native-hypervisors-vs-harvester-architecture">Root Cause: Native Hypervisors vs. Harvester Architecture<a class="hash-link" href="#root-cause-native-hypervisors-vs-harvester-architecture" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="traditional-linux-host-eg-virtual-machine-manager">Traditional Linux Host (e.g., Virtual Machine Manager)<a class="hash-link" href="#traditional-linux-host-eg-virtual-machine-manager" title="Direct link to heading">​</a></h3><p>On a standard Linux host, a VM managed via QEMU/KVM runs inside a systemd machine.slice. The hypervisor process (qemu-system-x86_64) has access to the host's wider pool of resources, managed loosely unless strict cgroup limits are manually added.</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ systemd-cgls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Control group /:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">├─1173 bpfilter_umh</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">├─system.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─machine.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  └─machine-qemu\x2d1\x2dharv41.scope </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    └─8632 /usr/bin/qemu-system-x86_64 -name guest=harv41,debug-threads=on -S -…</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="harvester-kuberneteskubevirt-engine">Harvester (Kubernetes/KubeVirt Engine)<a class="hash-link" href="#harvester-kuberneteskubevirt-engine" title="Direct link to heading">​</a></h3><p>In Harvester, every VM is encapsulated inside a Kubernetes Pod. This introduces a strict cgroup boundary (kubepods.slice).</p><p>As shown below, multiple helper processes must live alongside the primary qemu-system-x86_64 process within the same tightly limited container memory budget:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">-.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─kubepods.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ ├─kubepods-burstable-pod99ee3a64_645b_4699_9384_5a3875d78b41.slice</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │ ├─cri-containerd-0c316eb8a4711bff1ce968b46ddb658e49378897454b4caf2a20704c808f33f1.scope …</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │ │ └─ 8505 /pause</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │ ├─cri-containerd-eb5deef29f064adfd2456d9f9c535674ac4d0c95c81b13afbdab5a89dc6a774b.scope …</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │ │ └─ 8590 /usr/bin/virt-tail --logfile /var/run/kubevirt-private/2ce151aa…</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │ └─cri-containerd-fd57a5cfc2b9b1f53eaf7b575c3273e6784f4c56a04a17d502ecfbd19e55b066.scope …</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │   ├─ 8542 /usr/bin/virt-launcher-monitor --qemu-timeout 301s --name vm2 -…</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │   ├─ 8558 /usr/bin/virt-launcher --qemu-timeout 301s --name vm2 --uid 2ce…</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │   ├─ 8591 /usr/sbin/virtqemud -f /var/run/libvirt/virtqemud.conf</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │   ├─ 8592 /usr/sbin/virtlogd -f /etc/libvirt/virtlogd.conf</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  │ │   └─ 8823 /usr/bin/qemu-system-x86_64 -name guest=default_vm2,debug-threa…</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="the-hidden-memory-overhead">The "Hidden" Memory Overhead<a class="hash-link" href="#the-hidden-memory-overhead" title="Direct link to heading">​</a></h3><h4 class="anchor anchorWithStickyNavbar_mojV" id="breaking-down-the-memory-overhead-buffer">Breaking Down the Memory Overhead Buffer<a class="hash-link" href="#breaking-down-the-memory-overhead-buffer" title="Direct link to heading">​</a></h4><p>When you define a virtual machine, for example, a VM configured with <strong>4 vCPUs, 2 GiB of memory, and 1 Ethernet interface</strong>, KubeVirt does not just allocate exactly 2 GiB of memory to the container. </p><p>Instead, KubeVirt calculates an additional baseline memory overhead required to operate the virtualization stack. This overhead budget covers:</p><ul><li><strong>CPU Simulators:</strong> Thread pools tracking guest state and handling context switches.</li><li><strong>Memory Management:</strong> Tracking structures such as QEMU page tables mapping guest RAM.</li><li><strong>Auxiliary Devices:</strong> Buffers for virtual network interfaces (NICs), storage queues, and video devices.</li></ul><h4 class="anchor anchorWithStickyNavbar_mojV" id="the-high-stakes-of-vm-oom-kills">The High Stakes of VM OOM Kills<a class="hash-link" href="#the-high-stakes-of-vm-oom-kills" title="Direct link to heading">​</a></h4><p>Depending on the guest OS type, specific kernel workloads, and heavy storage/network I/O spikes, the memory consumed by these helper tasks can quickly exceed KubeVirt's default calculations. Because Kubernetes enforces a strict hard ceiling on the Pod container, the entire container triggers a <code>CONSTRAINT_MEMCG</code> OOM kill the moment this boundary is breached.</p><p>Unlike traditional, stateless Kubernetes workloads where a container crash is quickly mitigated by a rapid pod restart, an OOM kill on a VM pod carries severe operational consequences:</p><ul><li><p><strong>Prolonged Downtime:</strong> A virtual machine is a stateful workload. It does not instantaneously serve traffic upon a container restart; it must undergo a full operating system boot cycle, run init scripts, and re-initialize services, drastically extending your Recovery Time Objective (RTO).</p></li><li><p><strong>Risk of Data Corruption:</strong> Sudden terminations during flight can abruptly cut off active storage queues. If the guest OS or database engine is in the middle of a critical write operation when the host terminates the <code>qemu</code> process, it can result in uncommitted journals, filesystem degradation, or severe data corruption on your persistent volumes.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="the-solution-tunable-memory-architectures">The Solution: Tunable Memory Architectures<a class="hash-link" href="#the-solution-tunable-memory-architectures" title="Direct link to heading">​</a></h2><p>To address this, Harvester introduced dual-layer configurations that give administrators full flexibility over how overhead buffers are calculated.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="global-adjustment-additional-guest-memory-overhead-ratio">Global Adjustment: additional-guest-memory-overhead-ratio<a class="hash-link" href="#global-adjustment-additional-guest-memory-overhead-ratio" title="Direct link to heading">​</a></h3><p>This cluster-wide setting functions as a multiplier for KubeVirt's automatically calculated memory overhead. For deep structural details, refer to the <a href="https://docs.harvesterhci.io/v1.8/advanced/index#additional-guest-memory-overhead-ratio" target="_blank" rel="noopener noreferrer">Harvester Advanced Documentation</a>.</p><ul><li><strong>Definition:</strong> Scales the calculated overhead buffer to accommodate heavy I/O or virtualization tasks.</li><li><strong>Default Value:</strong> <code>1.5</code> (Provides a 50% safety cushion above baseline calculations).</li><li><strong>Valid Range:</strong> <code>0</code> or <code>1.0</code> to <code>10.0</code>.</li></ul><blockquote><p>💡 <strong>Important Operational Notes:</strong></p><ul><li><strong>Lifecycle Impact:</strong> Changes to this setting only apply to newly created virtual machines or existing VMs after they undergo a migration or a full power cycle.</li><li><strong>System Overhead:</strong> A higher ratio increases the host container's memory allocation, guaranteeing safety for heavy workloads but scaling up the overall system resource reservation footprint.</li><li><strong>Resource Allocation Trade-off:</strong> Setting this ratio excessively high can lock up unneeded host memory blocks, leading to predictable underutilization and significant memory waste across your compute nodes.</li></ul></blockquote><h3 class="anchor anchorWithStickyNavbar_mojV" id="per-vm-optimization-reserved-memory">Per-VM Optimization: Reserved Memory<a class="hash-link" href="#per-vm-optimization-reserved-memory" title="Direct link to heading">​</a></h3><p>For specific virtual machines running intensive or non-standard workloads, a global multiplier might not offer the precision required. Harvester allows administrators to define a dedicated <code>Reserved Memory</code> value directly on individual VMs. For complete configuration steps, see the <a href="https://docs.harvesterhci.io/v1.8/vm/index#reserved-memory" target="_blank" rel="noopener noreferrer">Harvester VM Management Documentation</a>.</p><blockquote><p>⚠️ <strong>Under the Hood Memory Carving:</strong>
When you configure this setting, Harvester explicitly scales down the available memory presented to the Guest OS inside the VM. For example, if a VM is configured with <strong>2 GiB</strong> of memory and you set a Reserved Memory value of <strong>256 MiB</strong>, the Guest OS will only see and utilize <strong>1.75 GiB</strong> (<code>2 GiB - 256 MiB</code>).</p></blockquote><h4 class="anchor anchorWithStickyNavbar_mojV" id="why-use-per-vm-reserved-memory">Why Use Per-VM Reserved Memory?<a class="hash-link" href="#why-use-per-vm-reserved-memory" title="Direct link to heading">​</a></h4><ul><li><p><strong>Guaranteed Overhead Headroom:</strong> By restricting the Guest OS from consuming the top slice of its configured allocation, you guarantee an isolated, un-evictable memory runway for host helper tasks.</p></li><li><p><strong>Targeted Safety for Heavy Workloads:</strong> This mechanism is highly practical for mission-critical, high-performance, or special-purpose workloads (such as nested virtualization layers or intensive database engines). It effectively prevents the VM from running into host-level cgroup OOM termination by proactively limiting its internal usage boundaries, removing the risk of unexpected node-level kills.</p></li><li><p><strong>Optimized Cluster Usability:</strong> Using per-VM reservations eliminates the major disadvantage of cranking up the global <code>additional-guest-memory-overhead-ratio</code> for the whole cluster. Instead of forcing a massive, wasteful memory overhead reservation across <em>every</em> idle or lightweight VM on your hosts, you can maintain a lean global default and surgically protect only the heavy workloads—striking an ideal balance between system density and ironclad stability.</p></li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="outcome-guaranteed-workload-stability">Outcome: Guaranteed Workload Stability<a class="hash-link" href="#outcome-guaranteed-workload-stability" title="Direct link to heading">​</a></h3><p>By leveraging this dual-layer tunable memory architecture, Harvester fundamentally alters how host-level overhead is calculated, moving from rigid, generalized defaults to a precise, tiered enforcement model:</p><p><strong>Total Memory Overhead</strong> = <strong>Auto-calculated Overhead</strong>  * <strong>Ratio</strong> + <strong>Reserved Memory</strong></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="best-practices--configuration-matrix">Best Practices &amp; Configuration Matrix<a class="hash-link" href="#best-practices--configuration-matrix" title="Direct link to heading">​</a></h2><p>The following matrix showcases how combinations of <strong>Reserved Memory</strong> and the <strong>Overhead Ratio</strong> change the actual layout of the Guest OS space versus what Kubernetes reserves as a hard boundary.</p><table><thead><tr><th>VM Configured Memory</th><th>Reserved Memory</th><th>additional-guest-memory-overhead-ratio</th><th>Guest OS Memory</th><th>POD Container Memory Limit</th><th>Total Memory Overhead</th></tr></thead><tbody><tr><td>2 Gi</td><td>not configured</td><td>"0.0"</td><td>2 Gi - 100 Mi</td><td>2 Gi + 240 Mi</td><td>~340 Mi</td></tr><tr><td>2 Gi</td><td>256 Mi</td><td>"0.0"</td><td>2 Gi - 256 Mi</td><td>2 Gi + 240 Mi</td><td>~500 Mi</td></tr><tr><td>2 Gi</td><td>not configured</td><td>"1.0"</td><td>2 Gi</td><td>2 Gi + 240*1.0 Mi</td><td>~240 Mi</td></tr><tr><td>2 Gi</td><td>not configured</td><td>"3.0"</td><td>2 Gi</td><td>2 Gi + 240*3.0 Mi</td><td>~720 Mi</td></tr><tr><td>2 Gi</td><td>not configured</td><td>"1.5"</td><td>2 Gi</td><td>2 Gi + 240*1.5 Mi</td><td>~360 Mi</td></tr><tr><td>2 Gi</td><td>256 Mi</td><td>"1.5"</td><td>2 Gi - 256 Mi</td><td>2 Gi + 240*1.5 Mi</td><td>~620 Mi</td></tr></tbody></table><p>When optimizing your Harvester cluster to eliminate host-level container OOM events, use the following operational checklist to tailor your memory strategies:</p><ul><li><p><strong>For General Workloads:</strong></p><ul><li>Stick to the default ratio of <code>1.5</code>, or configure a slightly higher value of <code>2.0</code>. This ensures that standard Guest operating systems receive exactly the memory requested while scaling out a stable, predictable background overhead buffer across the cluster.</li></ul></li><li><p><strong>For High I/O and Storage-Heavy VMs:</strong></p><ul><li>If you observe periodic KVM OOM events during massive backup windows, large-scale data syncs, or intensive disk read/write cycles, increase the individual VM's allocation or implement a targeted <code>Reserved Memory</code> configuration to safely expand the helper overhead pool.</li></ul></li><li><p><strong>For GPU Passthrough Workloads:</strong></p><ul><li>Virtual machines utilizing direct hardware acceleration or GPU passthrough are prime candidates for explicit <code>Reserved Memory</code> carving. The underlying host-side device drivers and memory-mapped I/O (MMIO) windows for high-performance graphics hardware require a significantly higher, specialized memory footprint outside the guest OS space. Allocating dedicated per-VM reserved memory prevents driver-instigated cgroup allocation breaches, keeping both the hardware pipeline and the hypervisor completely stable.</li></ul></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="quick-summary">Quick Summary<a class="hash-link" href="#quick-summary" title="Direct link to heading">​</a></h2><ul><li><p><strong>The Problem:</strong> In Harvester's Kubernetes-native architecture, every virtual machine is bound by a strict Pod container limit. While this rigid cgroup boundary is essential for security, ensuring a single rogue or leaking VM can never starve neighboring workloads or crash the bare-metal host, it means heavy storage/network I/O, device drivers, or GPU passthrough can cause internal helper processes to breach this hard ceiling, triggering a sudden host-level OOM kill.</p></li><li><p><strong>The Solution:</strong> Harvester eliminates these crashes without losing secure resource control using a dual-layer memory tuning strategy:</p><ul><li><strong>Globally:</strong> The <code>additional-guest-memory-overhead-ratio</code> scales out a safety cushion cluster-wide for newly created or migrated VMs.</li><li><strong>Per-VM:</strong> The <code>Reserved Memory</code> setting surgically carves out a chunk of the VM's configured RAM exclusively for background helper tasks—preventing wasteful memory reservations across the cluster while safely anchoring high-performance, mission-critical workloads.</li></ul></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="appendix-lab-simulation--manually-triggering-the-host-level-oom">Appendix: Lab Simulation — Manually Triggering the Host-Level OOM<a class="hash-link" href="#appendix-lab-simulation--manually-triggering-the-host-level-oom" title="Direct link to heading">​</a></h2><p>For engineers looking to validate this behavior safely in a staging environment, you can replicate this multi-process cgroup breach. A detailed script and case study can be found in the <a href="https://github.com/w13915984028/harvester-develop-summary/blob/main/oom-related-issue-investigation.md#hold-memory-on-vm-pod-and-exhaust-memory-on-guest-vm" target="_blank" rel="noopener noreferrer">Harvester Development Summary: OOM Investigation</a>.</p><p>The simulation process highlights a fundamental truth about modern virtualization boundaries:</p><ul><li><p><strong>The Guest OS is Trustworthy:</strong> Testing shows that modern guest operating systems handle internal resource limits reliably. If a runaway application inside the guest OS eats up all available RAM, the guest kernel safely steps in and kills that specific process internally. The VM itself survives, and from the host's perspective, the virtual machine continues running normally.</p></li><li><p><strong>The Host Cgroup Boundary is the Weak Link:</strong> The true host-level crash only happens if processes inside the host cgroup expand unexpectedly. If an infrastructure task or helper process inside the Pod container balloons, it consumes the memory buffer that KubeVirt set aside, causing the entire cgroup, the VM's carrier, to slam into the hard Kubernetes ceiling and trigger a host-level OOM kill.</p></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>virtual machine</category>
            <category>OOM</category>
            <category>OOM Killers</category>
            <category>memory overhead</category>
        </item>
        <item>
            <title><![CDATA[Upstream Ingress-Nginx CVEs - CVE-2026-42945, CVE-2026-42946, CVE-2026-40701, CVE-2026-42934]]></title>
            <link>https://harvesterhci.io/kb/2026/05/14/nginx-rift-cve</link>
            <guid>/2026/05/14/nginx-rift-cve</guid>
            <pubDate>Thu, 14 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[This article provides information on the  CVE-2026-42945, CVE-2026-42946, CVE-2026-40701 and CVE-2026-42934 vulnerabilities in Harvester.]]></description>
            <content:encoded><![CDATA[<p>This article provides information and mitigation steps for the following vulnerabilities in Harvester:</p><ul><li><a href="https://www.suse.com/security/cve/CVE-2026-42945.html" target="_blank" rel="noopener noreferrer">CVE-2026-42945</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-42946.html" target="_blank" rel="noopener noreferrer">CVE-2026-42946</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-40701.html" target="_blank" rel="noopener noreferrer">CVE-2026-40701</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-42934.html" target="_blank" rel="noopener noreferrer">CVE-2026-42934</a></li></ul><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>These vulnerabilities affect RKE2 ingress-nginx controller v1.14.5 and earlier. All Harvester versions that use this controller (including 1.5.2 and earlier, 1.6.1 and earlier, 1.7.1 and earlier, and 1.8.0) are therefore affected.</p><p><strong>2026-05-15: Until Harvester 1.7.2 and 1.8.1 are released with the fixes, apply the mitigation steps below to secure your clusters.</strong></p></div></div><p>You can confirm the version of the RKE2 ingress-nginx pods by running this command on your Harvester cluster:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n kube-system get po -l"app.kubernetes.io/name=rke2-ingress-nginx" -ojsonpath='{.items[].spec.containers[].image}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If the command returns one of the affected versions, perform the following mitigation steps.</p><p>The primary resolution is to upgrade Harvester to one of these versions:</p><ul><li>1.7.2 or newer</li><li>1.8.1 or newer</li></ul><p>If upgrade is not possible, apply the following mitigation to protect your clusters.</p><p>All ingress resources with the <code>nginx.ingress.kubernetes.io/rewrite-target</code> annotation containing <code>?</code> in the annotation value are at risk.</p><p>By default, Harvester does not include any ingress resources with this annotation. Run the following command on your clusters to identify affected custom ingress resources:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get ingress -A -o json | jq '.items[] | select(.metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"] // "" | contains("?")) | {namespace: .metadata.namespace, name: .metadata.name, rewrite: .metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"]}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Any ingress resources reported by the above command are vulnerable. They should be updated to either remove the vulnerable annotation or change the annotation value to not contain a question mark <code>?</code>.</p><p>The following validating admission policy can be applied to your cluster to reject ingress resources with the vulnerable configuration:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">cat&lt;&lt;EOF | kubectl apply -f -</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: ingress-nginx-annotation-validation-20260514</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  failurePolicy: Fail</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  matchConstraints:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    resourceRules:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - apiGroups:   ["networking.k8s.io"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      apiVersions: ["v1"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      operations:  ["CREATE", "UPDATE"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      resources:   ["ingresses"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - expression: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        !has(object.metadata.annotations) ||</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        !object.metadata.annotations.exists(k, k == 'nginx.ingress.kubernetes.io/rewrite-target') ||</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        !object.metadata.annotations['nginx.ingress.kubernetes.io/rewrite-target'].contains('?')</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      message: "Ingress resources with 'nginx.ingress.kubernetes.io/rewrite-target' annotation containing '?' in the annotation value are not allowed, due to the following CVEs: CVE-2026-42945, CVE-2026-42946, CVE-2026-40701, CVE-2026-42934"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">---</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicyBinding</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: ingress-nginx-annotation-validation-20260514</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  policyName: ingress-nginx-annotation-validation-20260514</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validationActions: [Deny]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>This policy is a cluster-scoped resource that requires the proper administrator RBAC permissions to create.</p></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>This validating policy prevents the inclusion of the vulnerable annotation configuration in new and existing ingress resources. However, it cannot detect or block any vulnerable ingress resources that already exist in the cluster. Therefore, it is important to follow the instructions described above to also identify and update any existing vulnerable ingress resources.</p></div></div><p>The policy can be removed once you upgrade to Harvester 1.7.2, 1.8.1 or newer:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete validatingadmissionpolicy ingress-nginx-annotation-validation-20260514</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete validatingadmissionpolicybinding ingress-nginx-annotation-validation-20260514</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://depthfirst.com/research/nginx-rift-achieving-nginx-rce-via-an-18-year-old-vulnerability" target="_blank" rel="noopener noreferrer">https://depthfirst.com/research/nginx-rift-achieving-nginx-rce-via-an-18-year-old-vulnerability</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-42945.html" target="_blank" rel="noopener noreferrer">https://www.suse.com/security/cve/CVE-2026-42945.html</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-42946.html" target="_blank" rel="noopener noreferrer">https://www.suse.com/security/cve/CVE-2026-42946.html</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-40701.html" target="_blank" rel="noopener noreferrer">https://www.suse.com/security/cve/CVE-2026-40701.html</a></li><li><a href="https://www.suse.com/security/cve/CVE-2026-42934.html" target="_blank" rel="noopener noreferrer">https://www.suse.com/security/cve/CVE-2026-42934.html</a></li></ul>]]></content:encoded>
            <category>security</category>
            <category>cve</category>
        </item>
        <item>
            <title><![CDATA[Regaining Admin/Root Acccess (Lost Password)]]></title>
            <link>https://harvesterhci.io/kb/regain_admin_access</link>
            <guid>regain_admin_access</guid>
            <pubDate>Wed, 06 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How to regain administrative access to a Harvester cluster after losing the admin/rancher user password]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="you-have-lost-the-admin-password-for-the-harvester-gui">You have lost the admin password for the Harvester GUI<a class="hash-link" href="#you-have-lost-the-admin-password-for-the-harvester-gui" title="Direct link to heading">​</a></h2><p>The admin password for the Harvester GUI can be reset if you can still login via ssh as the <code>rancher</code> user, or if you have the Harvester cluster's kubeconfig file saved locally. For details, see <a href="https://docs.harvesterhci.io/v1.8/faq/#how-can-i-reset-the-administrator-password" target="_blank" rel="noopener noreferrer">How can I reset the administrator password?</a> in the documentation.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="you-have-lost-the-rancher-users-sshconsole-login-password">You have lost the <code>rancher</code> user's ssh/console login password<a class="hash-link" href="#you-have-lost-the-rancher-users-sshconsole-login-password" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="but-you-still-have-the-harvester-clusters-kubeconfig">But you still have the Harvester cluster's kubeconfig<a class="hash-link" href="#but-you-still-have-the-harvester-clusters-kubeconfig" title="Direct link to heading">​</a></h3><p>The <code>rancher</code> user's ssh/console login password can be reset by creating a CloudInit CRD to update the password. For details, see <a href="https://docs.harvesterhci.io/v1.8/install/update-harvester-configuration#password-of-user-rancher" target="_blank" rel="noopener noreferrer">Password of user <code>rancher</code></a> in the documentation. Alternately you can create additional users with ssh access as described in <a href="/kb/how_to_create_ssh_user">How to create an SSH user for Harvester nodes</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="you-dont-have-a-kubeconfig-but-do-have-physical-or-remote-console-access">You don't have a kubeconfig, but do have physical or remote console access<a class="hash-link" href="#you-dont-have-a-kubeconfig-but-do-have-physical-or-remote-console-access" title="Direct link to heading">​</a></h3><p>In this case, the <code>rancher</code> user's ssh/console login password can be changed by editing <code>/oem/90_custom.yaml</code> on each host.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="if-you-can-boot-the-harvester-installer-iso">If you can boot the Harvester installer ISO<a class="hash-link" href="#if-you-can-boot-the-harvester-installer-iso" title="Direct link to heading">​</a></h4><p>Boot the Harvester installer, but don't proceed with the regular installation process. Instead, once the installer comes up, press CTRL-ALT-F2 to switch to VT2 and login as the <code>rancher</code> user with password <code>rancher</code>. Then proceed with the following steps:</p><ol><li>Run <code>sudo -i</code> to become root</li><li>Mount the COS_OEM partition from the host:<div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># mkdir /tmp/oem</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"># mount -L COS_OEM /tmp/oem</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li>Run <code>vim /tmp/oem/90_custom.yaml</code> to edit <code>90_custom.yaml</code> and change the password for the <code>rancher</code> user. You can specify either a plaintext password (not recommended) or a password hash generated with e.g. <code>openssl passwd -6</code>. Following is the section that you need to edit:<div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">users:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  rancher:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    passwd: &lt;PASSWORD_GOES_HERE&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li>Reboot the host. You should now be able to log in as the <code>rancher</code> user with the new password.</li></ol><h4 class="anchor anchorWithStickyNavbar_mojV" id="you-cant-boot-the-harvester-installer-iso-but-can-still-reboot-the-host-and-access-the-boot-menu">You can't boot the Harvester installer ISO, but can still reboot the host and access the boot menu<a class="hash-link" href="#you-cant-boot-the-harvester-installer-iso-but-can-still-reboot-the-host-and-access-the-boot-menu" title="Direct link to heading">​</a></h4><p>If you have no other option, then during system boot, edit the grub config and add <code>rd.break</code> at the end of the kernel command line (the one that starts with <code>linux</code>). This will drop you into the dracut emergency shell, with the root partition mounted under <code>/sysroot</code>. Unfortunately, this shell does not contain any text editor programs. Trying to edit <code>/oem/90_custom.yaml</code> under the circumstances would be unwise. Instead though, you can run this command:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># sed -i 's%rancher.*%rancher:$6$j0.h3TQv8RZPHJkB$3SbV978JLT2Qeq4KSCBZitErNlZZGfrDxnGW5HS0wHzWexGyPzeQBoQmQJetUhLFfquv/X5VWL6odxtlEec1u/:20468::::::%' /sysroot/etc/shadow</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Then, hit CTRL-D to continue, and once the system finishes booting, the <code>rancher</code> user's password will be set back to <code>rancher</code> <em>for this boot only</em>. You can then login on the console and use <code>vim</code> to update <code>/oem/90_custom.yaml</code> and permanently set the password to something more secure as described in the previous section.</p>]]></content:encoded>
            <category>operating system</category>
            <category>configuration</category>
            <category>security</category>
        </item>
        <item>
            <title><![CDATA[Upstream Ingress-Nginx CVEs - CVE-2025-15566, CVE-2026-1580, CVE-2026-24512, CVE-2026-24513, and CVE-2026-24514]]></title>
            <link>https://harvesterhci.io/kb/2026/02/23/nginx-ingress-cve</link>
            <guid>/2026/02/23/nginx-ingress-cve</guid>
            <pubDate>Mon, 23 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[This article provides information on the CVE-2025-15566, CVE-2026-1580, CVE-2026-24512, CVE-2026-24513, and CVE-2026-24514 vulnerabilities in Harvester.]]></description>
            <content:encoded><![CDATA[<p>This article provides information and mitigation steps for the following vulnerabilities in Harvester:</p><ul><li><a href="https://github.com/kubernetes/kubernetes/issues/136789" target="_blank" rel="noopener noreferrer">CVE-2025-15566</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136677" target="_blank" rel="noopener noreferrer">CVE-2026-1580</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136678" target="_blank" rel="noopener noreferrer">CVE-2026-24512</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136679" target="_blank" rel="noopener noreferrer">CVE-2026-24513</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136680" target="_blank" rel="noopener noreferrer">CVE-2026-24514</a></li></ul><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>These vulnerabilities affect specific versions of the RKE2 ingress-nginx controller (v1.13.7 and earlier, v1.14.3 and earlier). All Harvester versions that use this controller (including 1.5.2 and earlier, 1.6.1 and earlier, and 1.7.0) are therefore affected.</p><p><strong>These CVEs are fixed in Harvester 1.7.1 and newer.</strong></p></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Harvester does not utilize the ingress-nginx controller custom error backend. Therefore, it is not affected by <a href="https://github.com/kubernetes/kubernetes/issues/136679" target="_blank" rel="noopener noreferrer">CVE-2026-24513</a>.</p></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Currently, no mitigation is available for <a href="https://github.com/kubernetes/kubernetes/issues/136680" target="_blank" rel="noopener noreferrer">CVE-2026-24514</a>. An upgrade to Harvester 1.7.1 is required.</p><p>For more information on its CVSS score, see <a href="https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H" target="_blank" rel="noopener noreferrer">https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H</a></p></div></div><p>You can confirm the version of the RKE2 ingress-nginx pods by running this command on your Harvester cluster:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n kube-system get po -l"app.kubernetes.io/name=rke2-ingress-nginx" -ojsonpath='{.items[].spec.containers[].image}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If the command returns one of the affected versions, perform one of the following mitigation steps.</p><p>The primary resolution is to upgrade to Harvester 1.7.1 or newer, which includes the fixed RKE2 ingress-nginx controller.</p><p>If upgrade is not possible, deploy the following validating admission policy to your cluster to reject ingress resources with the vulnerable configuration:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">cat&lt;&lt;EOF | kubectl apply -f -</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: ingress-nginx-annotation-validation</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  failurePolicy: Fail</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  matchConstraints:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    resourceRules:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - apiGroups:   ["networking.k8s.io"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      apiVersions: ["v1"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      operations:  ["CREATE", "UPDATE"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      resources:   ["ingresses"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - expression: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        !('nginx.ingress.kubernetes.io/auth-proxy-set-headers' in object.metadata.annotations) &amp;&amp;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        !('nginx.ingress.kubernetes.io/auth-method' in object.metadata.annotations) &amp;&amp;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        (object.spec.rules.all(rule, rule.http.paths.all(path, path.pathType != 'ImplementationSpecific')))</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      message: "Ingress resources with the vulnerable annotations are not allowed. Please remove the 'nginx.ingress.kubernetes.io/auth-proxy-set-headers' and 'nginx.ingress.kubernetes.io/auth-method' annotations, and avoid using the 'ImplementationSpecific' path type."</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">---</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicyBinding</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: ingress-nginx-annotation-validation</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  policyName: ingress-nginx-annotation-validation</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validationActions: [Deny]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>This policy is a cluster-scoped resource that requires the proper administrator RBAC permissions to create.</p></div></div><p>This validating policy rejects any ingress resources that contain the:</p><ul><li><code>nginx.ingress.kubernetes.io/auth-proxy-set-headers</code> annotation</li><li><code>nginx.ingress.kubernetes.io/auth-method</code> annotation</li><li><code>ImplementationSpecific</code> path type</li></ul><p>The policy can be removed once you upgrade to Harvester 1.7.1 or newer:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete validatingadmissionpolicy ingress-nginx-annotation-validation</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl delete validatingadmissionpolicybinding ingress-nginx-annotation-validation</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://github.com/kubernetes/kubernetes/issues/136789" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/136789</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136677" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/136677</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136678" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/136678</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136679" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/136679</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/136680" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/136680</a></li><li><a href="https://support.scc.suse.com/s/kb/Upstream-Ingress-Nginx-CVEs-CVE-2025-15566-CVE-2026-1580-CVE-2026-24512-CVE-2026-24513-and-CVE-2026-24514" target="_blank" rel="noopener noreferrer">https://support.scc.suse.com/s/kb/Upstream-Ingress-Nginx-CVEs-CVE-2025-15566-CVE-2026-1580-CVE-2026-24512-CVE-2026-24513-and-CVE-2026-24514</a></li></ul>]]></content:encoded>
            <category>security</category>
            <category>cve</category>
        </item>
        <item>
            <title><![CDATA[Troubleshooting VM Live Migration Issues Caused by Node Selectors]]></title>
            <link>https://harvesterhci.io/kb/troubleshooting_vm_scheduling_issues_nodeselector</link>
            <guid>troubleshooting_vm_scheduling_issues_nodeselector</guid>
            <pubDate>Tue, 09 Dec 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How to resolve VM live migration failures when target nodes lack specific features due to nodeSelector constraints.]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="issue">Issue<a class="hash-link" href="#issue" title="Direct link to heading">​</a></h2><p>Node selector constraints can prevent the scheduler from live-migrating a virtual machine to a target node. This often indicates a mismatch between the virtual machine's requirements and the node's capabilities.</p><p>A node selector may require a specific CPU feature, but the target node lacks the corresponding label (for example, <code>cpu-feature.node.kubevirt.io/fpu: "true"</code>). This mismatch can occur when the <code>host-model</code> CPU models and features computed by KubeVirt change over time.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="solutions">Solutions<a class="hash-link" href="#solutions" title="Direct link to heading">​</a></h2><p>You can resolve this issue using four different approaches.</p><ul><li><p>Reboot the virtual machine.</p><p>KubeVirt automatically adds node selectors (during a previous migration or initial start) that can restrict scheduling. You can clear these node selectors by rebooting the virtual machine.</p></li><li><p>Reboot the virtual machine and set up a common CPU model.</p><p>You can override KubeVirt's default <code>host-model</code> CPU configuration by <a href="/kb/setup_common_cpu_model_for_vm_live_migration">setting up a common CPU model for virtual machine migration</a>. The model is applied to the virtual machine as its domain CPU, and to the pod as its node selector configuration.</p><p>This is the recommended approach for environments that can tolerate restarting of virtual machines.</p></li><li><p>Modify the node labels.</p><p>If rebooting the virtual machine is not an option, you can manually manipulate the target node's labels to satisfy the scheduling requirements.</p><ol><li><p>Add the <code>node-labeller.kubevirt.io/skip-node="true"</code> annotation to the target node.</p><p>This annotation, which persists even after upgrades, prevents KubeVirt's <code>node-labeller</code> from automatically adding or removing CPU-related labels on this node.</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl annotate </span><span class="token function" style="color:#d73a49">node</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">node-name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> node-labeller.kubevirt.io/skip-node</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>The annotation itself does not affect the pod's node selector. It only controls the presence of specific CPU-related labels on the node, which the node selector checks against. For more information, see the <a href="#references">References</a> section.</p></div></div></li><li><p>Identify labels that are missing from the virtual machine's node selector and add them to the target node.</p><p>You can add the missing labels using the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl label </span><span class="token function" style="color:#d73a49">node</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">node-name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">key</span><span class="token operator" style="color:#393A34">&gt;=</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">value</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This circumvents the standard scheduling restrictions, allowing the virtual machine to migrate to the target node.</p></li></ol><p>If a new node that lacks the required features is added to the cluster, you must repeat these steps to allow the virtual machine to live-migrate to that node.</p></li><li><p>Remove the node labels.</p><p>If you want to ensure that the virtual machine does not acquire specific node selector constraints after live migration, you can remove the <a href="#kubevirt-node-labels">relevant CPU labels</a> from the target node.</p><ol><li><p>Add the <code>node-labeller.kubevirt.io/skip-node="true"</code> annotation to the target node.</p><p>This annotation, which persists even after upgrades, prevents KubeVirt's <code>node-labeller</code> from automatically adding or removing CPU-related labels on this node.</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl annotate </span><span class="token function" style="color:#d73a49">node</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">node-name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> node-labeller.kubevirt.io/skip-node</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>This method works only if the virtual machine's pod does not have an existing node selector that contains the labels listed in the <a href="#references">References</a> section. Otherwise, you must reboot the virtual machine to clear the constraints.</p></div></div></li><li><p>Check if the pod has a node selector.</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get pod </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">pod-name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> -o yaml </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">grep</span><span class="token plain"> nodeSelector -A </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> -B </span><span class="token number" style="color:#36acaa">5</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>If no node selector exists, remove the relevant <a href="#kubevirt-node-labels">CPU labels</a> from the node.</p><p>Performing this action prevents the pod from acquiring new node selector constraints, thus enabling its future migration to other nodes. However, the successful outcome of that migration is not guaranteed.</p></li></ol></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="kubevirt-node-labels">KubeVirt Node Labels<a class="hash-link" href="#kubevirt-node-labels" title="Direct link to heading">​</a></h3><p>The KubeVirt CPU node-labeller manages the following labels:</p><ul><li><code>cpu-feature.node.kubevirt.io/*</code></li><li><code>cpu-model-migration.node.kubevirt.io/*</code></li><li><code>cpu-model.node.kubevirt.io/*</code></li><li><code>host-model-cpu.node.kubevirt.io</code></li><li><code>host-model-required-features.node.kubevirt.io</code></li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="external-links">External Links<a class="hash-link" href="#external-links" title="Direct link to heading">​</a></h3><ul><li><a href="https://kubevirt.io/user-guide/compute/virtual_hardware/#labeling-nodes-with-cpu-models-cpu-features-and-machine-types" target="_blank" rel="noopener noreferrer">Labeling nodes with CPU models, CPU features and machine types</a></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>virtual machine</category>
            <category>VM</category>
            <category>scheduling</category>
            <category>nodeSelector</category>
            <category>troubleshooting</category>
        </item>
        <item>
            <title><![CDATA[VM Network Slowness Due to GRO and GSO Offloading Issue]]></title>
            <link>https://harvesterhci.io/kb/disable_gro_gso_offload</link>
            <guid>disable_gro_gso_offload</guid>
            <pubDate>Mon, 08 Dec 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Reason for VM Network slowness and how to fix it by disabling GRO/GSO offload caused by some specific NICs]]></description>
            <content:encoded><![CDATA[<p>When guest virtual machines running on Harvester nodes experience very slow network throughput, disabling Generic Receive Offload (GRO) and Generic Segmentation Offload (GSO) on the host interfaces may resolve the issue.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="problem">Problem<a class="hash-link" href="#problem" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="symptoms">Symptoms<a class="hash-link" href="#symptoms" title="Direct link to heading">​</a></h3><p>In the testing environment, guest virtual machines experienced severely degraded download and transfer speeds, dropping as low as 100 bps. This extreme slowdown was particularly evident when <code>apt-get update</code>, <code>curl</code>, and <code>scp</code> were used to transfer data between virtual machines running on different nodes. In contrast, performance remained normal when the virtual machines were hosted on the same node.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="environment">Environment<a class="hash-link" href="#environment" title="Direct link to heading">​</a></h3><p>The issue was observed in a Harvester cluster hosted on Dell servers using Broadcom NetXtreme-E Series BCM57508 NICs (100 Gbps). <code>mgmt</code>, the built-in cluster network, was used for both management and virtual machine traffic.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="cause">Cause<a class="hash-link" href="#cause" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="root-cause">Root Cause<a class="hash-link" href="#root-cause" title="Direct link to heading">​</a></h3><p>Harvester relies on Linux’s bridge-based virtual networking to connect guest virtual machines to physical networks.</p><p>The NetXtreme-E BCM57508 NICs were connected to leaf switches configured to transmit jumbo frames. When the default MTU of <code>1500</code> is used, these frames should ideally be segmented to approximately 1450 bytes before reaching the Harvester host kernel. However, the packets actually arriving at the kernel were fragmented into unexpectedly small sizes. This forced the kernel to process a significantly higher volume of packets, leading to increased CPU overhead and reduced download throughput.</p><p>Packets captures collected using the following command confirmed the unexpectedly small size of the incoming packets.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">tcpdump -xx -i &lt;interface-name&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">&lt;interface-name&gt; is the name of the physical interface on the host connected to the VMs.</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="grogso-offload">GRO/GSO offload<a class="hash-link" href="#grogso-offload" title="Direct link to heading">​</a></h3><p>Generic Receive Offload (GRO) and Generic Segmentation Offload (GSO) are kernel-level software offloading mechanisms designed to optimize network performance. GRO aggregates multiple small incoming packets into larger ones before passing them to the network stack. GSO performs the opposite on transmission, splitting large packets into smaller frames before sending them to the NIC.</p><p>While these features are typically used to enhance performance, in this specific scenario, they interfered with the normal TCP segmentation process. This interference led to inefficient packet segmentation and the creation of an excessive number of small fragments, which ultimately degraded overall network performance.</p><p>When GRO and GSO were disabled, the Linux network stack automatically reverted to using standard transport-layer segmentation methods, specifically TCP Segmentation Offload (TSO) and Large Receive Offload (LRO). These mechanisms maintained efficient packet aggregation and segmentation at the appropriate layers, ensuring properly sized packets were presented to the kernel, which successfully restored expected network performance.</p><p>The NetXtreme-E BCM57508 NICs may experience suboptimal interaction with GRO and GSO due to a Broadcom driver bug. Enabling these offload mechanisms led to inefficient packetization, producing many small packets instead of fewer large ones, which ultimately reduced network throughput.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="solution">Solution<a class="hash-link" href="#solution" title="Direct link to heading">​</a></h2><ul><li><p>Option 1: Disable GRO and GSO on the affected Harvester host interfaces. This change does not persist across reboots.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># Check current offload settings</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">/usr/sbin/ethtool -k &lt;interface-name&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"># Disable GRO and GSO</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">/usr/sbin/ethtool -K &lt;interface-name&gt; gro off</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">/usr/sbin/ethtool -K &lt;interface-name&gt; gso off</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Option 2: Apply the following cloudinit resource and reboot the nodes. This change persists across reboots.</p><p>  Replace <code>&lt;interface-name&gt;</code> with the name of the physical interface the virtual machines are connected to.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: disable-offloads</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  matchSelector: {}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  filename: 99_disable_offloads.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  contents: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    stages:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      network:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        - commands:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            - /usr/sbin/ethtool -K &lt;interface-name&gt; gro off</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            - /usr/sbin/ethtool -K &lt;interface-name&gt; gso off</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="verification">Verification<a class="hash-link" href="#verification" title="Direct link to heading">​</a></h2><ul><li>Run <code>apt-get update</code> or a <code>curl</code> command from a guest virtual machine. The download throughput should be normal (utilizing most of the link capacity).</li><li>Transfer files between virtual machines running on different nodes using <code>scp</code>. The file transfers should be completed at the expected speed.</li><li>Verify that no packets are dropped and no errors are reported using the following command:<div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">ip -s link show &lt;interface-name&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ul>]]></content:encoded>
            <category>vm network</category>
            <category>performance</category>
        </item>
        <item>
            <title><![CDATA[Kubernetes VolumeAttachment vs Longhorn VolumeAttachment]]></title>
            <link>https://harvesterhci.io/kb/k8s-vs-longhorn-volumeattachment</link>
            <guid>k8s-vs-longhorn-volumeattachment</guid>
            <pubDate>Tue, 04 Nov 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Understand the differences between Kubernetes VolumeAttachment (storage.k8s.io/v1) and Longhorn VolumeAttachment (longhorn.io/v1beta2), how they work together, and how to troubleshoot volume attachment issues]]></description>
            <content:encoded><![CDATA[<p>When working with Longhorn, you may encounter two different VolumeAttachment resources with similar names: <strong>Kubernetes VolumeAttachment</strong> (<code>storage.k8s.io/v1</code>) and <strong>Longhorn VolumeAttachment</strong> (<code>longhorn.io/v1beta2</code>). This often causes confusion about why both exist, when each is created, whether they always appear together, and which one to check when troubleshooting. This document clarifies their distinct roles, shows how they work together (and when they don't), and provides real-world examples to help you identify attachment sources and effectively troubleshoot volume attachment issues.</p><p>For additional context, see the official documentation at <a href="https://longhorn.io/docs/latest/advanced-resources/volumeattachment/" target="_blank" rel="noopener noreferrer">https://longhorn.io/docs/latest/advanced-resources/volumeattachment/</a></p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>The observations and analysis in this document are based on Longhorn latest 1.10.x branch.</p></div></div><hr><h2 class="anchor anchorWithStickyNavbar_mojV" id="workflow-how-k8s-and-longhorn-volumeattachments-work-together">Workflow: How K8s and Longhorn VolumeAttachments Work Together<a class="hash-link" href="#workflow-how-k8s-and-longhorn-volumeattachments-work-together" title="Direct link to heading">​</a></h2><p>When a Pod requires a Longhorn volume, two separate VolumeAttachment resources work together to complete the attachment process. The Kubernetes VolumeAttachment represents the CSI standard attachment request, while the Longhorn VolumeAttachment manages the actual attachment orchestration with ticket-based coordination.</p><p>The following diagram illustrates the complete flow from Pod scheduling to successful volume attachment:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│                  Pod Scheduled to Node                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Kubernetes Attach/Detach Controller                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Creates K8s VolumeAttachment                                │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│   APIVersion: storage.k8s.io/v1                             │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│   Spec:                                                     │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     Attacher: driver.longhorn.io                            │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     NodeName: worker-node-1                                 │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     Source.PersistentVolumeName: pvc-xxx                    │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ CSI External-Attacher (Longhorn)                            │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Watches K8s VolumeAttachment                                │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn CSI Plugin                                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Calls ControllerPublishVolume()                             │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn Manager API                                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Creates/Updates Longhorn VolumeAttachment                   │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│   APIVersion: longhorn.io/v1beta2                           │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│   Spec:                                                     │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     Volume: my-volume                                       │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     AttachmentTickets:                                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│       csi-attacher-&lt;hash&gt;:                                  │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│         ID: &lt;pod-id&gt;                                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│         Type: csi-attacher                                  │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│         NodeID: worker-node-1                               │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│         Parameters: {...}                                   │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn VolumeAttachment Controller                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ 1. Evaluates all attachment tickets                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ 2. Selects appropriate ticket to satisfy                    │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ 3. Updates Volume.Spec.NodeID = worker-node-1               │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn Volume Controller                                  │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Performs actual volume attachment operation                 │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn VolumeAttachment Controller                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Updates ticket status: Satisfied = true                     │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn CSI Plugin                                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Returns attach success to external-attacher                 │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ CSI External-Attacher                                       │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Updates K8s VolumeAttachment.Status.Attached = true         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────────────────────────────────────────────┘</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The resulting Longhorn VolumeAttachment YAML:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeAttachment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">longhornvolume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">volume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTickets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># This CSI ticket was triggered by K8s VolumeAttachment (Pod binding)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-3d3120f43480db87c91a6902d670c35899917c03f9f6f81db7bf26d9d66e45ec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3d3120f43480db87c91a6902d670c35899917c03f9f6f81db7bf26d9d66e45ec</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">attacher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeID</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> harvester</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">disableFrontend</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"false"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTicketStatuses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-3d3120f43480db87c91a6902d670c35899917c03f9f6f81db7bf26d9d66e45ec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3d3120f43480db87c91a6902d670c35899917c03f9f6f81db7bf26d9d66e45ec</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">satisfied</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Volume successfully attached</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"True"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Notice the <code>csi-attacher</code> ticket type - this confirms the attachment was triggered by Kubernetes VolumeAttachment through the CSI flow, not by Longhorn internal operations.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="trigger-points">Trigger Points<a class="hash-link" href="#trigger-points" title="Direct link to heading">​</a></h3><p>Understanding when each VolumeAttachment is created or modified is crucial for troubleshooting attachment issues:</p><ol><li><p><strong>K8s VolumeAttachment Creation</strong>: Triggered when Pod is scheduled to a node requiring a PVC</p><ul><li>Managed by Kubernetes Attach/Detach (AD) Controller</li><li>One VolumeAttachment per PV-node combination</li><li>Represents Kubernetes' intent to attach the volume</li></ul></li><li><p><strong>Longhorn VolumeAttachment Ticket Addition</strong>: Triggered by various Longhorn components based on operation needs:</p><ul><li><code>CSIAttacher</code> - when CSI ControllerPublishVolume is called</li><li><code>SnapshotController</code> - when creating snapshots of volumes</li><li><code>BackupController</code> - when backing up volumes</li><li><code>LonghornAPI</code> - when users manually attach volumes via Longhorn UI</li><li><code>VolumeCloneController</code> - when managing source volume during clone</li><li><code>VolumeRestoreController</code> - when restoring data from backups</li><li><code>VolumeExpansionController</code> - when expanding volume size</li><li><code>ShareManagerController</code> - for RWX volume sharing</li><li><code>SalvageController</code> - for volume salvage operations</li></ul></li></ol><hr><h2 class="anchor anchorWithStickyNavbar_mojV" id="attachment-ticket-priority-and-coordination">Attachment Ticket Priority and Coordination<a class="hash-link" href="#attachment-ticket-priority-and-coordination" title="Direct link to heading">​</a></h2><p>When multiple operations require volume attachment simultaneously, Longhorn uses a <strong>ticket-based priority system</strong> to coordinate access intelligently. This ensures critical operations take precedence while allowing background tasks to coexist when possible.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="how-priority-works">How Priority Works<a class="hash-link" href="#how-priority-works" title="Direct link to heading">​</a></h3><p>Each ticket type has an assigned priority level that determines selection order when the volume is detached:</p><ul><li><strong>Priority 2000</strong> (Highest): <ul><li><code>VolumeRestoreController</code></li><li><code>VolumeExpansionController</code></li></ul></li><li><strong>Priority 1000</strong>: <ul><li><code>LonghornAPI</code></li></ul></li><li><strong>Priority 900</strong>: <ul><li><code>CSIAttacher</code></li><li><code>ShareManagerController</code></li><li><code>SalvageController</code></li></ul></li><li><strong>Priority 800</strong> (Lowest): <ul><li><code>BackupController</code></li><li><code>SnapshotController</code></li><li><code>VolumeCloneController</code></li><li><code>VolumeEvictionController</code></li></ul></li></ul><p>When the volume is detached, the ticket with the highest priority is selected for attachment. If multiple tickets share the same priority, the first one (sorted by ID) is chosen.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>For ReadWriteMany (RWX) Filesystem mode volumes, <code>CSIAttacher</code> tickets are ignored during ticket selection and detachment decisions. Only the <code>ShareManagerController</code> ticket is considered, as it manages the centralized sharing mechanism for RWX access. Individual CSI attacher tickets from Pods are summarized and handled by the Share Manager, not directly by the VolumeAttachment Controller.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="interruption-mechanism">Interruption Mechanism<a class="hash-link" href="#interruption-mechanism" title="Direct link to heading">​</a></h3><p>Priority levels alone don't tell the complete story. Longhorn also implements an interruption mechanism to handle cases where request arrives while the volume is already attached to a different node.</p><p><strong>Interruptible operations (can be interrupted)</strong>:</p><ul><li><code>BackupController</code></li><li><code>SnapshotController</code></li><li><code>VolumeCloneController</code> - clone operations, but only when the volume is in <code>VolumeCloneStateCopyCompletedAwaitingHealthy</code> state</li></ul><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>The <code>VolumeCloneController</code> is only interruptible in a specific state. During the data copy phase, clone operations cannot be interrupted. Interruption is only allowed after the copy completes and the volume is waiting to become healthy, preventing data corruption during active copy operations.</p></div></div><p><strong>Workload operations (can trigger interruption)</strong>:</p><ul><li><code>CSIAttacher</code> - Pod workloads requiring the volume on a different node</li><li><code>LonghornAPI</code> - manual attachment requests via UI/API</li><li><code>ShareManagerController</code> - RWX volume sharing operations</li></ul><p>The interruption only occurs when:</p><ol><li>The volume's currently attached node has only interruptible tickets</li><li>A different node has a workload ticket requesting the volume</li></ol><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Interruption is based on <strong>ticket type classification</strong>, not priority numbers. Priority numbers only affect the selection order during the attachment phase when the volume is detached.</p></div></div><p>This design ensures background operations never block workload rescheduling, while protecting active workloads from being interrupted by other background tasks.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="real-world-scenarios">Real-World Scenarios<a class="hash-link" href="#real-world-scenarios" title="Direct link to heading">​</a></h3><p><strong>Scenario 1: Backup During Active Pod Usage</strong></p><ul><li>Pod is running on node-A with a <code>CSIAttacher</code> ticket</li><li><code>BackupController</code> creates a ticket for node-A (same node)</li><li>Both tickets coexist peacefully - backup runs alongside the Pod</li><li>CSI attachment and backup execution use the engine on the same node, avoiding a node transition.</li></ul><p><strong>Scenario 2: Backup Interrupted by Pod Workload</strong>  </p><ul><li><code>BackupController</code> is running on node-A (only ticket present)</li><li>A Pod requiring this volume is scheduled to node-B, <code>CSIAttacher</code> creates a ticket for node-B</li><li>VolumeAttachment Controller detects: interruptible ticket on node-A, workload ticket on node-B</li><li>Volume detaches from node-A (backup interrupted), attaches to node-B (csi attacher)</li><li>Backup will retry later automatically</li></ul><p><strong>Scenario 3: Detached Volume Snapshot</strong></p><ul><li>Volume is detached, <code>SnapshotController</code> creates a ticket</li><li>Volume attaches temporarily for snapshot creation</li><li>After snapshot completes, ticket is removed</li><li>Volume auto-detaches if no other tickets exist</li></ul><hr><h2 class="anchor anchorWithStickyNavbar_mojV" id="usage-examples">Usage Examples<a class="hash-link" href="#usage-examples" title="Direct link to heading">​</a></h2><p>The following examples demonstrate how VolumeAttachment resources behave in common scenarios. Each example shows the complete YAML resource state at different stages, helping you understand what to look for when troubleshooting or monitoring Longhorn operations.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="example-1-volumesnapshot-creation-longhorn-volumeattachment-only">Example 1: VolumeSnapshot Creation (Longhorn VolumeAttachment Only)<a class="hash-link" href="#example-1-volumesnapshot-creation-longhorn-volumeattachment-only" title="Direct link to heading">​</a></h3><p>VolumeSnapshot operations use <strong>only Longhorn VolumeAttachment</strong> without involving Kubernetes VolumeAttachment. This demonstrates that Longhorn VolumeAttachment can operate independently for internal operations.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│           User Creates VolumeSnapshot via kubectl           │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│           kubectl apply -f volumesnapshot.yaml              │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn Snapshot Controller                                │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Detects new VolumeSnapshot resource                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Snapshot Controller Checks Volume State                     │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ If Volume is detached → needs attachment for snapshot       │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Snapshot Controller Creates Attachment Ticket               │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Updates Longhorn VolumeAttachment:                          │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│   AttachmentTickets:                                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│     snapshot-&lt;snapshot-name&gt;:                               │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│       Type: snapshot-controller                             │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│       NodeID: &lt;volume-owner-node&gt;                           │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│       Parameters: {disableFrontend: "false"}                │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│                                                             │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ ❌ No K8s VolumeAttachment created                          │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn VolumeAttachment Controller                        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Selects snapshot ticket → Updates Volume.Spec.NodeID        │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Longhorn Volume Controller                                  │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Attaches volume → Starts Engine                             │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Snapshot Controller                                         │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Engine running → Creates snapshot via Engine API            │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Snapshot complete → Removes attachment ticket               │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────┬───────────────────────────────────────┘</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      ▼</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────┐</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">│ Volume May Auto-Detach (if no other tickets exist)          │</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────────────────────────────────────────────┘</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The Longhorn VolumeAttachment YAML during snapshot creation:</p><p><strong>During Snapshot Creation</strong> (ticket exists):</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeAttachment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">30</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">volume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTickets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># Temporary ticket created by Snapshot Controller</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">snapshot-controller-snapshot-a36bedf5-fb3b-4b30-a10d-ed98f9c0323a</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> snapshot</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">controller</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">snapshot</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">a36bedf5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">fb3b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4b30</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">a10d</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ed98f9c0323a</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> snapshot</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">controller</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeID</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> harvester</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">disableFrontend</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> any</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTicketStatuses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">snapshot-controller-snapshot-a36bedf5-fb3b-4b30-a10d-ed98f9c0323a</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> snapshot</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">controller</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">snapshot</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">a36bedf5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">fb3b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4b30</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">a10d</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ed98f9c0323a</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">satisfied</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Snapshot in progress</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"False"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><strong>After Snapshot Completes</strong> (ticket removed):</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeAttachment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">31</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Incremented after ticket removal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">volume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0b9c8d59</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0ae8</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">413c</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8bc5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">af32b932b8ab</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTickets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Ticket removed after snapshot completes</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTicketStatuses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><strong>Key Observations</strong>:</p><ul><li>The <code>snapshot-controller</code> ticket type clearly identifies this as a Longhorn internal operation</li><li>Unlike <code>csi-attacher</code> tickets (triggered by K8s), this ticket is created purely by Longhorn</li><li>The ticket is <strong>temporary</strong> - it appears during snapshot creation and disappears when complete</li><li>No corresponding Kubernetes VolumeAttachment exists for this operation</li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="example-2-vm-migration">Example 2: VM Migration<a class="hash-link" href="#example-2-vm-migration" title="Direct link to heading">​</a></h3><p>During VM migration, Harvester has two virt-launcher pods for the same VM: the original pod on the source node and a new pod on the target node. This multi-attach capability is enabled for <strong>RWX (ReadWriteMany) block mode volumes when the StorageClass has <code>migratable: true</code> parameter</strong>, which allows Longhorn to support live VM migration. In the following example, we migrate a VM from harvester-node-2 to harvester-node-0.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeAttachment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">creationTimestamp</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2025-12-10T04:19:42Z"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">finalizers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> longhorn.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">3</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">longhornvolume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ownerReferences</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Volume</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">uid</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 7cd2ed46</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">194f</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4528</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">83f7</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">bbaa5945e7e3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">resourceVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2736440"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">uid</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> b2492681</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8fcb</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4330</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">9ec6</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">496afa93e96b</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTickets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-5852f2d48d96311bb582eeeaad0e38361031d502899416c71cea10795748a84b</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">5852f2d48d96311bb582eeeaad0e38361031d502899416c71cea10795748a84b</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeID</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> harvester</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">disableFrontend</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"false"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastAttachedBy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">attacher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeID</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> harvester</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">disableFrontend</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"false"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastAttachedBy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">attacher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">volume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTicketStatuses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-5852f2d48d96311bb582eeeaad0e38361031d502899416c71cea10795748a84b</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">lastProbeTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastTransitionTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2025-12-10T04:19:49Z"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">message</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">reason</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"True"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">5852f2d48d96311bb582eeeaad0e38361031d502899416c71cea10795748a84b</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">satisfied</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">lastProbeTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastTransitionTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2025-12-10T04:21:00Z"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">message</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> The migrating attachment ticket is satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">reason</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"True"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">satisfied</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><strong>After Migration Completes</strong> (ticket removed):</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeAttachment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">creationTimestamp</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2025-12-10T04:19:42Z"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">finalizers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> longhorn.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">4</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">longhornvolume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ownerReferences</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Volume</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">uid</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 7cd2ed46</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">194f</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4528</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">83f7</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">bbaa5945e7e3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">resourceVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2736824"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">uid</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> b2492681</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8fcb</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4330</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">9ec6</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">496afa93e96b</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTickets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeID</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> harvester</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">disableFrontend</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"false"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastAttachedBy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">attacher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">volume</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pvc</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">0dc9e1f0</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4932</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4567</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">aa1e</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">e70b570058da</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">attachmentTicketStatuses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">csi-f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">lastProbeTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">lastTransitionTime</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2025-12-10T04:21:00Z"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">message</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">reason</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"True"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Satisfied</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">generation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">f080d69495b619fad93621ff3d57201793952e422304cceac8807e975ccf795d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">satisfied</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><strong>Key Observations</strong>:</p><ul><li><strong>Two CSI attachment tickets coexist</strong>: One pointing to the source node (harvester-node-2) and another to the target node (harvester-node-0)</li><li><strong>Both tickets are <code>csi-attacher</code> type</strong>: Indicating they were both triggered by Kubernetes VolumeAttachment through the CSI flow</li><li><strong>Both tickets have <code>satisfied: true</code> status</strong>: This demonstrates Longhorn's support for attaching the same volume to multiple nodes simultaneously (RWX-like behavior for migration)</li><li><strong>Target node ticket has special message</strong>: "The migrating attachment ticket is satisfied" explicitly identifies this as a migration scenario</li><li><strong>Multi-attach is temporary</strong>: This dual-attachment state only exists during VM migration; the source node's ticket will be removed after migration completes</li></ul><hr><h2 class="anchor anchorWithStickyNavbar_mojV" id="summary">Summary<a class="hash-link" href="#summary" title="Direct link to heading">​</a></h2><p>Longhorn uses <strong>two different VolumeAttachment resources</strong> for different purposes:</p><p><strong>Kubernetes VolumeAttachment</strong> (<code>storage.k8s.io/v1</code>) follows the standard CSI specification and is created <strong>only</strong> when Pods are scheduled to nodes. It represents Kubernetes' official attachment intent and is managed by K8s Attach/Detach Controller and CSI External-Attacher.</p><p><strong>Longhorn VolumeAttachment</strong> (<code>longhorn.io/v1beta2</code>) extends beyond CSI to support Longhorn's advanced features. It's created for <strong>multiple scenarios</strong>, including Pod workloads, snapshots, backups, clones, and manual operations. It uses a ticket-based system to coordinate concurrent attachment requests and is managed collaboratively by multiple Longhorn controllers.</p><p><strong>Why both are needed:</strong> K8s VolumeAttachment ensures CSI compliance with the Kubernetes ecosystem, while Longhorn VolumeAttachment enables automation for background operations without manual intervention. Importantly, not all Longhorn operations trigger K8s VolumeAttachment—for example, creating a VolumeSnapshot only creates a Longhorn VolumeAttachment ticket (<code>snapshot-controller</code>), not a K8s VolumeAttachment.</p><p><strong>When troubleshooting:</strong> Check both resources. K8s VolumeAttachment shows the CSI standard workflow status, while Longhorn VolumeAttachment shows the complete picture, including all internal operations via attachment tickets. Look at the ticket <strong>type</strong> to identify the operation source: <code>csi-attacher</code> means triggered by the K8s VolumeAttachment (Pod workload), while <code>snapshot-controller</code>, <code>backup-controller</code>, etc. indicate Longhorn internal operations.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>longhorn</category>
            <category>volumeattachment</category>
            <category>storage</category>
        </item>
        <item>
            <title><![CDATA[VM Data Consistency for External CSI Storage Backup with Velero]]></title>
            <link>https://harvesterhci.io/kb/2025/10/07/velero-backup-filesystem-freeze</link>
            <guid>/2025/10/07/velero-backup-filesystem-freeze</guid>
            <pubDate>Tue, 07 Oct 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Learn how to implement filesystem freeze for External CSI Storage Backup with Velero to ensure data consistency.]]></description>
            <content:encoded><![CDATA[<p>In this <a href="https://harvesterhci.io/kb/2025/05/26/velero-backup-restore" target="_blank" rel="noopener noreferrer">Harvester Knowledge Base article</a>, <a href="https://github.com/ihcsim" target="_blank" rel="noopener noreferrer">Ivan Sim</a> provided comprehensive guidance on using <a href="https://velero.io/" target="_blank" rel="noopener noreferrer">Velero</a> to perform backup and restore operations for VMs with external storage in Harvester.</p><p>However, in certain scenarios, users may require the VM filesystem to be quiesced during Velero backup creation to prevent data corruption, especially when the VM is experiencing heavy I/O operations.</p><p>This article describes how to customize <a href="https://velero.io/docs/v1.17/backup-hooks/" target="_blank" rel="noopener noreferrer">Velero Backup Hooks</a> to implement filesystem freeze during Velero backup processing, ensuring data consistency in the backup content.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="background-knowledge">Background Knowledge<a class="hash-link" href="#background-knowledge" title="Direct link to heading">​</a></h2><p>KubeVirt's <a href="https://github.com/kubevirt/kubevirt/blob/main/docs/freeze.md#virt-freezer" target="_blank" rel="noopener noreferrer">virt-freezer</a> provides a mechanism to freeze and thaw guest filesystems. This capability can be leveraged to ensure filesystem consistency during VM backups. However, certain prerequisites must be met for filesystem freeze/thaw operations to function properly:</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="prerequisites-for-filesystem-freeze">Prerequisites for Filesystem Freeze<a class="hash-link" href="#prerequisites-for-filesystem-freeze" title="Direct link to heading">​</a></h3><ul><li><strong>QEMU Guest Agent must be enabled</strong> in the guest VM<ul><li>Verify this by checking if the VMI has <strong>AgentConnected</strong> in its status</li></ul></li><li><strong>Guest VM must be properly configured</strong> for related libvirt commands<ul><li>When <strong>virt-freezer</strong> is triggered, KubeVirt communicates with the <strong>QEMU Guest Agent</strong> via libvirt commands such as <strong>guest-fsfreeze-freeze</strong></li><li>The guest agent translates these commands to OS-specific calls:<ul><li><strong>Linux systems</strong>: Uses <strong>fsfreeze</strong> syscalls</li><li><strong>Windows systems</strong>: Uses <strong>VSS</strong> (Volume Shadow Copy Service) APIs</li></ul></li></ul></li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="common-configuration-challenges">Common Configuration Challenges<a class="hash-link" href="#common-configuration-challenges" title="Direct link to heading">​</a></h3><p>Based on Harvester project experience, some guest operating systems require additional configuration:</p><ul><li><strong>Linux distributions</strong> (e.g., RHEL, SLE Micro): May lack sufficient permissions for filesystem freeze operations by default, requiring custom policies</li><li><strong>Windows guests</strong>: Require the <strong>VSS</strong> service to be enabled for filesystem freeze functionality</li></ul><blockquote><p><strong>Important</strong>: Filesystem freeze/thaw functionality depends on guest VM configuration, which is outside Harvester's control. Users are responsible for ensuring compatibility before implementing Velero backup hooks with filesystem freeze.</p></blockquote><h3 class="anchor anchorWithStickyNavbar_mojV" id="verifying-filesystem-freeze-compatibility">Verifying Filesystem Freeze Compatibility<a class="hash-link" href="#verifying-filesystem-freeze-compatibility" title="Direct link to heading">​</a></h3><p>To confirm that your VM supports filesystem freeze operations:</p><ol><li><p>Access the virtual machine's virt-launcher <code>compute</code> container:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token assign-left variable" style="color:#36acaa">POD</span><span class="token operator" style="color:#393A34">=</span><span class="token variable" style="color:#36acaa">$(</span><span class="token variable" style="color:#36acaa">kubectl get pods -n </span><span class="token variable operator" style="color:#393A34">&lt;</span><span class="token variable" style="color:#36acaa">VM Namespace</span><span class="token variable operator" style="color:#393A34">&gt;</span><span class="token variable" style="color:#36acaa"> </span><span class="token variable punctuation" style="color:#393A34">\</span><span class="token variable" style="color:#36acaa"></span><br></span><span class="token-line" style="color:#393A34"><span class="token variable" style="color:#36acaa">  -l vm.kubevirt.io/name</span><span class="token variable operator" style="color:#393A34">=</span><span class="token variable operator" style="color:#393A34">&lt;</span><span class="token variable" style="color:#36acaa">VM Name</span><span class="token variable operator" style="color:#393A34">&gt;</span><span class="token variable" style="color:#36acaa"> </span><span class="token variable punctuation" style="color:#393A34">\</span><span class="token variable" style="color:#36acaa"></span><br></span><span class="token-line" style="color:#393A34"><span class="token variable" style="color:#36acaa">  -o </span><span class="token variable assign-left variable" style="color:#36acaa">jsonpath</span><span class="token variable operator" style="color:#393A34">=</span><span class="token variable string" style="color:#e3116c">'{.items[0].metadata.name}'</span><span class="token variable" style="color:#36acaa">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl </span><span class="token builtin class-name">exec</span><span class="token plain"> -it </span><span class="token variable" style="color:#36acaa">$POD</span><span class="token plain"> -n default -c compute -- </span><span class="token function" style="color:#d73a49">bash</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Test filesystem freeze using the <a href="https://github.com/kubevirt/kubevirt/blob/main/docs/freeze.md#virt-freezer" target="_blank" rel="noopener noreferrer">virt-freezer</a> application available in the <code>compute</code> container:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-freezer --freeze --namespace </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">VM namespace</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> --name </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">VM name</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p><strong>Critical</strong>: Always verify the freeze operation result and thaw the VM filesystems before performing any other operations</p></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="prerequisites">Prerequisites<a class="hash-link" href="#prerequisites" title="Direct link to heading">​</a></h2><p>All preparation steps outlined in <a href="https://harvesterhci.io/kb/2025/05/26/velero-backup-restore" target="_blank" rel="noopener noreferrer">External CSI Storage Backup and Restore With Velero</a> are mandatory, including:</p><ul><li>Harvester installation and configuration</li><li>Velero installation and setup</li><li>S3-compatible storage configuration</li><li>Proper networking and permissions</li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="implementing-filesystem-freeze-hooks-for-vm-backup-consistency">Implementing Filesystem Freeze Hooks for VM Backup Consistency<a class="hash-link" href="#implementing-filesystem-freeze-hooks-for-vm-backup-consistency" title="Direct link to heading">​</a></h2><p>Velero supports pre and post backup hooks that can be integrated with KubeVirt's <strong>virt-freezer</strong> to ensure filesystem consistency during VM backups.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="configuring-vm-template-annotations">Configuring VM Template Annotations<a class="hash-link" href="#configuring-vm-template-annotations" title="Direct link to heading">​</a></h3><p>For all VMs requiring data consistency, add the following annotations to the VM template:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> kubevirt.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VirtualMachine</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vm</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">nfs</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> demo</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># These annotations will be applied to the virt-launcher pod</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">pre.hook.backup.velero.io/command</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'["/usr/bin/virt-freezer", "--freeze", "--namespace", "&lt;VM Namespace&gt;", "--name", "&lt;VM Name&gt;"'</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain">'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">pre.hook.backup.velero.io/container</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> compute</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">pre.hook.backup.velero.io/on-error</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Fail</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">pre.hook.backup.velero.io/timeout</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 30s</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">post.hook.backup.velero.io/command</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'["/usr/bin/virt-freezer", "--unfreeze", "--namespace", "&lt;VM Namespace&gt;", "--name", "&lt;VM Name&gt;"]'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">post.hook.backup.velero.io/container</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> compute</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">post.hook.backup.velero.io/timeout</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 30s</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token comment" style="color:#999988;font-style:italic"># ...rest of VM spec...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>These annotations will be propagated to the related virt-launcher pod and instruct Velero to:</p><ul><li><strong>Freeze</strong> the VM filesystem before backup creation begins</li><li><strong>Thaw</strong> the VM filesystem after backup completion</li></ul><p><strong>Important</strong>: Replace <code>&lt;VM Namespace&gt;</code> and <code>&lt;VM Name&gt;</code> with the actual namespace and name of your VM.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="creating-a-velero-backup-with-filesystem-freeze">Creating a Velero Backup with Filesystem Freeze<a class="hash-link" href="#creating-a-velero-backup-with-filesystem-freeze" title="Direct link to heading">​</a></h2><p>After applying the <a href="#configuring-vm-template-annotations">Velero pre/post hook annotations to the VM manifest</a>, follow the <a href="https://harvesterhci.io/kb/2025/05/26/velero-backup-restore/#backup-the-source-namespace" target="_blank" rel="noopener noreferrer">backup procedures</a> described in <a href="https://harvesterhci.io/kb/2025/05/26/velero-backup-restore/" target="_blank" rel="noopener noreferrer">External CSI Storage Backup and Restore With Velero</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="verifying-successful-hook-execution">Verifying Successful Hook Execution<a class="hash-link" href="#verifying-successful-hook-execution" title="Direct link to heading">​</a></h3><p>If the guest VM is configured correctly, the Velero backup will complete successfully with <strong>HooksAttempted</strong> indicating successful hook execution.</p><p>Check the backup status using:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero backup describe [Backup Name] --details</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Example output showing successful hook execution:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">Name:         demo</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Namespace:    velero</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Labels:       velero.io/storage-location=default</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Annotations:  velero.io/resource-timeout=10m0s</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              velero.io/source-cluster-k8s-gitversion=v1.33.3+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              velero.io/source-cluster-k8s-major-version=1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              velero.io/source-cluster-k8s-minor-version=33</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Phase:  Completed</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Namespaces:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Included:  demo</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Excluded:  &lt;none&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Resources:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Included:        *</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Excluded:        &lt;none&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Cluster-scoped:  auto</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Label selector:  &lt;none&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Or label selector:  &lt;none&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Storage Location:  default</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Velero-Native Snapshot PVs:  auto</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Snapshot Move Data:          true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Data Mover:                  velero</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">....</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Backup Volumes:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Velero-Native Snapshots: &lt;none included&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  CSI Snapshots:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    demo/vm-nfs-disk-0-au2ej:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      Data Movement:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        Operation ID: du-be5417aa-498e-4b93-b59f-e6498f95a6df.d7f97dab-3bb1-41e189381</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        Data Mover: velero</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        Uploader Type: kopia</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        Moved data Size (bytes): 5368709120</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        Result: succeeded</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Pod Volume Backups: &lt;none included&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">HooksAttempted:  2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">HooksFailed:     0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The output shows that Velero pre/post backup hooks completed successfully. In this case, the hooks are connected to guest VM filesystem freeze and thaw operations to ensure data consistency.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="restoring-the-velero-backup">Restoring the Velero Backup<a class="hash-link" href="#restoring-the-velero-backup" title="Direct link to heading">​</a></h2><p>Follow the restoration procedures described in <a href="https://harvesterhci.io/kb/2025/05/26/velero-backup-restore/#restore-to-a-different-namespace" target="_blank" rel="noopener noreferrer">External CSI Storage Backup and Restore With Velero</a> to restore the namespace using Velero.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="troubleshooting">Troubleshooting<a class="hash-link" href="#troubleshooting" title="Direct link to heading">​</a></h2><p>If you encounter issues with filesystem freeze operations:</p><ol><li><strong>Verify QEMU Guest Agent status</strong> in the VMI</li><li><strong>Check guest OS configuration</strong> for filesystem freeze support</li><li><strong>Review Velero hook logs</strong> for specific error messages</li><li><strong>Test virt-freezer manually</strong> as described in the verification section</li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="conclusion">Conclusion<a class="hash-link" href="#conclusion" title="Direct link to heading">​</a></h2><p>Implementing filesystem freeze hooks with Velero ensures data consistency during VM backups by quiescing the filesystem before snapshot creation. This approach is particularly valuable for VMs with high I/O activity or critical data that requires point-in-time consistency guarantees.</p>]]></content:encoded>
            <category>backup</category>
            <category>csi</category>
            <category>storage</category>
            <category>velero</category>
            <category>filesystem-freeze</category>
        </item>
        <item>
            <title><![CDATA[Setting up a common CPU model for virtual machine migration]]></title>
            <link>https://harvesterhci.io/kb/setup_common_cpu_model_for_vm_live_migration</link>
            <guid>setup_common_cpu_model_for_vm_live_migration</guid>
            <pubDate>Tue, 30 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How to set up a common CPU model for virtual machine migration]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="problem-description">Problem Description<a class="hash-link" href="#problem-description" title="Direct link to heading">​</a></h2><p>For Harvester to successfully migrate a virtual machine from one node to another, the source and target nodes must have compatible CPU models and features.</p><p>Harvester uses KubeVirt / QEMU / libvirt to manage and run virtual machines. When a VM starts, libvirt exposes a specific CPU feature set to the guest operating system. Live migration requires this CPU feature set to be identical on both source and target nodes.</p><p>Different CPU generations support different instruction sets and feature flags. If those differ, the live migration will be blocked to avoid instability or incorrect execution on the target node.</p><p>If the CPU model of a virtual machine isn't specified, KubeVirt assigns it the default <code>host-model</code> configuration so that the virtual machine has the CPU model closest to the one used on the host node.</p><p>KubeVirt automatically <a href="https://kubevirt.io/user-guide/compute/virtual_hardware/#labeling-nodes-with-cpu-models-cpu-features-and-machine-types" target="_blank" rel="noopener noreferrer">adjusts the node selectors</a> of the associated <code>virt-launcher</code> Pod based on this configuration. If the CPU models and features of the source and target nodes do not match, the live migration may fail.</p><p>Let's examine an example.</p><p>When a virtual machine is first migrated to another node with the <code>SierraForest</code> CPU model, the following key-value pairs are added to the <code>spec.nodeSelector</code> field in the Pod spec.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">cpu-model-migration.node.kubevirt.io/SierraForest</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/fpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/vme</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The above <code>nodeSelector</code> configuration is retained for subsequent migrations, which may fail if the new target node doesn't have the corresponding features or model.</p><p>For example, compare the CPU model and feature labels added by KubeVirt to the following two nodes:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Node A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-model-migration.node.kubevirt.io/SierraForest</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/fpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/vme</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Node B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-model-migration.node.kubevirt.io/SierraForest</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/vme</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This virtual machine will fail to migrate to Node B due to the missing <code>fpu</code> feature. However, if the virtual machine doesn't actually require this feature, this can be frustrating. Therefore, setting up a common CPU model can resolve this issue.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-set-up-a-common-cpu-model">How to Set Up a Common CPU Model<a class="hash-link" href="#how-to-set-up-a-common-cpu-model" title="Direct link to heading">​</a></h2><p>You can define a custom CPU model to ensure that the <code>spec.nodeSelector</code> configuration in the Pod spec is assigned a CPU model that is compatible and common to all nodes in the cluster.</p><p>Consider this example.</p><p>We have the following node information: </p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Node A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-model.node.kubevirt.io/IvyBridge</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/fpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/vme</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Node B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-model.node.kubevirt.io/IvyBridge</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cpu-feature.node.kubevirt.io/vme</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If we set up <code>IvyBridge</code> as our CPU model in the virtual machine spec, KubeVirt only adds <code>cpu-model.node.kubevirt.io/IvyBridge</code> under <code>spec.nodeSelector</code> in the Pod spec.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Virtual Machine Spec</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">domain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">cpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> IvyBridge</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Pod spec</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">cpu-model.node.kubevirt.io/IvyBridge</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>With this configuration, your virtual machine can be migrated to any node that has the label <code>cpu-model.node.kubevirt.io/IvyBridge</code>.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="understanding-cpu-model-options-in-harvester">Understanding CPU Model Options in Harvester<a class="hash-link" href="#understanding-cpu-model-options-in-harvester" title="Direct link to heading">​</a></h2><p>Harvester allows the CPU model to be defined in the VM specification.</p><p>If <code>host-passthrough</code> is used, the VM exposes the exact host CPU to the guest. This provides maximum performance but completely prevents migration across different CPU generations.</p><p>If <code>host-model</code> is used, the VM derives a CPU model based on the host’s capabilities. This works only when all nodes expose identical CPU features. In mixed clusters, this setting commonly causes migration failures.</p><p>If an explicit CPU model is defined, the VM exposes a named CPU architecture defined by QEMU. This is the recommended approach for clusters that may contain different CPU generations.
For mixed environments, an explicit CPU model should always be used.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="choosing-a-cpu-model-for-live-migration">Choosing a CPU Model for Live Migration<a class="hash-link" href="#choosing-a-cpu-model-for-live-migration" title="Direct link to heading">​</a></h2><p>When selecting a CPU model, the goal is to choose the highest common denominator. This means the most modern CPU architecture that every node in the cluster supports. Pick a model supported by all nodes in your cluster, including the oldest CPU generation. Use a server-grade model that provides a reasonable set of capabilities (e.g., vector instructions, security features) without tying VMs to host-specific features. Use the same model on all VMs that need live migration.</p><p>Below are practical examples for common enterprise hardware combinations.</p><p>For a cluster that mixes Cascade Lake and Sapphire Rapids, the recommended CPU model is <code>Cascadelake-Server</code>. Sapphire Rapids processors are backward compatible with Cascade Lake instructions, making <code>Cascadelake-Server</code> the highest common denominator between these two generations.</p><p>For a cluster that mixes Skylake and Cascade Lake nodes, the appropriate model is <code>Skylake-Server</code>. This is the common ground between both generations. Cascade Lake includes additional AVX-512 optimizations, but using Skylake ensures compatibility across the entire cluster.</p><p>If your cluster contains Broadwell nodes along with anything newer, the safest baseline is <code>Broadwell</code>. Broadwell serves as a stable and widely supported baseline for older enterprise hardware. Any newer CPUs will support it.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="set-up-cluster-wide-configuration">Set Up Cluster-Wide Configuration<a class="hash-link" href="#set-up-cluster-wide-configuration" title="Direct link to heading">​</a></h2><p>If your virtual machines run only on a specific CPU model, you can set up a cluster-wide CPU model in the <code>kubevirt</code> resource.</p><p>You can edit it with <code>kubectl edit kubevirt kubevirt -n harvester-system</code>, then add the CPU model you want in the following spec:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">configuration</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">cpuModel</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> IvyBridge</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Then, when a new virtual machine starts or an existing virtual machine restarts, the cluster-wide setting will be applied. The system follows these priorities when using CPU models if you configure them in both locations:</p><ol><li>CPU model in the virtual machine spec.</li><li>CPU model in the KubeVirt spec.</li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://docs.harvesterhci.io/v1.6/vm/live-migration/#cpu-model-matching" target="_blank" rel="noopener noreferrer">CPU Model Matching</a></li><li><a href="https://www.qemu.org/docs/master/system/qemu-cpu-models.html" target="_blank" rel="noopener noreferrer">QEMU / KVM CPU model configuration</a></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>virtual machine</category>
            <category>VM</category>
            <category>live migration</category>
            <category>policy</category>
            <category>strategy</category>
            <category>configuration</category>
        </item>
        <item>
            <title><![CDATA[How to create an SSH user for Harvester nodes]]></title>
            <link>https://harvesterhci.io/kb/how_to_create_ssh_user</link>
            <guid>how_to_create_ssh_user</guid>
            <pubDate>Tue, 16 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How to create an SSH user for Harvester nodes]]></description>
            <content:encoded><![CDATA[<p>We have the default SSH user <code>rancher</code>, but other users may be required. Creating users with <code>useradd</code> will result in their deletion upon restarting the Harvester node; therefore, follow the steps below to create persistent SSH users.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="public-key-authentication">Public Key Authentication<a class="hash-link" href="#public-key-authentication" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="create-cloud-inityaml">Create cloud-init.yaml<a class="hash-link" href="#create-cloud-inityaml" title="Direct link to heading">​</a></h3><p>Create <code>cloud-init.yaml</code> with the following content.</p><ul><li>Modify the <code>matchSelector</code> if you want to create an SSH user only on specific nodes.</li><li><code>#cloud-config</code> should be written exactly as shown.</li><li>User must be in the <code>admin</code> group.</li><li>Specify the public key in <code>ssh_authorized_keys</code>.</li><li>Modify the <code>contents</code> according to your environment.</li></ul><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> add</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">test</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">user</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">matchSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic"># applies to all nodes</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">filename</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 99_add_test_user.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    #cloud-config</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    users:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      - name: test-user</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        gecos: "admin_user"</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        groups: [users, admin]</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        sudo: ALL=(ALL) NOPASSWD:ALL</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        shell: /bin/bash</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        ssh_authorized_keys:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        - ssh-rsa AAAA.... # &lt;--insert full authorized key here, e.g. from your ~/.ssh/id_rsa.pub file</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="password-authentication">Password Authentication<a class="hash-link" href="#password-authentication" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="create-password-hash">Create password hash<a class="hash-link" href="#create-password-hash" title="Direct link to heading">​</a></h3><p>Use the following command to create a password hash. Replace <code>test</code> with your actual password.</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ openssl </span><span class="token function" style="color:#d73a49">passwd</span><span class="token plain"> -6 </span><span class="token string" style="color:#e3116c">'test'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token variable" style="color:#36acaa">$6</span><span class="token variable" style="color:#36acaa">$zF26pcXOS2eaivX8</span><span class="token variable" style="color:#36acaa">$6ySoTzQC2cToz29mGFC0DuG5cVWTv3Mktc3k</span><span class="token plain">/g1KXTtrG2BhsFh8xs3N0zBmNx0D/H4f1W48a45vI1RK8Rzs.0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="create-cloud-inityaml-1">Create cloud-init.yaml<a class="hash-link" href="#create-cloud-inityaml-1" title="Direct link to heading">​</a></h3><p>Create <code>cloud-init.yaml</code> with the following content.</p><ul><li>Modify the <code>matchSelector</code> if you want to create an SSH user only on specific nodes.</li><li><code>#cloud-config</code> should be written exactly as shown.</li><li>User must be in the <code>admin</code> group.</li><li>Specify the hash created earlier in <code>passwd</code>.</li><li>Modify the <code>contents</code> according to your environment.</li></ul><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> add</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">test</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">user</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">matchSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic"># applies to all nodes</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">filename</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 99_add_test_user.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    #cloud-config</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    users:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      - name: test-user</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        gecos: "admin_user"</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        groups: [users, admin]</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        sudo: ALL=(ALL) NOPASSWD:ALL</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        shell: /bin/bash</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        lock_passwd: false</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        passwd: $6$zF26pcXOS2eaivX8$6ySoTzQC2cToz29mGFC0DuG5cVWTv3Mktc3k/g1KXTtrG2BhsFh8xs3N0zBmNx0D/H4f1W48a45vI1RK8Rzs.0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="apply-the-yaml-file">Apply the YAML file<a class="hash-link" href="#apply-the-yaml-file" title="Direct link to heading">​</a></h2><p>Apply the YAML with this command.</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f cloud-init.yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Trailing file will be created.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ cat /oem/99_add_test_user.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">#cloud-config</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">users</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> test</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">user</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">gecos</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"admin_user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">groups</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> users</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> admin</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">sudo</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ALL=(ALL) NOPASSWD</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">ALL</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">shell</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /bin/bash</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="reboot-harvester-nodes">Reboot Harvester nodes<a class="hash-link" href="#reboot-harvester-nodes" title="Direct link to heading">​</a></h2><ol><li>Run <code>Enable Maintenance Mode</code> on the Harvester UI.</li><li>Wait until the state changes to <code>Maintenance</code>.</li><li>Reboot the Harvester node.</li><li>Run <code>Disable Maintenance Mode</code> on the Harvester UI.</li></ol><p>After that, SSH login will be possible.</p><p>Tested on: Harvester 1.6.0, 1.5.1.</p>]]></content:encoded>
            <category>configuration</category>
            <category>network</category>
        </item>
        <item>
            <title><![CDATA[Force Reschedule Non-Ready Virtual Machines During Node Outage]]></title>
            <link>https://harvesterhci.io/kb/force_reschedule_non_ready_virtual_machines_during_node_outage</link>
            <guid>force_reschedule_non_ready_virtual_machines_during_node_outage</guid>
            <pubDate>Mon, 08 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Force reschedule non-Ready virtual machines during node outage]]></description>
            <content:encoded><![CDATA[<p>If a Harvester node becomes unreachable, Harvester attempts to reschedule its virtual machines to another healthy node. However, this rescheduling doesn't happen immediately. The associated <code>virt-launcher</code> pods may continue to appear to remain in the ready state due to its KubeVirt readiness gate configuration.</p><p>To mitigate this elapsed time, you can modify the <a href="https://docs.harvesterhci.io/latest/advanced/index#vm-force-reset-policy" target="_blank" rel="noopener noreferrer"><code>vm-force-reset-policy</code> setting</a>, by reducing its <code>period</code> value. This enables Harvester to detect non-ready virtual machines on unreachable nodes sooner.</p><p>This setting can be found in the <code>Advanced</code> -&gt; <code>Settings</code> page on the Harvester UI.</p><p><img loading="lazy" alt="image" src="/assets/images/vm-force-reset-policy-a4f246fe59d281ccbe9011c3a83fc228.png" width="853" height="470"></p><p>Additionally, while the current default is 5 minutes, we are considering reducing the default value <!-- -->[1]<!-- -->.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><p>[1]<!-- --> <a href="https://github.com/harvester/harvester/issues/8971" target="_blank" rel="noopener noreferrer">https://github.com/harvester/harvester/issues/8971</a></p>]]></content:encoded>
            <category>configuration</category>
            <category>migration</category>
        </item>
        <item>
            <title><![CDATA[Handling Disks That Don't Appear in the Harveser GUI]]></title>
            <link>https://harvesterhci.io/kb/handle_disks_without_wwns</link>
            <guid>handle_disks_without_wwns</guid>
            <pubDate>Wed, 09 Jul 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How to add extra disks to Harvester when they have no WWN and thus do not appear in the list of available disks in the Harvester GUI]]></description>
            <content:encoded><![CDATA[<p>Harvester allows you to <a href="https://docs.harvesterhci.io/v1.5/host/#add-additional-disks" target="_blank" rel="noopener noreferrer">add disks</a> as data volumes. However, only disks that have a <a href="https://en.wikipedia.org/wiki/World_Wide_Name" target="_blank" rel="noopener noreferrer">World Wide Name (WWN)</a> are displayed on the UI. This occurs because the Harvester <a href="https://github.com/harvester/node-disk-manager" target="_blank" rel="noopener noreferrer"><code>node-disk-manager</code></a> uses the <code>ID_WWN</code> value from udev to uniquely identify disks. The value may not exist in certain situations, particularly when the disks are connected to certain hardware RAID controllers. In these situations, you can view the disks only if you access the host using SSH and run a command such as <code>cat /proc/partitions</code>.</p><p>To allow extra disks without WWNs to be visible to Harvester, perform either of the following workarounds:</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="workaround-1-create-a-filesystem-on-the-disk">Workaround 1: Create a filesystem on the disk<a class="hash-link" href="#workaround-1-create-a-filesystem-on-the-disk" title="Direct link to heading">​</a></h2><div class="admonition admonition-caution alert alert--warning"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</h5></div><div class="admonition-content"><p>Use this method only if the provisioner of the extra disk is <strong>Longhorn V1</strong>, which is filesystem-based. This method <em>will not work correctly</em> with <strong>LVM</strong> and <strong>Longhorn V2</strong>, which are both block device-based.</p></div></div><p>When you create a filesystem on a disk (for example, using the command <code>mkfs.ext4 /dev/sda</code>), a filesystem UUID is assigned to the disk. Harvester uses this value to identify disks without a WWN.</p><p>In Harvester versions earlier than v1.6.0, you can use this workaround for only <em>one extra disk</em> because of a <a href="https://github.com/harvester/harvester/issues/7173" target="_blank" rel="noopener noreferrer">bug in duplicate device checking</a>.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="workaround-2-add-a-udev-rule-for-generating-fake-wwns">Workaround 2: Add a udev rule for generating fake WWNs<a class="hash-link" href="#workaround-2-add-a-udev-rule-for-generating-fake-wwns" title="Direct link to heading">​</a></h2><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>This method works with all of the supported provisioners.</p></div></div><p>You can add a udev rule that generates a fake WWN for each extra disk based on the device serial number. Harvester accepts the generated WWNs because the only requirement is a unique <code>ID_WWN</code> value as presented by udev.</p><p>A YAML file containing the necessary udev rule must be created in the <code>/oem</code> directory on each host. This process can be automated across the Harvester cluster using a <a href="https://docs.harvesterhci.io/v1.5/host/#creating-a-cloudinit-resource" target="_blank" rel="noopener noreferrer">CloudInit Resource</a>.</p><ol><li><p>Create a YAML file named <code>fake-scsi-wwn-generator.yaml</code> with the following contents:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> fake</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">scsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">wwn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">generator</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">matchSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">filename</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 90_fake_scsi_wwn_generator.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    name: "Add udev rules to generate missing SCSI disk WWNs"</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    stages:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      initramfs:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">        - files:</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            - path: /etc/udev/rules.d/59-fake-scsi-wwn-generator.rules</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              permissions: 420</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              owner: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              group: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              content: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # For anything that looks like a SCSI disk (/dev/sd*),</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # if it has a serial number, but does _not_ have a WWN,</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # create a fake WWN based on the serial number.  We need</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # to set both ID_WWN so Harvester's node-disk-manager</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # can see the WWN, and ID_WWN_WITH_EXTENSION which is</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # what 60-persistent-storage.rules uses to generate a</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                # /dev/disk/by-id/wwn-* symlink for the device.</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="sd*[!0-9]", \</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                  ENV{ID_SERIAL}=="?*", \</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                  ENV{ID_WWN}!="?*", ENV{ID_WWN_WITH_EXTENSION}!="?*", \</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                  ENV{ID_WWN}="fake.$env{ID_SERIAL}", \</span><br></span><span class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">                  ENV{ID_WWN_WITH_EXTENSION}="fake.$env{ID_SERIAL}"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Apply the file's contents to the cluster by running the command <code>kubectl apply -f fake-scsi-wwn-generator.yaml</code>.</p><p>The file <code>/oem/90_fake_scsi_wwn_generator.yaml</code> is automatically created on all cluster nodes.</p></li><li><p>Reboot all nodes to apply the new udev rule.</p></li></ol><p>Once the rule is applied, you should be able to view and add extra disks that were previously not visible on the Harvester UI.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li>Harvester: <a href="https://github.com/harvester/harvester/issues/7173" target="_blank" rel="noopener noreferrer">Issue 7173</a></li></ul>]]></content:encoded>
            <category>storage</category>
            <category>disk</category>
        </item>
        <item>
            <title><![CDATA[External CSI Storage Backup and Restore With Velero]]></title>
            <link>https://harvesterhci.io/kb/2025/05/26/velero-backup-restore</link>
            <guid>/2025/05/26/velero-backup-restore</guid>
            <pubDate>Mon, 26 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Learn how to back up and restore external CSI volumes in Harvester using Velero.]]></description>
            <content:encoded><![CDATA[<p>Harvester 1.5 introduces support for the provisioning of virtual machine root volumes and data volumes using external Container Storage Interface (CSI) drivers.</p><p>This article demonstrates how to use <a href="https://velero.io" target="_blank" rel="noopener noreferrer">Velero 1.16.0</a> to perform backup and restore of virtual machines in Harvester.</p><p>It goes through commands and manifests to:</p><ul><li>Back up virtual machines in a namespace, their NFS CSI volumes, and associated namespace-scoped configuration</li><li>Export the backup artifacts to an AWS S3 bucket</li><li>Restore to a different namespace on the same cluster</li><li>Restore to a different cluster</li></ul><p>Velero is a Kubernetes-native backup and restore tool that enables users to perform scheduled and on-demand backups of virtual machines to external object storage providers such as S3, Azure Blob, or GCS, aligning with enterprise backup and disaster recovery practices.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>The commands and manifests used in this article are tested with Harvester 1.5.1.</p><p>The CSI NFS driver and Velero configuration and versions used are for demonstration purposes only. Adjust them according to your environment and requirements.</p></div></div><div class="admonition admonition-important alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>The examples provided are intended to backup and restore Linux virtual machine workloads. It is not suitable for backing up guest clusters provisioned via the <a href="https://docs.harvesterhci.io/v1.5/rancher/rancher-integration" target="_blank" rel="noopener noreferrer">Harvester Rancher integration</a>.</p><p>To backup and restore guest clusters like RKE2, please refer to the distro <a href="https://docs.rke2.io/datastore/backup_restore" target="_blank" rel="noopener noreferrer">official documentation</a>.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="harvester-installation">Harvester Installation<a class="hash-link" href="#harvester-installation" title="Direct link to heading">​</a></h2><p>Refer to the <a href="https://docs.harvesterhci.io/v1.6/install/requirements" target="_blank" rel="noopener noreferrer">Harvester documentation</a> for installation requirements and options.</p><p>The kubeconfig file of the Harvester cluster can be retrieved following the instructions <a href="https://docs.harvesterhci.io/v1.6/faq/#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster" target="_blank" rel="noopener noreferrer">here</a>.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="install-and-configure-velero">Install and Configure Velero<a class="hash-link" href="#install-and-configure-velero" title="Direct link to heading">​</a></h2><p>Download the <a href="https://velero.io/docs/v1.16/basic-install/#install-the-cli" target="_blank" rel="noopener noreferrer">Velero CLI</a>.</p><p>Set the following shell variables:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BUCKET_NAME=&lt;your-s3-bucket-name&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">BUCKET_REGION=&lt;your-s3-bucket-region&gt;</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AWS_CREDENTIALS_FILE=&lt;absolute-path-to-your-aws-credentials-file&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Install Velero on the Harvester cluster:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero install \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --provider aws \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --features=EnableCSI \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --plugins "velero/velero-plugin-for-aws:v1.12.0,quay.io/kubevirt/kubevirt-velero-plugin:v0.7.1" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --bucket "${BUCKET_NAME}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --secret-file "${AWS_CREDENTIALS_FILE}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --backup-location-config region="${BUCKET_REGION}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --snapshot-location-config region="${BUCKET_REGION}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --use-node-agent</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ul><li><p>In this setup, Velero is configured to:</p><ul><li>Run in the <code>velero</code> namespace</li><li>Enable CSI volume snapshot APIs</li><li>Enable the built-in node agent data movement controllers and pods</li><li>Use the <code>velero-plugin-for-aws</code> plugin to manage interactions with the S3 object store</li><li>Use the <code>kubevirt-velero-plugin</code> plugin to backup and restore KubeVirt resources</li></ul></li></ul><p>Confirm that Velero is installed and running:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n velero get po</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                      READY   STATUS    RESTARTS         AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">node-agent-875mr          1/1     Running   0                1d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">velero-745645565f-5dqgr   1/1     Running   0                1d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Configure the <code>velero</code> CLI to output the backup and restore status of CSI objects:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero client config set features=EnableCSI</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="deploy-the-nfs-csi-and-example-server">Deploy the NFS CSI and Example Server<a class="hash-link" href="#deploy-the-nfs-csi-and-example-server" title="Direct link to heading">​</a></h2><p>Follow the instructions in the <a href="https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/example/README.md" target="_blank" rel="noopener noreferrer">NFS CSI documentation</a> to set up the NFS CSI driver, its storage class, and an example NFS server.</p><p>The NFS CSI volume snapshotting capability must also be enabled following the instructions <a href="https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/example/snapshot" target="_blank" rel="noopener noreferrer">here</a>.</p><p>Confirm that the NFS CSI and example server are running:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get po -A -l 'app in (csi-nfs-node,csi-nfs-controller,nfs-server)'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE     NAME                                  READY   STATUS    RESTARTS    AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default       nfs-server-b767db8c8-9ltt4            1/1     Running   0           1d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system   csi-nfs-controller-5bf646f7cc-6vfxn   5/5     Running   0           1d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system   csi-nfs-node-9z6pt                    3/3     Running   0           1d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The default NFS CSI storage class is named <code>nfs-csi</code>:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get sc nfs-csi</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME      PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">nfs-csi   nfs.csi.k8s.io   Delete          Immediate           true                   14d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Confirm that the default NFS CSI volume snapshot class <code>csi-nfs-snapclass</code> is also installed:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get volumesnapshotclass csi-nfs-snapclass</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                DRIVER           DELETIONPOLICY   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">csi-nfs-snapclass   nfs.csi.k8s.io   Delete           14d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="preparing-the-virtual-machine-and-image">Preparing the Virtual Machine and Image<a class="hash-link" href="#preparing-the-virtual-machine-and-image" title="Direct link to heading">​</a></h2><p>Create a custom namespace named <code>demo-src</code>:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl create ns demo-src</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Follow the instructions in the <a href="https://docs.harvesterhci.io/v1.5/image/upload-image/#upload-images-via-url" target="_blank" rel="noopener noreferrer">Image Management</a> documentation to upload the Ubuntu 24.04 raw image from <a href="https://cloud-images.ubuntu.com/minimal/releases/noble/" target="_blank" rel="noopener noreferrer">https://cloud-images.ubuntu.com/minimal/releases/noble/</a> to Harvester.</p><p>The storage class of the image must be set to <code>nfs-csi</code>, per the <a href="https://docs.harvesterhci.io/v1.5/advanced/csidriver#virtual-machine-image-creation" target="_blank" rel="noopener noreferrer">Third-Party Storage Support</a> documentation.</p><p>Confirm the virtual machine image is successfully uploaded to Harvester:</p><p><img loading="lazy" alt="image" src="/assets/images/vm-image-be04a349a0a77b446a65e83421a33795.png" width="1186" height="387"></p><p>Follow the instructions in the <a href="https://docs.harvesterhci.io/v1.5/advanced/csidriver#virtual-machine-creation" target="_blank" rel="noopener noreferrer">third-party storage</a> documentation to create a virtual machine with NFS root and data volumes, using the image uploaded in the previous step.</p><p>For NFS CSI snapshot to work, the NFS data volume must have the <code>volumeMode</code> set to <code>Filesystem</code>:
<img loading="lazy" alt="image" src="/assets/images/vm-create-8b898dcc70fdbdce16fe9b0c3af0998f.png" width="1222" height="892"></p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>optional</h5></div><div class="admonition-content"><p>For testing purposes, once the virtual machine is ready, access it via SSH and add some files to both the root and data volumes.</p><p>The data volume needs to be partitioned, with a file system created and mounted before files can be written to it.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="backup-the-source-namespace">Backup the Source Namespace<a class="hash-link" href="#backup-the-source-namespace" title="Direct link to heading">​</a></h2><p>Use the <code>velero</code> CLI to create a backup of the <code>demo-src</code> namespace using Velero's built-in data mover:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BACKUP_NAME=backup-demo-src-`date "+%s"`</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">velero backup create "${BACKUP_NAME}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --include-namespaces demo-src \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --snapshot-move-data</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>For more information on Velero's data mover, see its documentation on <a href="https://velero.io/docs/v1.16/csi-snapshot-data-movement/" target="_blank" rel="noopener noreferrer">CSI data snapshot movement capability</a>.</p></div></div><p>This creates a backup of the <code>demo-src</code> namespace containing resources like the virtual machine created earlier, its volumes, secrets and other associated configuration.</p><p>Depending on the size of the virtual machine and its volumes, the backup may take a while to complete.</p><p>The <code>DataUpload</code> custom resources provide insights into the backup progress:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n velero get datauploads -l velero.io/backup-name="${BACKUP_NAME}"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Confirm that the backup completed successfully:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero backup get "${BACKUP_NAME}"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                         STATUS      ERRORS   WARNINGS   CREATED                         EXPIRES   STORAGE LOCATION   SELECTOR</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">backup-demo-src-1747954979   Completed   0        0          2025-05-22 16:04:46 -0700 PDT   29d       default            &lt;none&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After the backup completes, Velero removes the CSI snapshots from the storage side to free up the snapshot data space.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>tips</h5></div><div class="admonition-content"><p>The <code>velero backup describe</code> and <code>velero backup logs</code> commands can be used to assess details of the backup including resources included, skipped, and any warnings or errors encountered during the backup process.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="restore-to-a-different-namespace">Restore To A Different Namespace<a class="hash-link" href="#restore-to-a-different-namespace" title="Direct link to heading">​</a></h2><p>This section describes how to restore the backup from the <code>demo-src</code> namespace to a new namespace named <code>demo-dst</code>.</p><p>Save the following restore modifier to a local file named <code>modifier-data-volumes.yaml</code>:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">cat &lt;&lt;EOF </span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"> modifier</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">data</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">volumes.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">resourceModifierRules</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">conditions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">groupResource</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> persistentvolumeclaims</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matches</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">path</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /metadata/annotations/harvesterhci.io~1volumeForVirtualMachine</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"\"true\""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">patches</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">operation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> remove</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">path</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /metadata/annotations/harvesterhci.io~1volumeForVirtualMachine</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This restore modifier removes the <code>harvesterhci.io/volumeForVirtualMachine</code> annotation from the virtual machine data volumes to ensure that the restoration do not conflict with the CDI volume import populator.</p><p>Create the restore modifier:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n velero create cm modifier-data-volumes --from-file=modifier-data-volumes.yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Assign the backup name to a shell variable:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BACKUP_NAME=backup-demo-src-1747954979</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Start the restore operation:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero restore create \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --from-backup "${BACKUP_NAME}" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --namespace-mappings "demo-src:demo-dst" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --exclude-resources "virtualmachineimages.harvesterhci.io" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --resource-modifier-configmap "modifier-data-volumes" \</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  --labels "velero.kubevirt.io/clear-mac-address=true,velero.kubevirt.io/generate-new-firmware-uuid=true"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ul><li><p>During the restore:</p><ul><li>The virtual machine MAC address and firmware UUID are reset to avoid potential conflicts with existing virtual machines.</li><li>the virtual machine image manifest is excluded because Velero restores the entire state of the virtual machine from the backup.</li><li>the <code>modifier-data-volumes</code> restore modifier is invoked to modify the virtual machine data volumes metadata to prevent conflicts with the CDI volume import populator.</li></ul></li></ul><p>While the restore operation is still in-progress, the <code>DataDownload</code> custom resources can be used to examine the progress of the operation:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">RESTORE_NAME=backup-demo-src-1747954979-20250522164015</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n velero get datadownload -l velero.io/restore-name="${RESTORE_NAME}"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Confirm that the restore completed successfully:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero restore get</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                                        BACKUP                       STATUS      STARTED                         COMPLETED                       ERRORS   WARNINGS   CREATED                         SELECTOR</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">backup-demo-src-1747954979-20250522164015   backup-demo-src-1747954979   Completed   2025-05-22 16:40:15 -0700 PDT   2025-05-22 16:40:49 -0700 PDT   0        6          2025-05-22 16:40:15 -0700 PDT   &lt;none&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Verify that the virtual machine and its configuration are restored to the new <code>demo-dst</code> namespace:</p><p><img loading="lazy" alt="image" src="/assets/images/vm-restore-94989b1b4a74e4234ab9b936a2fda44c.png" width="1179" height="499"></p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Velero uses <a href="https://kopia.io/" target="_blank" rel="noopener noreferrer">Kopia</a> as its default data mover. This <a href="https://github.com/kopia/kopia/issues/544#issuecomment-674536833" target="_blank" rel="noopener noreferrer">issue</a> describes some of its limitations on advanced file system features such as setuid/gid, hard links, mount points, sockets, xattr, ACLs, etc.</p><p>Velero provides the <code>--data-mover</code> option to configure custom data movers to satisfy different use cases. For more information, see the Velero's <a href="https://velero.io/docs/v1.16/csi-snapshot-data-movement/#customized-data-movers" target="_blank" rel="noopener noreferrer">documentation</a>.</p></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>tips</h5></div><div class="admonition-content"><p>The <code>velero restore describe</code> and <code>velero restore logs</code> commands provide more insights into the restore operation including the resources restored, skipped, and any warnings or errors encountered during the restore process.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="restore-to-a-different-cluster">Restore To A Different Cluster<a class="hash-link" href="#restore-to-a-different-cluster" title="Direct link to heading">​</a></h2><p>This section extends the above scenario to demonstrate the steps to restore the backup to a different Harvester cluster.</p><p>On the target cluster, install Velero, and set up the NFS CSI and NFS server following the instructions from the <a href="#deploy-the-nfs-csi-and-example-server">Deploy the NFS CSI and Example Server</a> section.</p><p>Once Velero is configured to use the same backup location as the source cluster, it automatically discovers the available backups:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">velero backup get</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                         STATUS      ERRORS   WARNINGS   CREATED                         EXPIRES   STORAGE LOCATION   SELECTOR</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">backup-demo-src-1747954979   Completed   0        0          2025-05-22 16:04:46 -0700 PDT   29d       default            &lt;none&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Follow the steps in the <a href="#restore-to-a-different-namespace">Restore To A Different Namespace</a> section to restore the backup on the target cluster.</p><p>Remove the <code>--namespace-mappings</code> option to set the restored namespace to <code>demo-src</code> on the target cluster.</p><p>Confirm that the virtual machine and its configuration are restored to the <code>demo-src</code> namespace:</p><p><img loading="lazy" alt="image" src="/assets/images/vm-migrate-0a67c95bf1846622c39f4eaa591e9261.png" width="1189" height="426"></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="select-longhorn-volume-snapshot-class">Select Longhorn Volume Snapshot Class<a class="hash-link" href="#select-longhorn-volume-snapshot-class" title="Direct link to heading">​</a></h2><p>To perform Velero backup and restore of virtual machines with Longhorn volumes, label the Longhorn volume snapshot class <code>longhorn</code> as follows:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl label volumesnapshotclass longhorn velero.io/csi-volumesnapshot-class</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This helps Velero to find the correct Longhorn snapshot class to use during backup and restore.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="limitations">Limitations<a class="hash-link" href="#limitations" title="Direct link to heading">​</a></h2><p>Enhancements related to the limitations described in this section are tracked at <a href="https://github.com/harvester/harvester/issues/8367" target="_blank" rel="noopener noreferrer">https://github.com/harvester/harvester/issues/8367</a>.</p><ul><li><p>By default, Velero only supports <a href="https://velero.io/docs/v1.16/resource-filtering/" target="_blank" rel="noopener noreferrer">resource filtering</a> by resource groups and labels. In order to backup/restore a single instance of virtual machine, custom labels must be applied to the virtual machine, and its virtual machine instance, pod, data volumes, persistent volumes claim, persistent volumes and <code>cloudinit</code> secret resources. It's recommended to backup the entire namespace and perform resource filtering during restore to ensure that backup contains all the dependency resources required by the virtual machine.</p></li><li><p>The restoration of virtual machine image is not fully supported yet.</p></li></ul>]]></content:encoded>
            <category>backup</category>
            <category>csi</category>
            <category>storage</category>
        </item>
        <item>
            <title><![CDATA[Using Pod Security Standards (PSS) in Harvester To Enforce Secure Workload Isolation]]></title>
            <link>https://harvesterhci.io/kb/2025/05/08/using-pod-security-standard</link>
            <guid>/2025/05/08/using-pod-security-standard</guid>
            <pubDate>Thu, 08 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[This article describes how to use Pod Security Standards (PSS) in Harvester.]]></description>
            <content:encoded><![CDATA[<p>Users wishing to prevent privilege escalation and other security issues can leverage Kubernetes' <a href="https://kubernetes.io/docs/concepts/security/pod-security-standards/" target="_blank" rel="noopener noreferrer">Pod Security Standards (PSS)</a> on Harvester. PSS are a set of security policies that can be applied to clusters and namespaces to control and restrict how workloads are executed.</p><p>Pod Security Standards in Harvester can be used when provisioning VM workloads and also with the new experimental support for running <a href="https://docs.harvesterhci.io/v1.5/rancher/rancher-integration#harvester-baremetal-container-workload-support-experimental" target="_blank" rel="noopener noreferrer">baremetal container workloads</a>.</p><p>The <code>baseline</code> policy is aimed at ease of adoption for common containerized workloads while preventing known privilege escalations. This policy is targeted at application operators and developers of non-critical applications.</p><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><p>VMs with device passthrough, such as <code>pcidevices</code>, <code>usbdevices</code> and <code>vgpudevices</code>, will fail to start with <code>baseline</code> policy, as they need <code>SYS_RESOURCE</code> capability. This is being tracked on issue <a href="https://github.com/harvester/harvester/issues/8218" target="_blank" rel="noopener noreferrer">#8218</a>. A fix should be available for this shortly.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="namespace-level-enablement">Namespace level enablement<a class="hash-link" href="#namespace-level-enablement" title="Direct link to heading">​</a></h3><p>To enable PSS a user simply needs to label their workload namespaces as follows:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl label --overwrite ns &lt;namespace&gt;  pod-security.kubernetes.io/enforce=baseline</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Do not apply PSS to the system's namespaces, as they need privileged permissions to manage cluster resources. Only trusted users must have access to system's namespaces.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="cluster-scoped-enablement">Cluster scoped enablement<a class="hash-link" href="#cluster-scoped-enablement" title="Direct link to heading">​</a></h3><p>Cluster wide PSS can be enabled by passing an Admission Control configuration via kube-apiserver arguments. This can be done via Harvester's <a href="https://docs.harvesterhci.io/v1.5/advanced/cloudinitcrd" target="_blank" rel="noopener noreferrer">CloudInit</a> using the following configuration which can be saved to <code>cloudinit-pss.yaml</code> file:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: node.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: CloudInit</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: cluster-wide-pss-enforcement</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  matchSelector:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    node-role.kubernetes.io/control-plane: "true"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  filename: 99-pss.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  contents: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    stages:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      initramfs:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        - name: "setup harvester pss"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          directories:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          - path: /etc/rancher/rke2/config</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            owner: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            group: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            permissions: 384</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          files:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          - content: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              kube-apiserver-arg:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                - "admission-control-config-file=/etc/rancher/rke2/config/harvester-pss.yaml"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            path: /etc/rancher/rke2/config.yaml.d/99-harvester-pss.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            permissions: 384</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            owner: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            group: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          - content: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              apiVersion: apiserver.config.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              kind: AdmissionConfiguration</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              plugins:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                - name: PodSecurity</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                  configuration:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    apiVersion: pod-security.admission.config.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    kind: PodSecurityConfiguration</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    defaults:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      enforce: "baseline"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      enforce-version: "latest"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      audit: "baseline"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      audit-version: "latest"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      warn: "baseline"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      warn-version: "latest"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    exemptions:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      usernames: []</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      runtimeClasses: []</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                      namespaces: [calico-apiserver,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   calico-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-alerting,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-csp-adapter-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-elemental-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-epinio-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-externalip-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-fleet-local-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-fleet-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-gatekeeper-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-global-data,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-global-nt,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-impersonation-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-istio,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-istio-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-logging,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-logging-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-monitoring-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-neuvector-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-prometheus,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-provisioning-capi-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-resources-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-sriov-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-ui-plugin-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cattle-windows-gmsa-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cert-manager,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   cis-operator-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   fleet-default,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   ingress-nginx,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   istio-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   kube-node-lease,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   kube-public,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   kube-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   longhorn-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   rancher-alerting-drivers,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   security-scan,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   tigera-operator,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   harvester-system,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   harvester-public,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                                   rancher-vcluster]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            path: /etc/rancher/rke2/config/harvester-pss.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            permissions: 384</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            owner: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            group: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  paused: false</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The cluster admin can apply this against the Harvester cluster using <code>kubectl apply -f cloudinit-pss.yaml</code>. The change requires a restart of the control plane nodes to ensure that the Elemental cloud-init directives are applied on boot. Once control plane nodes are rebooted, a default <code>baseline</code> pod security standard will be enforced against all current and subsequently created namespaces. The namespaces listed under exemptions will be skipped. Users are free to tweak the list, to better suit their use cases.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="security-considerations">Security considerations<a class="hash-link" href="#security-considerations" title="Direct link to heading">​</a></h3><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>For future integration of Pod Security Admission (PSA) configuration natively in Harvester, please verify the progress of issue <a href="https://github.com/harvester/harvester/issues/8196" target="_blank" rel="noopener noreferrer">#8196</a>.</p></div></div><p>Post application of a default PSS, end users, with permissions to create and edit namespaces, may still be able to override the respective policy by labeling their namespaces to support <code>privileged</code> workloads, for example, as follows:</p><p><code>kubectl label --overwrite ns &lt;namespace&gt; pod-security.kubernetes.io/enforce=privileged</code></p><p>To avoid this, we recommend users to create custom RBACs restricting who can create/update namespaces or to also deploy a <a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/" target="_blank" rel="noopener noreferrer">Validating Admission Policy</a>. The following policy will block namespace create/update requests containing a label <code>pod-security.kubernetes.io/enforce</code>, there by preventing namespace admins from changing the settings for their namespace.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: namespace-pss-label-rejection</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  failurePolicy: Fail</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  matchConstraints:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    resourceRules:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - apiGroups:   [""]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      apiVersions: ["v1"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      operations:  ["CREATE", "UPDATE"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      resources:   ["namespaces"]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  - expression: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      !("pod-security.kubernetes.io/enforce" in object.metadata.labels)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">---</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: admissionregistration.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: ValidatingAdmissionPolicyBinding</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: namespace-pss-label-rejection-binding</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  policyName: namespace-pss-label-rejection</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  validationActions: [Deny]</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>In case more tailored policies are needed, users can rely on security policy engines like <a href="https://www.kubewarden.io/" target="_blank" rel="noopener noreferrer">Kubewarden</a>'s policy <a href="https://artifacthub.io/packages/kubewarden/psa-label-enforcer/psa-label-enforcer" target="_blank" rel="noopener noreferrer"><code>PSA Label Enforcer</code></a>, or similar solution, to ensure that namespaces have the required PSS configuration for deployment in the cluster.</p>]]></content:encoded>
            <category>security</category>
        </item>
        <item>
            <title><![CDATA[CVE-2025-1974: ingress-nginx admission controller RCE escalation]]></title>
            <link>https://harvesterhci.io/kb/2025/03/25/cve-2025-1974</link>
            <guid>/2025/03/25/cve-2025-1974</guid>
            <pubDate>Tue, 25 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[This article describes the mitigation steps for the CVE-2025-1974 vulnerability in Harvester.]]></description>
            <content:encoded><![CDATA[<div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p><strong>CVE-2025-1974</strong> (vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) has a score of <a href="https://www.first.org/cvss/calculator/3-1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" target="_blank" rel="noopener noreferrer">9.8 (Critical)</a>.</p><p>The vulnerability affects specific versions of the RKE2 ingress-nginx controller (v.1.11.4 and earlier, and v1.12.0). All Harvester versions that use this controller (including v1.4.2 and earlier) are therefore affected.</p><p><strong>This CVE is fixed in Harvester 1.5.0, 1.4.3 and newer.</strong></p></div></div><p>A security issue was discovered in Kubernetes where under certain conditions, an unauthenticated attacker with access to the pod network can achieve arbitrary code execution in the context of the ingress-nginx controller. This can lead to disclosure of secrets accessible to the controller. (Note that in the default installation, the controller can access all secrets cluster-wide.)</p><p>You can confirm the version of the RKE2 ingress-nginx pods by running this command on your Harvester cluster:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n kube-system get po -l"app.kubernetes.io/name=rke2-ingress-nginx" -ojsonpath='{.items[].spec.containers[].image}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If the command returns one of the affected versions, disable the <code>rke2-ingress-nginx-admission</code> validating webhook configuration by performing the following steps:</p><ol><li><p>On one of your control plane nodes, use <code>kubectl</code> to confirm the existence of the <code>HelmChartConfig</code> resource named <code>rke2-ingress-nginx</code>:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl -n kube-system get helmchartconfig rke2-ingress-nginx</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME                 AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rke2-ingress-nginx   14d1h</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Use <code>kubectl -n kube-system edit helmchartconfig rke2-ingress-nginx</code> to add the following configurations to the resource:</p><ul><li><code>.spec.valuesContent.controller.admissionWebhooks.enabled: false</code></li><li><code>.spec.valuesContent.controller.extraArgs.enable-annotation-validation: true</code></li></ul></li><li><p>The following is an example of what the updated <code>.spec.valuesContent</code> configuration along with the default Harvester ingress-nginx configuration should look like:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> helm.cattle.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> HelmChartConfig</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rke2</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ingress</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">nginx</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> kube</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">valuesContent</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">controller</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">admissionWebhooks</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">port</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8444</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">enabled</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">extraArgs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">enable-annotation-validation</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">default-ssl-certificate</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cattle</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system/tls</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">rancher</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">internal</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">proxy-body-size</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"0"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">proxy-request-buffering</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"off"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">publishService</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">pathOverride</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> kube</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">system/ingress</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">expose</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>  Exit the <code>kubectl edit</code> command execution to save the configuration. </p><p>  Harvester automatically applies the change once the content is saved.</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>  The configuration disables the RKE2 ingress-nginx admission webhooks while preserving Harvester's default ingress-nginx configuration.</p><p>  If the <code>HelmChartConfig</code> resource contains other custom ingress-nginx configuration, you must retain them when editing the resource.</p></div></div></li><li><p>Verify that RKE2 deleted the <code>rke2-ingress-nginx-admission</code> validating webhook configuration.</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl get validatingwebhookconfiguration rke2-ingress-nginx-admission</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Error from server (NotFound): validatingwebhookconfigurations.admissionregistration.k8s.io "rke2-ingress-nginx-admission" not found</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Verify that the ingress-nginx pods are restarted successfully.</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl -n kube-system get po -lapp.kubernetes.io/instance=rke2-ingress-nginx</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME                                  READY   STATUS    RESTARTS   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rke2-ingress-nginx-controller-g8l49   1/1     Running   0          5s</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><p>Once your Harvester cluster receives the RKE2 ingress-nginx patch, you can re-install the <code>rke2-ingress-nginx-admission</code> validating webhook configuration by removing the <code>HelmChartConfig</code> patch.</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>These steps only cover the RKE2 ingress-nginx controller that is managed by Harvester. You must also update other running ingress-nginx controllers. See the References section for more information.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-1974" target="_blank" rel="noopener noreferrer">https://nvd.nist.gov/vuln/detail/CVE-2025-1974</a></li><li><a href="https://github.com/kubernetes/kubernetes/issues/131009" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/kubernetes/issues/131009</a></li><li><a href="https://github.com/rancher/rke2/issues/7953" target="_blank" rel="noopener noreferrer">https://github.com/rancher/rke2/issues/7953</a></li><li><a href="https://www.suse.com/support/kb/doc/?id=000021756" target="_blank" rel="noopener noreferrer">https://www.suse.com/support/kb/doc/?id=000021756</a></li></ul>]]></content:encoded>
            <category>security</category>
            <category>cve</category>
        </item>
        <item>
            <title><![CDATA[Harvester ISO boot fails with SBAT error]]></title>
            <link>https://harvesterhci.io/kb/iso_boot_fails_with_sbat_errror</link>
            <guid>iso_boot_fails_with_sbat_errror</guid>
            <pubDate>Fri, 14 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How to work around "Verifying shim SBAT data failed: Security Policy Violation" error when booting the Harvester installer ISO]]></description>
            <content:encoded><![CDATA[<p>The ISO image may fail to boot when you attempt to install Harvester on a host with the following characteristics:</p><ul><li>An operating system was previously installed, particularly openSUSE Leap 15.5 or later and Harvester v1.3.1 or later. Other Linux distributions and recent versions of Windows may also be affected.</li><li>UEFI secure boot is enabled.</li></ul><p>This issue occurs when the Harvester ISO uses a shim bootloader that is older than the bootloader previously installed on the host. For example, the Harvester v1.3.1 ISO uses shim 15.4 but the system uses shim 15.8 after installation, which sets SBAT revocations for older shims. Subsequent attempts to boot the older shim on the ISO fail with the following error:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">Verifying shim SBAT data failed: Security Policy Violation</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Something has gone seriously wrong: SBAT self-check failed: Security Policy Violation</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>To mitigate the issue, perform the following workaround:</p><ol><li>Disable Secure Boot.</li><li>Boot the ISO image and proceed with the installation.</li><li>Enable Secure Boot and boot into the installed system.</li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li>Harvester: <a href="https://github.com/harvester/harvester/issues/7343" target="_blank" rel="noopener noreferrer">Issue 7343</a></li><li>openSUSE: <a href="https://en.opensuse.org/openSUSE:UEFI#Reset_SBAT_string_for_booting_to_old_shim_in_old_Leap_image" target="_blank" rel="noopener noreferrer">Reset SBAT string for booting to old shim in old Leap image</a></li></ul>]]></content:encoded>
            <category>installation</category>
            <category>operating system</category>
            <category>secure boot</category>
        </item>
        <item>
            <title><![CDATA[KubeVirt Certificates Rotation]]></title>
            <link>https://harvesterhci.io/kb/kubevirt_certificates_rotation</link>
            <guid>kubevirt_certificates_rotation</guid>
            <pubDate>Thu, 28 Nov 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[KubeVirt Certificates Rotation.]]></description>
            <content:encoded><![CDATA[<p>Harvester's embedded Rancher UI may display warnings about expiring KubeVirt certificates. You can safely ignore these warnings because automatic certificate rotation is handled by KubeVirt and is enabled by default.</p><p><img loading="lazy" alt="kubevirt-certs-expired" src="/assets/images/kubevirt_certs_expired-af496d05bad47614e7fb644c8971950d.png" width="1716" height="937"></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="kubevirt-certificate-rotation-strategy">KubeVirt Certificate Rotation Strategy<a class="hash-link" href="#kubevirt-certificate-rotation-strategy" title="Direct link to heading">​</a></h2><p>KubeVirt provides a self-signed certificate mechanism that rotates both CA and certifcates on a defined recurring interval. You can check the setting  <code>certificateRotateStrategy</code> by running the following command:</p><div class="codeBlockContainer_I0IT language-sh theme-code-block"><div class="codeBlockContent_wNvx sh"><pre tabindex="0" class="prism-code language-sh codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get kubevirt -n harvester-system -o yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>By default, the value of <code>certificateRotateStrategy</code> is empty, which means that KubeVirt uses its default rotation settings and no manual configuration is required.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">certificateRotateStrategy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="configuration-fields">Configuration Fields<a class="hash-link" href="#configuration-fields" title="Direct link to heading">​</a></h2><p>You can use the following fields to configure <code>certificateRotateStrategy</code>.</p><ul><li><code>.ca.duration</code>: Validity period of the CA certificate. The default value is "168h".</li><li><code>.ca.renewBefore</code>: Amount of time before a CA certificate expires during which a new certificate is issued. The default value is "33.6h".</li><li><code>.server.duration</code>: Validity period of server component certificates (for example, virt-api, virt-handler, and virt-operator). The default value is "24h".</li><li><code>.server.renewBefore</code>: Amount of time before a server certificate expires during which a new certificate is issued. The default value is "4.8h".</li></ul><p>Example of a complete configuration:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">certificateRotateStrategy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">selfSigned</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">ca</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">duration</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 168h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">renewBefore</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 33.6h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">server</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">duration</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 24h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">renewBefore</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 4.8h</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="certificate-rotation-triggers">Certificate Rotation Triggers<a class="hash-link" href="#certificate-rotation-triggers" title="Direct link to heading">​</a></h2><p>Certificate rotation can be triggered by several conditions. The following list only outlines key triggers and is not exhaustive.</p><ul><li>Missing certificate: A required certificate does not exist.</li><li>Invalid CA signature: A certificate was not signed by the specified CA.</li><li>Proactive renewal: The <code>renewBefore</code> value takes effect. A new certificate must be issued before the current one expires.</li><li>CA expiration: The CA certificate has expired, so the certificate signed by the CA is also rotated.</li></ul><p>When certificate rotation is triggered, you should see <code>virt-operator</code> log records similar to the following:</p><div class="codeBlockContainer_I0IT language-txt theme-code-block"><div class="codeBlockContent_wNvx txt"><pre tabindex="0" class="prism-code language-txt codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-virt-api-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.045809Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-controller-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.056759Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-exportproxy-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.063530Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-virt-handler-server-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.068608Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-virt-handler-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.074555Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-operator-certs updated","pos":"core.go:278","timestamp":"2024-12-06T08:02:01.078719Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-export-ca updated","pos":"core.go:278","timestamp":"2024-12-06T08:03:36.063496Z"}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">{"component":"virt-operator","level":"info","msg":"secret kubevirt-ca updated","pos":"core.go:278","timestamp":"2024-12-06T08:04:06.052750Z"}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li>Harvester: <a href="https://github.com/harvester/harvester/issues/5798" target="_blank" rel="noopener noreferrer">Issue 5798</a></li><li><a href="https://kubevirt.io/2020/KubeVirt-Security-Fundamentals.html" target="_blank" rel="noopener noreferrer">https://kubevirt.io/2020/KubeVirt-Security-Fundamentals.html</a></li><li><a href="https://github.com/kubevirt/kubevirt/blob/v1.1.1/pkg/virt-operator/resource/generate/components/secrets.go#L326" target="_blank" rel="noopener noreferrer">https://github.com/kubevirt/kubevirt/blob/v1.1.1/pkg/virt-operator/resource/generate/components/secrets.go#L326</a></li><li><a href="https://github.com/kubevirt/kubevirt/blob/v1.1.1/pkg/virt-operator/resource/apply/certificates.go" target="_blank" rel="noopener noreferrer">https://github.com/kubevirt/kubevirt/blob/v1.1.1/pkg/virt-operator/resource/apply/certificates.go</a></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>kubevirt</category>
            <category>certificates</category>
            <category>cert</category>
            <category>ca</category>
        </item>
        <item>
            <title><![CDATA[Shutdown and Restart a Harvester Cluster]]></title>
            <link>https://harvesterhci.io/kb/shutdown_and_restart_a_harvester_cluster</link>
            <guid>shutdown_and_restart_a_harvester_cluster</guid>
            <pubDate>Mon, 22 Jul 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Details steps about how to shutdown a Harvester cluster and restart it.]]></description>
            <content:encoded><![CDATA[<p>Scenarios:</p><ol><li><p>The Harvester cluster is installed with 3+ nodes.</p></li><li><p>The <strong>Rancher Manager/Server</strong> is deployed independently. (Hereafter it is mentioned as <code>Rancher Manager</code>)</p></li><li><p>The Harvester cluster is imported to this Rancher Manager and works as a node driver.</p></li><li><p>The Rancher Manager deploys a couple of downstream K8s clusters, the machines/nodes of those clusters are backed by Harvester VMs.</p></li><li><p>There are also some traditional VMs deployed on the Harvester cluster, which have no direct connection with the Rancher Manager.</p></li></ol><p>You plan to move those Harvester nodes geographically, or to power off the whole cluster for some time, it is essential to shutdown the Harvester cluster and restart later.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>2 3 4 are optional if your Harvester cluster is mainly running as an IaaS component. This instruction covers all the above scenarios.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="general-principle">General Principle<a class="hash-link" href="#general-principle" title="Direct link to heading">​</a></h2><p>To safely shutdown a Harvester cluster, you need to follow the roughly reverse order of the cluster installation and the workload deployments.</p><p>Those facts need to be taken into account particularly:</p><ol><li><p>The common methodology of Kubernetes operator/controller is to try things continuously until they meet expectations. When the cluster is shutting down node by node, if you don't stop those workloads in advance, they will try hard until the last node is off. It causes the last few nodes to have heavy CPU/memory/network/storage usage and increases the chance of data corruption.</p></li><li><p>Each Harvester node has limited capacity of CPU/memory/network/storage and the max-pod-number, when all workloads are crowded on the last few nodes, the unexpected pod eviction, scheduling failure and other phenomena may happen.</p></li><li><p>Harvester has embedded Longhorn as the default CSI driver, each PV can have 3 or more replicas, when replicas are rescheduled to other nodes, Longhorn will copy data from source node and rebuild the replica. Undoubtedly, stop the PVs as much as possible before the cluster shutdown to avoid the data moving.</p></li><li><p>Unlike normal Kubernetes deployments which have no PVs and are more flexible &amp; agile to deploy anywhere on the cluster, the VMs are backed by massive sized PVs, slowly to move/migrate or even pinned on certain nodes to take the advantage of PCI-passthrough/vGPU/... and are much more sensitive to data consistency.</p></li></ol><p>Needless to say, it is a bad practice to brutally power off the nodes on production environments.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="1-precondition">1. Precondition<a class="hash-link" href="#1-precondition" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="11-generate-a-support-bundle-file">1.1 Generate a Support-bundle File<a class="hash-link" href="#11-generate-a-support-bundle-file" title="Direct link to heading">​</a></h3><p>For trouble-shooting purpose, it is essential to follow <a href="https://docs.harvesterhci.io/v1.3/troubleshooting/harvester#generate-a-support-bundle" target="_blank" rel="noopener noreferrer">this instruction</a> to generate a support-bundle file before taking any actions. And make sure the <a href="https://docs.harvesterhci.io/v1.3/advanced/index#support-bundle-namespaces" target="_blank" rel="noopener noreferrer">workload namespaces are added</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="12-keep-network-stability">1.2 Keep Network Stability<a class="hash-link" href="#12-keep-network-stability" title="Direct link to heading">​</a></h3><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Harvester cluster is built on top of Kubernetes, a general requirement is that the Node/Host IP and the cluster VIP should keep stable in the whole lifecycle, if IP changes the cluster may fail to recover/work.</p><p>If your VMs on Harvester are used as Rancher downstream cluster machines/nodes, and their IPs are allocated from DHCP server, also make sure those VMs will still get the same IPs after the Harvester cluster is rebooted and VMs are restarted.</p></div></div><p>A good practice is to have detailed documents about the infrastructure related settings.</p><ul><li><p>The bare metal server NIC slot/port connections with the remote (ToR) Switches.</p></li><li><p>The VLAN for the management network.</p></li><li><p>(Optional) The DHCP Server, ip-pools and ip-mac bindings for the Harvester cluster if DHCP server is used. If there is no fixed IP binding, when the server restarts after some days it may get a different IP from the DHCP server.</p></li><li><p>The <a href="https://docs.harvesterhci.io/v1.3/networking/harvester-network#vlan-network" target="_blank" rel="noopener noreferrer">VLANs for the VM networks</a>, the CIDRs, default gateways and optional DHCP servers.</p></li><li><p><a href="https://docs.harvesterhci.io/v1.3/advanced/index#ntp-servers" target="_blank" rel="noopener noreferrer">NTP servers</a>.</p></li><li><p>DNS servers.</p></li><li><p>(Optional) The <a href="https://docs.harvesterhci.io/v1.3/advanced/index#http-proxy" target="_blank" rel="noopener noreferrer">http proxy</a>.</p></li><li><p>(Optional) The private <a href="https://docs.harvesterhci.io/v1.3/advanced/index#containerd-registry" target="_blank" rel="noopener noreferrer">containerd-registry</a>.</p></li><li><p>(Optional) The firewall configurations.</p></li></ul><p>See the <a href="https://docs.harvesterhci.io/v1.3/install/index" target="_blank" rel="noopener noreferrer">Harvester ISO Installation</a> to review the infrastructure related settings for the Harvester cluster.</p><p>Before the Harvester cluster is restarted later, check and test those settings again to make sure the infrastructure is ready.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="2-backup">2. Backup<a class="hash-link" href="#2-backup" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="optional-backup-vms-if-possible">(Optional) Backup VMs if Possible<a class="hash-link" href="#optional-backup-vms-if-possible" title="Direct link to heading">​</a></h3><p>It is always a good practice to backup things before a whole cluster shutdown.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="optional-backup-downstream-k8s-clusters-if-possible">(Optional) Backup Downstream K8s Clusters if Possible<a class="hash-link" href="#optional-backup-downstream-k8s-clusters-if-possible" title="Direct link to heading">​</a></h3><p>Harvester doesn't touch the (Rancher Manager managed) downstream K8s clusters' workload, when they are not able to be migrated to other node drivers, suggests to backup those clusters.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="optional-stop-or-migrate-downstream-k8s-clusters-if-possible">(Optional) Stop or Migrate Downstream K8s Clusters if Possible<a class="hash-link" href="#optional-stop-or-migrate-downstream-k8s-clusters-if-possible" title="Direct link to heading">​</a></h3><p>Harvester doesn't touch the downstream K8s clusters' workload, but suggests to stop or migrate the downstream clusters to avoid your service interruption.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="3-shutdown-workloads">3. Shutdown Workloads<a class="hash-link" href="#3-shutdown-workloads" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="31-shutdown-traditional-vms">3.1 Shutdown Traditional VMs<a class="hash-link" href="#31-shutdown-traditional-vms" title="Direct link to heading">​</a></h3><ol><li><p>Shutdown VM from the VM shell (e.g. Linux <code>shutdown</code> command), the OS itself will save data to disks.</p></li><li><p>Check the VM status from <a href="https://docs.harvesterhci.io/v1.3/troubleshooting/vm#vm-general-operations" target="_blank" rel="noopener noreferrer">Harvester UI - VM page</a>, when it is not <code>Off</code>, then click the <code>Stop</code> command.</p></li></ol><h3 class="anchor anchorWithStickyNavbar_mojV" id="32-shutdown-rancher-downstream-cluster-machinesvms">3.2 Shutdown Rancher Downstream Cluster Machines(VMs)<a class="hash-link" href="#32-shutdown-rancher-downstream-cluster-machinesvms" title="Direct link to heading">​</a></h3><p>Suppose your Harvester cluster was <a href="https://docs.harvesterhci.io/v1.3/rancher/virtualization-management" target="_blank" rel="noopener noreferrer">imported to Rancher</a> as a <a href="https://docs.harvesterhci.io/v1.3/rancher/rancher-integration#creating-kubernetes-clusters-using-the-harvester-node-driver" target="_blank" rel="noopener noreferrer">node driver</a> before.</p><p>When Rancher deploys a downstream cluster on node driver Harvester, it creates a couple of VMs on Harvester automatically. Directly stopping those VMs on Harvester is not a good practice when Rancher is still managing the downstream cluster. For example, Rancher may create new VMs if you stop them from Harvester.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>This depends on the <a href="https://ranchermanager.docs.rancher.com/reference-guides/cluster-configuration/rancher-server-configuration/rke2-cluster-configuration#auto-replace" target="_blank" rel="noopener noreferrer">auto-replace</a> and/or other options on <code>Rancher Manager</code>.</p></div></div><p>If you have got a solution to <strong>shutdown</strong> those downstream clusters, and check those VMs are <code>Off</code>; or there is no downstream clusters, then jump to the step <a href="#33-disable-some-addons">disable some addons</a>.</p><p>Unless you have already deleted all the downstream clusters which are deploy on this Harvester, <strong>DO NOT</strong> <a href="https://docs.harvesterhci.io/v1.3/rancher/virtualization-management#delete-imported-harvester-cluster" target="_blank" rel="noopener noreferrer">remove this imported Harvester from the Rancher Manager</a>. Harvester will get a different driver-id when it is imported later, but those aforementioned downstream clusters are connected to driver-id.</p><p>To safely shutdown those VMs but still keep the Rancher Manager managed downstream cluster <code>alive</code>, please follow the steps below:</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="disconnect-harvester-from-the-rancher-manager">Disconnect Harvester from the Rancher Manager<a class="hash-link" href="#disconnect-harvester-from-the-rancher-manager" title="Direct link to heading">​</a></h4><p><img loading="lazy" alt="Rancher and Harvester relationship" src="/assets/images/rancher_manager_harvester-d0500ad55fe6628d9da02a793989d7df.png" width="1764" height="940"></p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Harvester has an <code>embedded Rancher</code> deployment which is used to help the lifecycle management of Harvester itself, it is different from the independently deployed <strong>Rancher Manager</strong> for multi-cluster management and more.</p></div></div><p>The <code>cattle-cluster-agent-***</code> pod is the <a href="https://docs.harvesterhci.io/v1.3/rancher/virtualization-management#importing-harvester-cluster" target="_blank" rel="noopener noreferrer">direct connection between Rancher Manager and Harvester cluster</a>, and this pod is monitored and managed by the <code>embedded Rancher</code> in Harvester, scaling down this pod does not work. The <code>embedded Rancher</code> will scale it up automatically.</p><p>Run steps below to suspend the connection.</p><p>All following CLI commands are executed upon <strong>Harvester</strong> cluster.</p><ol><li>Set the <code>management.cattle.io/scale-available</code> of <code>deployment rancher</code> to be <code>""</code> instead of <code>"3"</code> or other values.</li></ol><p>This change will stop the auto-scaling.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl edit deployment -n cattle-system rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: apps/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: Deployment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  annotations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    management.cattle.io/scale-available: "3"  // record this value, and change it to ""</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  generation: 16</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  labels:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    app: rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    app.kubernetes.io/managed-by: Helm</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  namespace: cattle-system</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>Scale down the <code>rancher</code> deployment.</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl scale deployment -n cattle-system rancher --replicas=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/rancher scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ get deployment -n cattle-system rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME      READY   UP-TO-DATE   AVAILABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher   0/0     0            0           33d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="3"><li>Make sure the <code>rancher-*</code> pods are gone.</li></ol><p>Check the <code>rancher-*</code> pods on <code>cattle-system</code> are gone, if any of them is stucking at <code>Terminating</code>, use <code>kubectl delete pod -n cattle-system rancher-pod-name --force</code> to delete it.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get pods -n cattle-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME                                         READY   STATUS        RESTARTS       AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher-856f674f7d-5dqb6                     0/1     Terminating   0              3d22h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher-856f674f7d-h4vsw                     1/1     Running       23 (68m ago)   33d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher-856f674f7d-m6s4r                     0/1     Pending       0              3d19h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="4"><li>Scale down the <code>cattle-cluster-agent</code> deployment.</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl scale deployment -n cattle-system cattle-cluster-agent --replicas=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/cattle-cluster-agent scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get deployment -n cattle-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME                        READY   UP-TO-DATE   AVAILABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-cluster-agent        0/0     0            0           23d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Please note:</p><ol><li>From now on, this Harvester is <code>Unavailable</code> on the Rancher Manager.</li></ol><p><img loading="lazy" alt="Unavailable" src="/assets/images/harvester_unavailable_on_rancher-735b74552f671ef1aa32bf7f67a31d9c.png" width="3536" height="678"></p><ol start="2"><li>The Harvester WebUI returns <code>503 Service Temporarily Unavailable</code>, all operations below can be done via <code>kubectl</code>.</li></ol><p><img loading="lazy" alt="503 Service Temporarily Unavailable" src="/assets/images/harvester_503_error-a9c7114aa235865722eb11a71ffd3f05.png" width="2742" height="384"></p><h4 class="anchor anchorWithStickyNavbar_mojV" id="shutdown-rancher-downstream-cluster-machinesvms">Shutdown Rancher Downstream Cluster Machines(VMs)<a class="hash-link" href="#shutdown-rancher-downstream-cluster-machinesvms" title="Direct link to heading">​</a></h4><ol><li><p>Shutdown VM from the VM shell (e.g. Linux <code>shutdown</code> command).</p></li><li><p>Check the <code>vmi</code> instances, if any is still <code>Running</code>, stop it.</p></li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get vmi</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE   NAME   AGE    PHASE     IP            NODENAME   READY</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default     vm1    5m6s   Running   10.52.0.214   harv41     True</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ virtctl stop vm1 --namespace default</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">VM vm1 was scheduled to stop</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get vmi -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE   NAME   AGE    PHASE     IP            NODENAME   READY</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default     vm1    5m6s   Running   10.52.0.214   harv41     False</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get vmi -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">No resources found</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get vm -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE   NAME   AGE   STATUS    READY</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default     vm1    7d    Stopped   False</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="33-disable-some-addons">3.3 Disable Some Addons<a class="hash-link" href="#33-disable-some-addons" title="Direct link to heading">​</a></h3><p>Harvester has some addons which are backed by PVCs, it is necessary to disable them.</p><p>The <code>rancher-monitoring</code> addon should be disabled.</p><p>The experimental <a href="https://docs.harvesterhci.io/v1.3/advanced/addons/rancher-vcluster" target="_blank" rel="noopener noreferrer">Rancher Manager addon</a> should be disabled.</p><p>For other addons, please follow the Harvester document to keep or disable them.</p><p>From Harvester UI <a href="https://docs.harvesterhci.io/v1.3/advanced/addons" target="_blank" rel="noopener noreferrer">addon page</a>, write down those none-Disabled addons, click <code>Disable</code> menu to disable them, wait until the state becomes <code>Disabled</code></p><p>From CLI:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl get addons.harvesterhci.io -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE                  NAME                    HELMREPO                                                 CHARTNAME                         ENABLED</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-logging-system      rancher-logging         http://harvester-cluster-repo.cattle-system.svc/charts   rancher-logging                   false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-monitoring-system   rancher-monitoring      http://harvester-cluster-repo.cattle-system.svc/charts   rancher-monitoring                true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system           harvester-seeder        http://harvester-cluster-repo.cattle-system.svc/charts   harvester-seeder                  false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system           nvidia-driver-toolkit   http://harvester-cluster-repo.cattle-system.svc/charts   nvidia-driver-runtime             false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system           pcidevices-controller   http://harvester-cluster-repo.cattle-system.svc/charts   harvester-pcidevices-controller   false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system           vm-import-controller    http://harvester-cluster-repo.cattle-system.svc/charts   harvester-vm-import-controller    false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Example: disable rancher-monitoring</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl edit addons.harvesterhci.io -n cattle-monitoring-system rancher-monitoring</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  chart: rancher-monitoring</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  enabled: false               // set this field to be false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>When an addon is disabled, the configuration data is stored to reuse when the addon is enabled again.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="34--optional-disable-other-workloads">3.4  (Optional) Disable other Workloads<a class="hash-link" href="#34--optional-disable-other-workloads" title="Direct link to heading">​</a></h3><p>If you have deployed some customized workloads on the Harvester cluster directly, it is better to disable/remove them.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="35--check-longhorn-volumes">3.5  Check Longhorn Volumes<a class="hash-link" href="#35--check-longhorn-volumes" title="Direct link to heading">​</a></h3><p>The volumes should be in state <code>detached</code>, check the related workload if some volumes are still in state <code>attached</code>.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get volume -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE         NAME                                       DATA ENGINE   STATE      ROBUSTNESS   SCHEDULED   SIZE          NODE     AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-3323944c-00d9-4b35-ae38-a00b1e8a8841   v1            detached   unknown                  5368709120             13d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-394713a4-d08c-4a45-bf7a-d44343f29dea   v1            attached   healthy                  6442450944    harv41   8d    // still attached and in use</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-5cf00ae2-e85e-413e-a4f1-8bc4242d4584   v1            detached   unknown                  2147483648             13d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-620358ca-94b3-4bd4-b008-5c144fd815c9   v1            attached   healthy                  2147483648    harv41   8d    // still attached and in use</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-8174f05c-919b-4a8b-b1ad-4fc110c5e2bf   v1            detached   unknown                  10737418240            13d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="4-shutdown-nodes">4. Shutdown Nodes<a class="hash-link" href="#4-shutdown-nodes" title="Direct link to heading">​</a></h2><p>Get all nodes from Harvester WebUI <a href="https://docs.harvesterhci.io/v1.3/host/" target="_blank" rel="noopener noreferrer">Host Management</a>.</p><p>From CLI:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get nodes -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME     STATUS   ROLES                       AGE   VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv2    Ready    &lt;none&gt;                      24d   v1.27.10+rke2r1  // worker node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv41   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1  // control-plane node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv42   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1  // control-plane node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv43   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1  // control-plane node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="41-shutdown-the-worker-nodes">4.1 Shutdown the Worker Nodes<a class="hash-link" href="#41-shutdown-the-worker-nodes" title="Direct link to heading">​</a></h3><ol><li><p>SSH to the Harvester <code>worker nodes</code>.</p></li><li><p>Run command <code>sudo -i shutdown</code>.</p></li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ sudo -i shutdown</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Shutdown scheduled for Mon 2024-07-22 06:58:56 UTC, use 'shutdown -c' to cancel.</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="3"><li>Wait until all those nodes are down.</li></ol><h3 class="anchor anchorWithStickyNavbar_mojV" id="42-shutdown-control-plane-nodes-and-witness-node">4.2 Shutdown Control-plane Nodes and Witness Node<a class="hash-link" href="#42-shutdown-control-plane-nodes-and-witness-node" title="Direct link to heading">​</a></h3><p>So far, there are generally three control-plane nodes left, and three <code>etcd-*</code> pods are running in <code>kube-system</code> namespaces.</p><p>The first step is to find which one of the <code>etcd-*</code> pod is running as the leader.</p><p>Run below command upon any of the <code>etcd-*</code> pod, note the <code>IS LEADER</code> column.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl exec -n kube-system etcd-harv41 -- env ETCDCTL_API=3 etcdctl endpoint status --cluster -w table --cacert /var/lib/rancher/rke2/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/rke2/server/tls/etcd/server-client.crt --key /var/lib/rancher/rke2/server/tls/etcd/server-client.key</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">|           ENDPOINT           |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.141:2379 | c70780b7862269c9 |   3.5.9 |   34 MB |      true |      false |        45 |    6538756 |            6538756 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.142:2379 | db04095b49eb5352 |   3.5.9 |   34 MB |     false |       true |        45 |    6538756 |            6538756 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.143:2379 | c27585769b2ce977 |   3.5.9 |   34 MB |     false |       true |        45 |    6538756 |            6538756 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="witness-node">Witness Node<a class="hash-link" href="#witness-node" title="Direct link to heading">​</a></h4><p>If your cluster has one <a href="https://docs.harvesterhci.io/v1.3/advanced/witness#creating-a-harvester-cluster-with-a-witness-node" target="_blank" rel="noopener noreferrer">Witness Node</a> and the <code>etcd</code> leader happens to be on this node.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get nodes -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME     STATUS     ROLES                       AGE    VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv2    Ready      &lt;none&gt;                      25d    v1.27.10+rke2r1  // worker node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv41   Ready      control-plane,etcd,master   55d    v1.27.10+rke2r1  // control-plane node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv42   Ready      control-plane,etcd,master   55d    v1.27.10+rke2r1  // control-plane node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv43   Ready      etcd                         1d    v1.27.10+rke2r1  // witness node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">|           ENDPOINT           |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.141:2379 | c70780b7862269c9 |   3.5.9 |   34 MB |     false |       true |        46 |    6538829 |            6538829 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.142:2379 | db04095b49eb5352 |   3.5.9 |   34 MB |     false |       true |        46 |    6538829 |            6538829 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.143:2379 | a21534d02463b347 |   3.5.9 |   34 MB |      true |      false |        46 |    6538829 |            6538829 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Run <code>kubectl delete pod -n kube-system etcd-name</code> command to delete the <code>etcd</code> pod on the <code>witness node</code> to trigger the pod replacement and leader re-election so that the <code>etcd</code> leader will be located on one of the <code>control-plane</code> nodes. Check the <code>etcd</code> leader again to make sure.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">|           ENDPOINT           |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.141:2379 | c70780b7862269c9 |   3.5.9 |   34 MB |      true |      false |        47 |    6538833 |            6538833 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.142:2379 | db04095b49eb5352 |   3.5.9 |   34 MB |     false |       true |        47 |    6538833 |            6538833 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| https://192.168.122.143:2379 | a21534d02463b347 |   3.5.9 |   34 MB |     false |       true |        47 |    6538833 |            6538833 |        |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>To now, the <code>etcd</code> has three running instances and the leader is located on the <code>control-plane</code> node.</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Write down the information of those nodes like name, IP, and the leader. Ideally give them a sequence like 1, 2, 3.</p></div></div><p>Shutdown the two <code>IS LEADER == false</code> nodes one by one.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester-node-shell$ sudo -i shutdown</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="43-shutdown-the-last-control-plane-node">4.3 Shutdown the Last Control-plane Node<a class="hash-link" href="#43-shutdown-the-last-control-plane-node" title="Direct link to heading">​</a></h3><p>Shutdown the last <code>IS LEADER == true</code> node. Remember its physical information for restarting it first in the steps below.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester-last-node-shell$ sudo -i shutdown</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="5-restart">5. Restart<a class="hash-link" href="#5-restart" title="Direct link to heading">​</a></h2><p>If the Harvester cluster has been moved to a new location, or has been off for days, or your infrastructure has changes, check and test the <a href="#12-keep-network-stability">network stability</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="51-restart-the-control-plane-nodes-and-the-witness-node">5.1 Restart the Control-plane Nodes and the Witness Node<a class="hash-link" href="#51-restart-the-control-plane-nodes-and-the-witness-node" title="Direct link to heading">​</a></h3><p>The first step is to start those <code>etcd</code> located nodes one after another.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="restart-the-leader-control-plane-node">Restart the Leader Control-plane Node<a class="hash-link" href="#restart-the-leader-control-plane-node" title="Direct link to heading">​</a></h4><p>Power on the <a href="#43-shutdown-the-last-control-plane-node">last shutdown node</a> first. After about three minutes, continue the next step.</p><p>When you check the <code>etcd</code> pod log on this node, the following message may be observed.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">sent MsgPreVote request to db04095b49eb5352 at term 5</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"msg":"prober detected unhealthy status","round-tripper-name":"ROUND_TRIPPER_RAFT_MESSAGE","remote-peer-id":"db04095b49eb5352","rtt":"0s","error":"dial tcp 192.168.122.142:2380: connect: no route to host"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The <code>etcd</code> is wating for the other two members to be online and then vote a leader.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="restart-the-rest-of-control-plane-nodes-and-the-witness-node">Restart the Rest of Control-plane Nodes and the Witness Node<a class="hash-link" href="#restart-the-rest-of-control-plane-nodes-and-the-witness-node" title="Direct link to heading">​</a></h4><p>Power on the rest nodes which also hosted the <code>etcd</code> pod before.</p><p>Wait until all the three control-plane nodes or possibly two control-plane and one witness nodes are <code>Ready</code>.</p><p>From CLI:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get nodes -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME     STATUS   ROLES                       AGE   VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv41   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv42   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv43   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The <code>etcd</code> forms a quorum and can tolerant the failure of one node.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If the <code>embedded Rancher</code> was not scaled down before, this step can also be:</p><p>Check the Harvester UI is accessible and this <a href="https://docs.harvesterhci.io/v1.3/host/" target="_blank" rel="noopener noreferrer">node on Harvester UI</a> is <code>Active</code>.</p><p>This also applies to the following steps.</p></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="check-the-vip">Check the VIP<a class="hash-link" href="#check-the-vip" title="Direct link to heading">​</a></h4><p>The following <code>EXTERNAL-IP</code> should be the same as the VIP of the Harvester cluster.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get service -n kube-system ingress-expose</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME             TYPE           CLUSTER-IP     EXTERNAL-IP       PORT(S)                      AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">ingress-expose   LoadBalancer   10.53.50.107   192.168.122.144   443:32701/TCP,80:31480/TCP   34d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="52-restart-the-worker-nodes">5.2 Restart the Worker Nodes<a class="hash-link" href="#52-restart-the-worker-nodes" title="Direct link to heading">​</a></h3><p>Wait until all nodes are <code>Ready</code>.</p><p>From CLI:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get nodes -A</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME     STATUS   ROLES                       AGE   VERSION</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv2    Ready    &lt;none&gt;                      24d   v1.27.10+rke2r1  // worker node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv41   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv42   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harv43   Ready    control-plane,etcd,master   54d   v1.27.10+rke2r1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="healthy-check">Healthy Check<a class="hash-link" href="#healthy-check" title="Direct link to heading">​</a></h4><h5 class="anchor anchorWithStickyNavbar_mojV" id="basic-components">Basic Components<a class="hash-link" href="#basic-components" title="Direct link to heading">​</a></h5><p>Harvester deploys some basic components on the following namespaces. When a bare-metal server is powered on, it may take upto around 15 minutes for the Harvester OS to be running and all the deployments on this node to be ready.</p><p>If any of them continues to show the status like <code>Failed</code>/<code>CrashLoopBackOff</code>, a troubleshooting is needed to confirm the root cause.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE                         NAME                                                     READY   STATUS      RESTARTS       AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-fleet-local-system         fleet-agent-645766877f-bt424                             1/1     Running     0              11m</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-fleet-system               fleet-controller-57f78dcd48-5tkkj                        1/1     Running     4 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-fleet-system               gitjob-d5bb7b548-jscgk                                   1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-system                     harvester-cluster-repo-6c6458bd46-7jcrl                  1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-system                     system-upgrade-controller-6f86d6d4df-f8jg7               1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-system                     rancher-7bc9d94b87-g4k4v                                 1/1     Running     3 (14m ago)    42h  // note: if embedded Rancher was stopped in the above steps, it is not Running now</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-system                     rancher-webhook-6c5c6fbb65-2cbbs                         1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-787b467f4-qlfwt                                1/1     Running     2 (14m ago)    39h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-load-balancer-56d9c8758c-cvcmk                 1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-load-balancer-webhook-6b4d4d9d6b-4tsgl         1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-network-controller-9pzxh                       1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-network-controller-manager-69bcf67c7f-44zqj    1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-network-webhook-6c5d48bdf5-8kn9r               1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-node-disk-manager-c4c5k                        1/1     Running     3 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-node-manager-qbvbr                             1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-node-manager-webhook-6d8b48f559-m5shk          1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  harvester-webhook-87dc4cdd8-jg2q6                        1/1     Running     2 (14m ago)    39h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  kube-vip-n4s8l                                           1/1     Running     3 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  virt-api-799b99fb65-g8wgq                                1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  virt-controller-86b84c8f8f-4hhlg                         1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  virt-controller-86b84c8f8f-krq4f                         1/1     Running     3 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  virt-handler-j9gwn                                       1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system                  virt-operator-7585847fbc-hvs26                           1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       cloud-controller-manager-harv41                          1/1     Running     5 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       etcd-harv41                                              1/1     Running     2              42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       harvester-snapshot-validation-webhook-8594c5f8f8-8mk57   1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       harvester-snapshot-validation-webhook-8594c5f8f8-dkjmf   1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       harvester-whereabouts-cpqvl                              1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       kube-apiserver-harv41                                    1/1     Running     2              42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       kube-controller-manager-harv41                           1/1     Running     4 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       kube-proxy-harv41                                        1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       kube-scheduler-harv41                                    1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-canal-d5kmc                                         2/2     Running     4 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-coredns-rke2-coredns-84b9cb946c-qbwnb               1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-coredns-rke2-coredns-autoscaler-b49765765-6bjsk     1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-ingress-nginx-controller-cphgw                      1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-metrics-server-655477f655-gsnsc                     1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       rke2-multus-8nqg4                                        1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       snapshot-controller-5fb6d65787-nmjdh                     1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kube-system                       snapshot-controller-5fb6d65787-phvq7                     1/1     Running     3 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   backing-image-manager-5c32-ea70                          1/1     Running     0              13m</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-attacher-749459cf65-2x792                            1/1     Running     6 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-attacher-749459cf65-98tj4                            1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-attacher-749459cf65-nwglq                            1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-provisioner-775b4f76f4-h9mwd                         1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-provisioner-775b4f76f4-nvjzt                         1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-provisioner-775b4f76f4-zvd6w                         1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-resizer-68867d54f5-4hf5j                             1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-resizer-68867d54f5-fs9ht                             1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-resizer-68867d54f5-ht5hj                             1/1     Running     6 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-snapshotter-8469656cc7-6c47f                         1/1     Running     6 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-snapshotter-8469656cc7-9kk2v                         1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   csi-snapshotter-8469656cc7-vf9z4                         1/1     Running     5 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   engine-image-ei-94d5ee6c-pqx9h                           1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   instance-manager-beb75434e263a2aa9eedc0609862fed2        1/1     Running     0              13m</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-csi-plugin-85qm7                                3/3     Running     14 (13m ago)   42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-driver-deployer-6448498bc6-sv857                1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-loop-device-cleaner-bqg9v                       1/1     Running     2 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-manager-nhxbl                                   2/2     Running     6 (14m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-ui-7f56fcf5ff-clc8b                             1/1     Running     6 (13m ago)    42h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system                   longhorn-ui-7f56fcf5ff-m95sh                             1/1     Running     7 (13m ago)    42h</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If any of Longhorn PODs continues to show the status like <code>Failed</code>/<code>CrashLoopBackOff</code>, do not execute the following steps as many of them rely on the Longhorn to provision persistant volumes for running.</p></div></div><h5 class="anchor anchorWithStickyNavbar_mojV" id="storage-network">Storage Network<a class="hash-link" href="#storage-network" title="Direct link to heading">​</a></h5><p>When the <a href="https://docs.harvesterhci.io/v1.3/advanced/storagenetwork" target="_blank" rel="noopener noreferrer">Storage Network</a> has been enabled on the cluster, follow <a href="https://docs.harvesterhci.io/v1.3/advanced/storagenetwork#verify-configuration-is-completed" target="_blank" rel="noopener noreferrer">those steps</a> to check if the Longhorn PODs have the correct second IP assigned to them.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="53-enable-addons">5.3 Enable Addons<a class="hash-link" href="#53-enable-addons" title="Direct link to heading">​</a></h3><p>Enable those previously disabled addons, wait until they are <code>DepoloySuccessful</code>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="54-restore-the-connection-to-the-rancher-manager">5.4 Restore the Connection to the Rancher Manager<a class="hash-link" href="#54-restore-the-connection-to-the-rancher-manager" title="Direct link to heading">​</a></h3><p>Run following 1, 2 commands on the <strong>Harvester cluster</strong>.</p><ol><li>Set the <code>management.cattle.io/scale-available</code> of <code>rancher</code> deployment to be the value recorded on the above steps.</li></ol><p>This change will enable the auto-scaling.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl edit deployment -n cattle-system rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: apps/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: Deployment</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  annotations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    management.cattle.io/scale-available: "3"  // recorded on the above steps</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  generation: 16</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  labels:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    app: rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    app.kubernetes.io/managed-by: Helm</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  namespace: cattle-system</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>Scale up the <code>rancher</code> deployment on Harvester cluster.</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl scale deployment -n cattle-system rancher --replicas=3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/rancher scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ get deployment -n cattle-system rancher</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME      READY   UP-TO-DATE   AVAILABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher   0/0     0            0           33d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester$ kubectl get deployment -n cattle-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME                        READY   UP-TO-DATE   AVAILABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">cattle-cluster-agent        2/2     2            2           23d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rancher                     1/2     2            1           33d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>After the <code>rancher</code> deployment is ready, it will automatically scale up the <code>cattle-cluster-agent</code> deployment quickly.</p></div></div><ol start="3"><li>Check the virtualization management on the Rancher Manager.</li></ol><p>The Harvester cluster continues to be <code>active</code> on the <a href="https://docs.harvesterhci.io/v1.3/rancher/virtualization-management" target="_blank" rel="noopener noreferrer">Rancher Virtualization Management</a> .</p><ol start="4"><li>Check the Harvester cluster WebUI.</li></ol><p>You should be able to access the Harvester WebUI again.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="55-start-vms">5.5 Start VMs<a class="hash-link" href="#55-start-vms" title="Direct link to heading">​</a></h3><h4 class="anchor anchorWithStickyNavbar_mojV" id="51-start-traditional-vms">5.1 Start Traditional VMs<a class="hash-link" href="#51-start-traditional-vms" title="Direct link to heading">​</a></h4><p>When there are many VMs deployed on the cluster, don't start all the VMs at the same time, suggest starting them group by group.</p><p>Wait until they are <code>Running</code>.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="52-rancher-downstream-cluster-machinesvms">5.2 Rancher Downstream Cluster Machines(VMs)<a class="hash-link" href="#52-rancher-downstream-cluster-machinesvms" title="Direct link to heading">​</a></h4><p>After the Harvester cluster is re-connected to the <code>Rancher Manager</code> successfully, the <code>Rancher Manager</code> will handle the downstream K8s clusters' machines(vms) automatically. Wait until all the downstream clusters are ready.</p><p>See <code>Rancher Manager</code> <a href="https://documentation.suse.com/cloudnative/rancher-manager/latest/en/cluster-admin/manage-clusters/access-clusters/access-clusters.html#_clusters_in_rancher_ui" target="_blank" rel="noopener noreferrer">Access Downstream Clusters</a> to monitor and operator the downstream clusters.</p><p>If <code>Rancher Manager</code> does not restart the machines(vms) automatically, you can start those VMs from the <strong>Vitrual Machines</strong> page on Harvester UI.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>This depends on the <a href="https://ranchermanager.docs.rancher.com/reference-guides/cluster-configuration/rancher-server-configuration/rke2-cluster-configuration#auto-replace" target="_blank" rel="noopener noreferrer">auto-replace</a> and/or other options on <code>Rancher Manager</code>.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="56-generate-a-new-support-bundle-file">5.6 Generate a new Support-bundle File<a class="hash-link" href="#56-generate-a-new-support-bundle-file" title="Direct link to heading">​</a></h3><p>Generate a new support-bundle file on the Harvester cluster.</p><p>Together with the <a href="#11-generate-a-support-bundle-file">previously generated support-bundle file</a>, the two files record the cluster settings, configurations and status before shutting down and after rebooting. It is helpful for troubleshooting.</p>]]></content:encoded>
            <category>harvester</category>
            <category>cluster</category>
            <category>shutdown</category>
            <category>poweroff</category>
            <category>replacing</category>
            <category>rancher</category>
        </item>
        <item>
            <title><![CDATA[Best Practices for Harvester Security]]></title>
            <link>https://harvesterhci.io/kb/harvester_security_best_practices</link>
            <guid>harvester_security_best_practices</guid>
            <pubDate>Fri, 31 May 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[A set of best practices for Harvester security.]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="user-provided-credentials-on-harvester">User-Provided Credentials on Harvester<a class="hash-link" href="#user-provided-credentials-on-harvester" title="Direct link to heading">​</a></h2><p>When <a href="https://docs.harvesterhci.io/v1.2/install/index#installation-steps" target="_blank" rel="noopener noreferrer">installing a Harvester cluster</a>, you are asked to provide the following credential related information:</p><ul><li><p>Cluster token of the first node that is added to the cluster. Other nodes must use this token to join the cluster.</p></li><li><p>Password for the default Linux user <code>rancher</code> on each node.</p></li><li><p>SSH keys on each node (optional).</p></li><li><p>HTTP proxy on each node (optional).</p></li></ul><p>You may plan to change them from time to time, the following paragraphs describe the detailed steps.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="cluster-token">Cluster Token<a class="hash-link" href="#cluster-token" title="Direct link to heading">​</a></h3><h4 class="anchor anchorWithStickyNavbar_mojV" id="cluster-token-on-nodes-joining-an-existing-cluster">Cluster Token on Nodes Joining an Existing Cluster<a class="hash-link" href="#cluster-token-on-nodes-joining-an-existing-cluster" title="Direct link to heading">​</a></h4><p>When a node is unable to join a cluster because of a cluster token error, perform the recommended <a href="https://docs.harvesterhci.io/v1.2/troubleshooting/index/#modifying-cluster-token-on-agent-nodes" target="_blank" rel="noopener noreferrer">troubleshooting steps</a>.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="cluster-token-rke2-token-rotation">Cluster Token (RKE2 Token Rotation)<a class="hash-link" href="#cluster-token-rke2-token-rotation" title="Direct link to heading">​</a></h4><p>Harvester does not allow you to change the cluster token even if RKE2 is a core component of Harvester.</p><p>The <a href="https://docs.rke2.io/security/token#server-token-rotation" target="_blank" rel="noopener noreferrer">RKE2 documentation</a> states that the November 2023 releases of RKE2 (v1.28.3+rke2r2, v1.27.7+rke2r2, v1.26.10+rke2r2, and v1.25.15+rke2r2) allow you to rotate the cluster token using the command <code>rke2 token rotate --token original --new-token new</code>. </p><p>During testing, the command was run on the first node of a cluster running <strong>Harvester v1.3.0 with RKE2 v1.27.10+rke2r1</strong>.</p><ol><li>Rotate the token on initial node.</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">/opt/rke2/bin $ ./rke2 token rotate --token rancher --new-token rancher1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">WARNING: Recommended to keep a record of the old token. If restoring from a snapshot, you must use the token associated with that snapshot.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">WARN[0000] Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash. Use the full token from the server's node-token file to enable Cluster CA validation. </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Token rotated, restart rke2 nodes with new token</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>When the first cluster node was rebooted, RKE2 service was unable to start.</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">RKE2 log:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">May 29 15:45:11 harv41 rke2[3293]: time="2024-05-29T15:45:11Z" level=info msg="etcd temporary data store connection OK"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">May 29 15:45:11 harv41 rke2[3293]: time="2024-05-29T15:45:11Z" level=info msg="Reconciling bootstrap data between datastore and disk"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">May 29 15:45:11 harv41 rke2[3293]: time="2024-05-29T15:45:11Z" level=fatal msg="Failed to reconcile with temporary etcd: bootstrap data already found and encrypted with different token"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">May 29 15:45:11 harv41 systemd[1]: rke2-server.service: Main process exited, code=exited, status=1/FAILURE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This known issue was logged on Github issue <a href="https://github.com/rancher/rke2/issues/6250" target="_blank" rel="noopener noreferrer">rke2 token rotate does not work as expected (v1.27.10+rke2r1)</a>.</p><p>:::Warning</p><p>Do not attempt to rotate the RKE2 token on your cluster before Harvester announces official support for this feature (even if the embedded RKE2 binary has the <code>token rotate</code> option).</p><p>:::</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="password-of-the-default-user-rancher">Password of the Default User <code>rancher</code><a class="hash-link" href="#password-of-the-default-user-rancher" title="Direct link to heading">​</a></h3><p>This process is node-specific. You must change the <a href="https://docs.harvesterhci.io/v1.2/install/update-harvester-configuration/#password-of-user-rancher" target="_blank" rel="noopener noreferrer">password of the default user</a> on each node even if the same password is used on all Harvester nodes.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="ssh-keys">SSH keys<a class="hash-link" href="#ssh-keys" title="Direct link to heading">​</a></h3><p>You must log into a Harvester node using the default user account <code>rancher</code> to change the <a href="https://docs.harvesterhci.io/v1.2/install/update-harvester-configuration#ssh-keys-of-user-rancher" target="_blank" rel="noopener noreferrer">SSH keys</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="http-proxy">HTTP Proxy<a class="hash-link" href="#http-proxy" title="Direct link to heading">​</a></h3><p>After a Harvester cluster is installed, you can use the Harvester UI to change the <a href="https://docs.harvesterhci.io/v1.2/advanced/index#http-proxy" target="_blank" rel="noopener noreferrer">HTTP proxy</a>.</p><p>Alternatively, you can use <code>kubectl</code> or the rest API against the URI <code>/harvesterhci.io.setting/http-proxy</code>.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl get settings.harvesterhci.io http-proxy -oyaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default: '{}'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: Setting</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  creationTimestamp: "2024-05-13T20:44:20Z"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  generation: 1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: http-proxy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  resourceVersion: "5914"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  uid: 282506bb-f1dd-4247-bf0e-93640698c1f5</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">status: {}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Harvester has a webhook that checks this setting to ensure it meets all conditions, e.g. the internal IPs and CIDRs are specified in the <code>noProxy</code> field.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Avoid changing the HTTP proxy from files in the host <code>/oem</code> path for the following reasons:</p><ul><li><p>You must manually change the HTTP proxy on each node.</p></li><li><p>Contents of local files are not automatically populated to new nodes.</p></li><li><p>Without help from the webhook, some erroneous configurations may not be promptly detected (see <a href="https://github.com/harvester/harvester/pull/5824" target="_blank" rel="noopener noreferrer">Node IP should be in noProxy</a>).</p></li><li><p>Harvester may change the file naming or content structure in the future.</p></li></ul></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="other-credentials-and-settings">Other Credentials and Settings<a class="hash-link" href="#other-credentials-and-settings" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="auto-rotate-rke2-certs"><code>auto-rotate-rke2-certs</code><a class="hash-link" href="#auto-rotate-rke2-certs" title="Direct link to heading">​</a></h3><p>Harvester is built on top of Kubernetes, RKE2, and Rancher. RKE2 generates a list of <code>*.crt</code> and <code>*.key</code> files that allow Kubernetes components to function. The <code>*.crt</code> file expires after one year by default.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ ls /var/lib/rancher/rke2/server/tls/ -alth</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root  570 May 27 08:45 server-ca.nochain.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw------- 1 root root 1.7K May 27 08:45 service.current.key</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root  574 May 27 08:45 client-ca.nochain.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">drwxr-xr-x 2 root root 4.0K May 13 20:45 kube-controller-manager</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">drwxr-xr-x 2 root root 4.0K May 13 20:45 kube-scheduler</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">drwx------ 6 root root 4.0K May 13 20:45 .</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">drwx------ 8 root root 4.0K May 13 20:45 ..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root 3.9K May 13 20:40 dynamic-cert.json</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">drwx------ 2 root root 4.0K May 13 20:39 temporary-certs</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw------- 1 root root 1.7K May 13 20:39 service.key</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root 1.2K May 13 20:39 client-auth-proxy.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw------- 1 root root  227 May 13 20:39 client-auth-proxy.key</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root 1.2K May 13 20:39 client-rke2-cloud-controller.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw-r--r-- 1 root root 1.2K May 13 20:39 client-admin.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">-rw------- 1 root root  227 May 13 20:39 client-admin.key</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ openssl x509 -enddate -noout -in /var/lib/rancher/rke2/server/tls/client-admin.crt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">notAfter=May 13 20:39:42 2025 GMT</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>When a cluster has been running for over one year, Kubernetes components may fail to start after upgrades or node rebooting. The <a href="https://github.com/harvester/harvester/issues/3863#issuecomment-1539681311" target="_blank" rel="noopener noreferrer">workaround</a> is to delete the related files and restart the pod.</p><p>Harvester v1.3.0 added the setting <a href="https://docs.harvesterhci.io/v1.3/advanced/index#auto-rotate-rke2-certs" target="_blank" rel="noopener noreferrer"><code>auto-rotate-rke2-certs</code></a>, which allows you to set the Harvester cluster to automatically rotate certificates for RKE2 services. When you enable the setting and specify a certificate validity period, Harvester automatically replaces the certificate before the specified period ends.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Enabling this setting on your cluster is highly recommended.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="harvester-cloud-credentials">Harvester Cloud Credentials<a class="hash-link" href="#harvester-cloud-credentials" title="Direct link to heading">​</a></h3><p>See the article <a href="https://harvesterhci.io/kb/renew_harvester_cloud_credentials" target="_blank" rel="noopener noreferrer">Renew Harvester Cloud Credentials</a>.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="additional-ca"><code>additional-ca</code><a class="hash-link" href="#additional-ca" title="Direct link to heading">​</a></h3><p>See the <a href="https://docs.harvesterhci.io/v1.2/advanced/index#additional-ca" target="_blank" rel="noopener noreferrer">documentation</a> for this setting.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="ssl-certificates"><code>ssl-certificates</code><a class="hash-link" href="#ssl-certificates" title="Direct link to heading">​</a></h3><p>See the <a href="https://docs.harvesterhci.io/v1.2/advanced/index#ssl-certificates" target="_blank" rel="noopener noreferrer">documentation</a> for this setting.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="ssl-parameters"><code>ssl-parameters</code><a class="hash-link" href="#ssl-parameters" title="Direct link to heading">​</a></h3><p>See the <a href="https://docs.harvesterhci.io/v1.2/advanced/index#ssl-parameters" target="_blank" rel="noopener noreferrer">documentation</a> for this setting.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="containerd-registry"><code>containerd-registry</code><a class="hash-link" href="#containerd-registry" title="Direct link to heading">​</a></h3><p>See the <a href="https://docs.harvesterhci.io/v1.2/advanced/index#containerd-registry" target="_blank" rel="noopener noreferrer">documentation</a> for this setting.</p>]]></content:encoded>
            <category>harvester</category>
            <category>security</category>
            <category>credential</category>
        </item>
        <item>
            <title><![CDATA[Renew Harvester Cloud Credentials]]></title>
            <link>https://harvesterhci.io/kb/renew_harvester_cloud_credentials</link>
            <guid>renew_harvester_cloud_credentials</guid>
            <pubDate>Fri, 17 May 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[How to renew expired Harvester cloud credentials when using Rancher 2.8.x.]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="expiration-of-kubeconfig-tokens-in-rancher-28x">Expiration of kubeconfig Tokens in Rancher 2.8.x<a class="hash-link" href="#expiration-of-kubeconfig-tokens-in-rancher-28x" title="Direct link to heading">​</a></h2><p>In Rancher 2.8.x, the default value of the <a href="https://ranchermanager.docs.rancher.com/api/api-tokens#kubeconfig-default-token-ttl-minutes" target="_blank" rel="noopener noreferrer">kubeconfig-default-token-ttl-minutes</a> setting is <code>30</code> days.</p><p>A side effect of using this default value is the expiration of authentication tokens embedded in kubeconfigs that Rancher uses to provision guest Kubernetes clusters on Harvester. When such tokens expire, Rancher loses the ability to perform management operations for the corresponding Rancher-managed guest Kubernetes clusters. <a href="https://github.com/rancher/rancher/issues/44912" target="_blank" rel="noopener noreferrer">Issue #44912</a> tracks the issue described in this article.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>The issue affects only guest Kubernetes clusters running on Harvester that use cloud credentials created after installing or upgrading to Rancher v2.8.x.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="workaround">Workaround<a class="hash-link" href="#workaround" title="Direct link to heading">​</a></h2><p>You can patch the expired Harvester cloud credentials to use a new authentication token.</p><ol><li><p>Identify the expired cloud credentials and which Harvester cluster is
affected by them.</p><p><img loading="lazy" alt="identify-credentials" src="/assets/images/identify-cloud-credential-96a0eea63d2ff91994343792fff4065f.png" width="2231" height="980"></p></li><li><p>Download a new kubeconfig file for the affected Harvester cluster.</p><p><img loading="lazy" alt="context-menu" src="/assets/images/harvester-renew-kubeconfig-menu-988dc9a3898df89b96f1933a2455a0da.png" width="2037" height="945"></p></li><li><p>Patch the cloud credentials. The cloud credential is stored as a secret in <code>cattle-global-data</code> namespace, and can be replaced with the new kubeconfig file. Ensure that the environment variable <code>KUBECONFIG_FILE</code> contains the path to the new kubeconfig file.</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token shebang important">#!/bin/sh</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token assign-left variable" style="color:#36acaa">CLOUD_CREDENTIAL_ID</span><span class="token operator" style="color:#393A34">=</span><span class="token variable" style="color:#36acaa">$1</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># .metadata.name of the cloud credential</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token assign-left variable" style="color:#36acaa">KUBECONFIG_FILE</span><span class="token operator" style="color:#393A34">=</span><span class="token variable" style="color:#36acaa">$2</span><span class="token plain">      </span><span class="token comment" style="color:#999988;font-style:italic"># path to the downloaded kubeconfig file</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token assign-left variable" style="color:#36acaa">kubeconfig</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">"</span><span class="token string variable" style="color:#36acaa">$(</span><span class="token string variable" style="color:#36acaa">base64 -w </span><span class="token string variable number" style="color:#36acaa">0</span><span class="token string variable" style="color:#36acaa"> </span><span class="token string variable string" style="color:#e3116c">"</span><span class="token string variable string variable" style="color:#36acaa">${KUBECONFIG_FILE}</span><span class="token string variable string" style="color:#e3116c">"</span><span class="token string variable" style="color:#36acaa">)</span><span class="token string" style="color:#e3116c">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token assign-left variable" style="color:#36acaa">patch_file</span><span class="token operator" style="color:#393A34">=</span><span class="token variable" style="color:#36acaa">$(</span><span class="token variable" style="color:#36acaa">mktemp</span><span class="token variable" style="color:#36acaa">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">cat</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token variable" style="color:#36acaa">${patch_file}</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&lt;&lt;</span><span class="token string" style="color:#e3116c">EOF</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">data:</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">  harvestercredentialConfig-kubeconfigContent: </span><span class="token string variable" style="color:#36acaa">$kubeconfig</span><span class="token string" style="color:#e3116c"></span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">EOF</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch secret </span><span class="token variable" style="color:#36acaa">${CLOUD_CREDENTIAL_ID}</span><span class="token plain"> -n cattle-global-data --patch-file </span><span class="token variable" style="color:#36acaa">${patch_file}</span><span class="token plain"> --type merge</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">rm</span><span class="token plain"> </span><span class="token variable" style="color:#36acaa">${patch_file}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>macOS users must use <code>gbase64</code> to ensure that the <code>-w</code> flag is supported.</p></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="expiration-of-kubeconfig-tokens-in-rancher-293">Expiration of kubeconfig Tokens in Rancher 2.9.3<a class="hash-link" href="#expiration-of-kubeconfig-tokens-in-rancher-293" title="Direct link to heading">​</a></h2><p>In Rancher 2.9.3 the Rancher UI displays a warning when a Harvester cloud credential or a related cluster contains an expired token. You can renew the token on the <strong>Cloud Credentials</strong> screen by selecting <strong>⋮ &gt; Renew</strong>, or the Clusters screen by selecting <strong>⋮ &gt; Renew Cloud Credential</strong></p><p><img loading="lazy" alt="cc-renew" src="/assets/images/cc-renew-b94bcdd9ea16e36ced4101021ed3bacb.png" width="1481" height="444"></p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>When you upgrade Rancher, the Rancher UI does not display a warning for Harvester cloud credentials that expired before the upgrade was started. However, you can still renew the token on the <strong>Cloud Credentials</strong> or <strong>Clusters</strong> screen.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="expiration-of-kubeconfig-tokens-in-rancher-294-and-later-versions">Expiration of kubeconfig Tokens in Rancher 2.9.4 and later versions<a class="hash-link" href="#expiration-of-kubeconfig-tokens-in-rancher-294-and-later-versions" title="Direct link to heading">​</a></h2><p>As previous versions, however now all expired Harvester cloud credentials will display a warning regardless of Rancher upgrade history.</p>]]></content:encoded>
            <category>harvester</category>
            <category>cloud credentials</category>
            <category>rancher</category>
        </item>
        <item>
            <title><![CDATA[Configuring Harvester to Boot from an iSCSI Root Disk in Special Circumstances]]></title>
            <link>https://harvesterhci.io/kb/install_iscsi_firmware_install_boot</link>
            <guid>install_iscsi_firmware_install_boot</guid>
            <pubDate>Tue, 05 Mar 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[How to modify GRUB configuration so Harvester will use system firmware to access an iSCSI boot/root disk]]></description>
            <content:encoded><![CDATA[<p>Through v1.3.0, no explicit support has been provided for using Harvester (installing, booting, and running) with any type of storage that is not locally attached. This is in keeping with the philosophy of Hyper-Converged Infrastructure (HCI), which by definition hosts computational capability, storage, and networking in a single device or a set of similar devices operating in a cluster.</p><p>However, there are certain limited conditions that allow Harvester to be used on nodes without locally-attached bootable storage devices. Specifically, the use of converged network adapters (CNAs) as well as manual changes to the boot loader configuration of the installed system are required.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="concepts-requirements-and-limitations">Concepts, Requirements, and Limitations<a class="hash-link" href="#concepts-requirements-and-limitations" title="Direct link to heading">​</a></h2><p>This section describes background concepts and outlines requirements and limitations that you must consider before performing the procedure. For more information about the described concepts, see the references listed at the end of this article.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="iscsi-concepts-and-terminology">iSCSI Concepts and Terminology<a class="hash-link" href="#iscsi-concepts-and-terminology" title="Direct link to heading">​</a></h3><p>SCSI (Small Computer System Interface) is a set of standards for transferring data between computers systems and I/O devices. It is primarily used with storage devices.</p><p>The SCSI standards specify the following:</p><ul><li><strong>SCSI protocol</strong>: A set of message formats and rules of exchange</li><li><strong>SCSI transports</strong>: Methods for physically connecting storage devices to the computer system and transferring SCSI messages between them</li></ul><p>A number of SCSI transports are defined, including the following:</p><ul><li><strong>SAS (Serial Attached SCSI)</strong> and <strong>UAS (USB Attached SCSI)</strong>: Used to access SCSI storage devices that are directly attached to the computers using that storage</li><li><strong>FCP (Fibre Channel Protocol)</strong> and <strong>iSCSI (Internet SCSI)</strong>: Permit computer systems to access storage via a Storage Area Network (SAN), where the storage devices are attached to a system other than the computers using that storage</li></ul><p>The SCSI protocol is a client-server protocol, which means that all interaction occurs between clients that send requests and a server that services the requests. In the SCSI context, the client is called the <strong>initiator</strong> and the server is called the <strong>target</strong>. iSCSI initiators and targets identify themselves using a specially formatted identifier called an <strong>iSCSI qualified name (IQN)</strong>. The controller used to provide access to the storage devices is commonly called a <strong>host bus adapter (HBA)</strong>.</p><p>When using iSCSI, access is provided by a traditional Internet protocol, with an extra layer to encapsulate SCSI commands within TCP/IP messages. This can be implemented entirely in software (transferring messages using a traditional NIC), or it can be "offloaded" to a "smart" NIC that contains the iSCSI protocol and provides access through special firmware. Such NICs, which provide both a traditional Ethernet interface for regular Internet traffic and a higher-level storage interface for iSCSI services, are often called <strong>converged network adapters (CNAs)</strong>.</p><p>Systems with iSCSI CNAs can be configured to enable the system bootstrap firmware to boot the system via iSCSI. In addition, if the loaded operating system is aware of such an interface provided by the CNA, it can access the bootstrap device using that firmware interface <em>as if it were a locally attached device</em> without requiring initialization of the operating system's full software iSCSI protocol machinery.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="additional-concepts-and-terminology">Additional Concepts and Terminology<a class="hash-link" href="#additional-concepts-and-terminology" title="Direct link to heading">​</a></h3><p>Harvester must be installed on a bootable storage device, which is referred to as the <em>boot disk</em>.</p><p>Other storage devices, which are referred to as <em>non-boot disks</em>, may also be used in the Harvester ecosystem.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="requirements">Requirements<a class="hash-link" href="#requirements" title="Direct link to heading">​</a></h3><p>You must install Harvester on a node with a converged NIC that provides iSCSI offload capability with firmware support. This firmware must specifically support the iSCSI Boot Firmware Table (iBFT).</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>The procedure was tested with the following:</p><ul><li>Harvester v1.2.1 and v1.3.0</li><li>Dell PowerEdge R650 (Other systems with comparable hardware and firmware iSCSI support may also be suitable.)</li></ul></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="limitations">Limitations<a class="hash-link" href="#limitations" title="Direct link to heading">​</a></h3><p>The procedure will not work in environments with the following conditions:</p><ul><li>iSCSI is not implemented in a converged NIC.</li><li>Nodes boot via PXE.</li><li>Harvester is installed only on virtual machines.</li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="procedure">Procedure<a class="hash-link" href="#procedure" title="Direct link to heading">​</a></h2><p>The following is a summary of the procedure. Individual steps, which are described in the following sections, must be performed interactively. A fully automated installation is <strong>not</strong> possible at this time.</p><ol><li>Provision storage for your Harvester node on your iSCSI server system.</li><li>Configure system firmware to boot via iSCSI using the available CNA.</li><li>Boot the Harvester install image and install to the iSCSI device.</li><li>On first Harvester boot after installation, edit the kernel boot parameters in the GRUB kernel command line.</li><li>Permanently edit the GRUB configuration file in the normally read-only partition.</li></ol><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>The boot configuration changes will persist across node reboots but <strong>not</strong> across system upgrades, which will overwrite the GRUB parameters. </p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="1-provision-storage-for-your-harvester-node-on-your-iscsi-server-system">1. Provision storage for your Harvester node on your iSCSI server system.<a class="hash-link" href="#1-provision-storage-for-your-harvester-node-on-your-iscsi-server-system" title="Direct link to heading">​</a></h3><p>Before attempting to install Harvester onto a disk accessed by iSCSI,
the storage must first be provisioned on the storage server.</p><p>The details depend on the storage server and will not be discussed here.</p><p>However, several pieces of information must be obtained
in order for the system being installed to be able
to access the storage using iSCSI.</p><ul><li>The IP address and port number of the iSCSI server.</li><li>The iSCSI Qualified Name (IQN) of the iSCSI target on the server.</li><li>The LUN of the volume on the server to be accessed from the client as the disk on which Harvester will be installed.</li><li>Depending on on how the server is administered, authentication parameters may also be required.</li></ul><p>These items of information will be determined by the server system.</p><p>In addition, an IQN must be chosen for the client system to be used as its initiator identifier.</p><p>An IQN is a string in a certain format.
In general, any string in the defined format can be used as long as it is unique.
However, specific environments may place stricter requirements on the choice of names.</p><p>The format of an IQN is illustrated in the following example:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    iqn.2024-02.com.example:cluster1-node0-boot-disk</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>There are lots of variations of this format, and this is just an example.</p><p>The correct name to use should be chosen in consultation with the administrator of your storage server and storage area network.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="2-configure-system-firmware-to-boot-via-iscsi-using-the-available-cna">2. Configure system firmware to boot via iSCSI using the available CNA.<a class="hash-link" href="#2-configure-system-firmware-to-boot-via-iscsi-using-the-available-cna" title="Direct link to heading">​</a></h3><p>When your system to be installed powers on or is reset, you must enter the firmware setup menu to change the boot settings and enable booting via iSCSI.</p><p>Precise details for this are difficult to provide because they vary from system to system.</p><p>It is typical to force the system to enter the firmware settings menu by typing a special key such as F2, F7, ESC, etc.
Which one works for your system varies.
Often the system will display a list of which key(s) are available for specific firmware functions,
but it is not uncommon for the firmware to erase this list and start to boot after only a very short delay,
so you have to pay close attention.</p><p>If in doubt, consult the system provider's documentation.
An example document link is provided in the References section.
Other vendors should provide similar documentation.</p><p>The typical things you need to configure are:</p><ul><li>Enable UEFI boot</li><li>Configure iSCSI initiator and target parameters</li><li>Enable the iSCSI device in the boot menu</li><li>Set the boot order so that your system will boot from the iSCSI device</li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="boot-the-harvester-install-image-and-install-to-the-iscsi-device">Boot the Harvester install image and install to the iSCSI device<a class="hash-link" href="#boot-the-harvester-install-image-and-install-to-the-iscsi-device" title="Direct link to heading">​</a></h3><p>This can be done by whatever means you would normally use to load the Harvester install image.</p><p>The Harvester installer <em>should</em> automatically "see" the iSCSI device in the dialog where you chose the installation destination.
Choose this device to install.</p><p>Installation should proceed and complete normally.</p><p>When installation completes, your system should reboot.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="4-on-first-boot-edit-kernel-boot-parameters-in-the-grub-kernel-command-line">4. On first boot, edit kernel boot parameters in the GRUB kernel command line.<a class="hash-link" href="#4-on-first-boot-edit-kernel-boot-parameters-in-the-grub-kernel-command-line" title="Direct link to heading">​</a></h3><p>As your system starts to come up after the first reboot,
the firmware will load the boot loader (GRUB) from the iSCSI device,
and GRUB will be able to use this device to load the kernel.</p><p>However, the kernel will <strong>not</strong> be aware of the iSCSI boot disk <strong>unless</strong> you modify the kernel parameters in the GRUB command line.</p><p>If you don't modify the kernel parameters, then system startup procedures will fail to find the <code>COS_OEM</code> and other paritions on the boot disk,
and it will be unable to access the <code>cloud-init</code> configuration or any of the container images needed to </p><p>The first time the GRUB menu appears after installation, you should stop the GRUB boot loader from automatically loading the kernel,
and edit the kernel command line.</p><p>To stop GRUB from automatically loading the kernel, hit the ESC key as soon as the menu appears.
You will only have a few seconds to do this before the system automatically boots.</p><p>Then, type "e" to edit the GRUB configuration for the first boot option.</p><p>It will show you something similar to the following:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">setparams 'Harvester v1.3.0'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  # label is kept around for backward compatibility</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  set label=${active_label}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  set img=/cOS/active.img</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  loopback $loopdev /$img</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  source $(loopdev)/etc/cos/bootargs.cfg</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  linux ($loopdev)$kernel $kernelcmd ${extra_cmdline} ${extra_active_cmdline}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  initrd ($loopdev)$initramfs</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Move the cursor down to the line that begins with <code>linux</code>, and move the cursor to the end of that line.</p><p>Append the following string (two parameters): <code>rd.iscsi.firmware rd.iscsi.ibft</code>.</p><p>The line beginning with <code>linux</code> should now look like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">  linux ($loopdev)$kernel $kernelcmd ${extra_cmdline} ${extra_active_cmdline} rd.iscsi.firmware rd.iscsi.ibft</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>At this point, type Ctrl-X to resume booting with the modified kernel command line.</p><p>Now the node should come up normally, and finish with the normal Harvester console screen that shows the cluster and node IP addresses and status.</p><p>The the node should operate normally now <strong>but</strong> the kernel boot argument changes will not be preserved across a reboot unless you perform the next step.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="5-permanently-edit-the-grub-configuration-file">5. Permanently edit the GRUB configuration file.<a class="hash-link" href="#5-permanently-edit-the-grub-configuration-file" title="Direct link to heading">​</a></h3><p>At this point you need to preserve these boot argument changes.</p><p>You can do this from the console by pressing F12 and logging in, or you can use an SSH session over the network.</p><p>The changes must be made permanent by editing the GRUB configuration file <code>grub.cfg</code>.</p><p>The trick here is that the file to be changed is stored in a partition which is normally <strong>read-only</strong>,
so the first thing you must do is to re-mount the volume to be read-write.</p><p>Start out by using the <code>blkid</code> command to find the device name of the correct partition:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    $ sudo -i</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    # blkid -L COS_STATE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    /dev/sda4</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    #</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The device name will be something like <code>/dev/sda4</code>.  The following examples assume that's the name but you should modify the commands to match what you see on your system.</p><p>Now, re-mount that volume to make it writable:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># mount -o remount -rw /dev/sda4 /run/initramfs/cos-state</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Next, edit the <code>grub.cfg</code> file.</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># vim /run/initramfs/cos-state/grub2/grub.cfg</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Look for <code>menuentry</code> directives.  There will be several of these; at least one as a fallback, and one for recovery.  You should apply the same change to all of them.</p><p>In each of these, edit the line beginning with <code>linux</code> just as you did for the interactive GRUB menu, appending <code> rd.iscsi.firmware rd.iscsi.ibft</code> to the arguments.</p><p>Then save the changes.</p><p>It is not necessary, but probably advisable to remount that volume again to return it to its read-only state:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># mount -o remount -ro /dev/sda4 /run/initramfs/cos-state</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>From this point on, these changes will persist across node reboots.</p><p>A few important notes:</p><ul><li>You must perform this same procedure for every node of your cluster that you are booting with iSCSI.</li><li>These changes will be overwritten by the upgrade procedure if you upgrade your cluster to a newer version of Harvester.  Therefore, if you do an upgrade, be sure to re-do the procedure to edit the <code>grub.cfg</code> on every node of your cluster that is booting by iSCSI.</li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><ul><li><a href="https://en.wikipedia.org/wiki/SCSI" target="_blank" rel="noopener noreferrer">SCSI</a> provides an overview of SCSI and contains references to additional material.</li><li><a href="https://en.wikipedia.org/wiki/ISCSI" target="_blank" rel="noopener noreferrer">iSCSI</a> provides an overview of iSCSI and contains references to additional material.</li><li><a href="https://en.wikipedia.org/wiki/Converged_network_adapter" target="_blank" rel="noopener noreferrer">Converged Network Adapter</a> provides a summary of CNAs and references to additional material.</li><li><a href="https://docs.harvesterhci.io/v1.2/troubleshooting/os/#how-to-permanently-edit-kernel-parameters" target="_blank" rel="noopener noreferrer">Harvester Docuementation</a> provides a general description of how to permanently edit kernel parameters to be used when booting a Harvester node.</li><li><a href="https://www.dell.com/support/manuals/en-us/poweredge-r630/r630_om_pub/uefi-iscsi-settings?guid=guid-adc7d625-5c7b-469d-ba9c-4a2c704fcc49&amp;lang=en-us" target="_blank" rel="noopener noreferrer">Dell PowerEdge R630 Owner's Manual</a> This is an example of relevant vendor documentation.  Other vendors such as HPE, IBM, Lenovo, etc should provide comparable documentation, though the details will vary.</li></ul>]]></content:encoded>
            <category>harvester</category>
        </item>
        <item>
            <title><![CDATA[Mitigating filesystem trim Risk]]></title>
            <link>https://harvesterhci.io/kb/the_potential_risk_with_filesystem_trim</link>
            <guid>the_potential_risk_with_filesystem_trim</guid>
            <pubDate>Tue, 30 Jan 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[The potential risk with filesystem trim and how to avoid it]]></description>
            <content:encoded><![CDATA[<p>Filesystem trim is a common way to release unused space in a filesystem. However, this operation is known to cause IO errors when used with Longhorn volumes that are rebuilding. For more information about the errors, see the following issues:</p><ul><li>Harvester: <a href="https://github.com/harvester/harvester/issues/4739" target="_blank" rel="noopener noreferrer">Issue 4793</a></li><li>Longhorn: <a href="https://github.com/longhorn/longhorn/issues/7103" target="_blank" rel="noopener noreferrer">Issue 7103</a></li></ul><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</h5></div><div class="admonition-content"><p>Filesystem trim was introduced in Longhorn v1.4.0 because of <a href="https://github.com/longhorn/longhorn/issues/836" target="_blank" rel="noopener noreferrer">Issue 836</a>.</p><p>Longhorn volumes affected by the mentioned IO errors can disrupt operations in Harvester VMs that use those volumes. If you are using any of the affected Harvester versions, upgrade to a version with fixes or follow the instructions for risk mitigation in this article.</p><p><strong>Affected Harvester versions</strong>: v1.2.0 (uses Longhorn v1.4.3), v1.2.1 (uses Longhorn v1.4.3), and v1.3.0 (uses Longhorn v1.6.0)</p><p><strong>Harvester versions with fixes</strong>: v1.2.2 (uses Longhorn v1.5.5) and v1.3.1 (uses Longhorn v1.6.2)</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="risks-associated-with-filesystem-trim">Risks Associated with Filesystem Trim<a class="hash-link" href="#risks-associated-with-filesystem-trim" title="Direct link to heading">​</a></h2><p>A consequence of the IO errors caused by filesystem trim is that VMs using affected Longhorn volumes become stuck. Imagine the VM is running critical applications, then becomes unavailable. This is significant because Harvester typically uses Longhorn volumes as VM disks. The IO errors will cause VMs to flap between running and paused states until volume rebuilding is completed.</p><p>Although the described system behavior does not affect data integrity, it might induce panic in some users. Consider the guest Kubernetes cluster scenario. In a stuck VM, the etcd service is unavailable. The effects of this failure cascade from the Kubernetes cluster becoming unavailable to services running on the cluster becoming unavailable.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-check-if-filesystem-trim-is-enabled">How to Check If Filesystem Trim Is Enabled<a class="hash-link" href="#how-to-check-if-filesystem-trim-is-enabled" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="linux">Linux<a class="hash-link" href="#linux" title="Direct link to heading">​</a></h3><p>In most Linux distributions, filesystem trim is enabled by default. You can check if the related service fstrim is enabled by running the following command:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ systemctl status fstrim.timer</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">● fstrim.timer - Discard unused blocks once a week</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     Active: active (waiting) since Mon 2024-03-18 03:40:24 UTC; 1 week 1 day ago</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Trigger: Mon 2024-04-01 01:00:06 UTC; 5 days left</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">   Triggers: ● fstrim.service</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">       Docs: man:fstrim</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Mar 18 03:40:24 harvester-cluster-01-pool1-49b619f6-tpc4v systemd[1]: Started Discard unused blocks once a week.</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>When the fstrim.timer service is enabled, the system periodically runs fstrim.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="windows">Windows<a class="hash-link" href="#windows" title="Direct link to heading">​</a></h3><p>You can check if filesystem trim is enabled by running the following command:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">C:\&gt; fsutil behavior query DisableDeleteNotify</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NTFS DisableDeleteNotify = 0  (Allows TRIM operations to be sent to the storage device)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">ReFS DisableDeleteNotify = 0  (Allows TRIM operations to be sent to the storage device)</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><code>DisableDeleteNotify = 0</code> indicates that TRIM operations are enabled. For more information, see <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior" target="_blank" rel="noopener noreferrer">fsutil behavior</a> in the Microsoft documentation.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="risk-mitigation">Risk Mitigation<a class="hash-link" href="#risk-mitigation" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="linux-1">Linux<a class="hash-link" href="#linux-1" title="Direct link to heading">​</a></h3><p>One way to mitigate the described risks is to disable fstrim services in VMs. fstrim services is enabled by default in many modern Linux distributions.
You can determine if fstrim is enabled in VMs that use affected Longhorn volumes by checking the following:</p><ul><li><p><code>/etc/fstab</code>: Some root filesystems mount with the <em>discard</em> option.</p><p>Example:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">/dev/mapper/rootvg-rootlv /                       xfs     defaults,discard        0 0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>You can disable fstrim on the root filesystem by removing the <em>discard</em> option.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">/dev/mapper/rootvg-rootlv /                       xfs     defaults        0 0   &lt;-- remove the discard option</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After removing the <em>discard</em> option, you can remount the root filesystem using the command <code>mount -o remount /</code> or by rebooting the VM.</p></li><li><p><code>fstrim.timer</code>: When this service is enabled, fstrim executes weekly by default. You can either disable the service or edit the service file to prevent simultaneous fstrim execution on VMs.</p><p>You can disable the service using the following command:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">systemctl disable fstrim.timer</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>To prevent simultaneous fstrim execution, use the following values in the service file (located at <code>/usr/lib/systemd/system/fstrim.timer</code>):</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">[Timer]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">OnCalendar=weekly</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AccuracySec=1h</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Persistent=true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">RandomizedDelaySec=6000</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="windows-1">Windows<a class="hash-link" href="#windows-1" title="Direct link to heading">​</a></h3><p>To mitigate the described risks, you can disable TRIM operations using the following commands:</p><ul><li><p>ReFS v2</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">C:\&gt; fsutil behavior set DisableDeleteNotify ReFS 1</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>NTFS and ReFS v1</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">C:\&gt; fsutil behavior set DisableDeleteNotify 1</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>rancher integration</category>
            <category>longhorn</category>
            <category>filesystem trim</category>
        </item>
        <item>
            <title><![CDATA[Calculation of Resource Metrics in Harvester]]></title>
            <link>https://harvesterhci.io/kb/calculation_of_resource_metrics_in_harvester</link>
            <guid>calculation_of_resource_metrics_in_harvester</guid>
            <pubDate>Tue, 23 Jan 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Understand how resource metrics are calculated.]]></description>
            <content:encoded><![CDATA[<p>Harvester calculates the resource metrics using data that is dynamically collected from the system. Host-level resource metrics are calculated and then aggregated to obtain the cluster-level metrics.</p><p>You can view resource-related metrics on the Harvester UI.</p><ul><li><p><strong>Hosts</strong> screen: Displays host-level metrics</p><p><img loading="lazy" alt="host level resources metrics" src="/assets/images/host-resource-usage-3f7d2c16335caae1ef42aa94f62a0dcb.png" width="3198" height="606"></p></li><li><p><strong>Dashboard</strong> screen: Displays cluster-level metrics</p><p><img loading="lazy" alt="cluster level resources metrics" src="/assets/images/cluster-resource-usage-6165985252a3fce5f61a11807124c423.png" width="3168" height="488"></p></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="cpu-and-memory">CPU and Memory<a class="hash-link" href="#cpu-and-memory" title="Direct link to heading">​</a></h2><p>The following sections describe the data sources and calculation methods for CPU and memory resources.</p><ul><li>Resource capacity: Baseline data</li><li>Resource usage: Data source for the <strong>Used</strong> field on the <strong>Hosts</strong> screen</li><li>Resource reservation: Data source for the <strong>Reserved</strong> field on the <strong>Hosts</strong> screen</li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="resource-capacity">Resource Capacity<a class="hash-link" href="#resource-capacity" title="Direct link to heading">​</a></h3><p>In Kubernetes, a <code>Node</code> object is created for each host.</p><p>The <code>.status.allocatable.cpu</code> and <code>.status.allocatable.memory</code> represent the available CPU and Memory resources of a host.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># kubectl get nodes -A -oyaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">items:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">- apiVersion: v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  kind: Node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      management.cattle.io/pod-limits: '{"cpu":"12715m","devices.kubevirt.io/kvm":"1","devices.kubevirt.io/tun":"1","devices.kubevirt.io/vhost-net":"1","memory":"17104951040"}'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      management.cattle.io/pod-requests: '{"cpu":"5657m","devices.kubevirt.io/kvm":"1","devices.kubevirt.io/tun":"1","devices.kubevirt.io/vhost-net":"1","ephemeral-storage":"50M","memory":"9155862208","pods":"78"}'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      node.alpha.kubernetes.io/ttl: "0"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    name: harv41</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    resourceVersion: "2170215"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    uid: b6f5850a-2fbc-4aef-8fbe-121dfb671b67</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    podCIDR: 10.52.0.0/24</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    podCIDRs:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - 10.52.0.0/24</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    providerID: rke2://harv41</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  status:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    addresses:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - address: 192.168.122.141</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      type: InternalIP</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - address: harv41</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      type: Hostname</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    allocatable:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      cpu: "10"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/kvm: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/tun: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/vhost-net: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      ephemeral-storage: "149527126718"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      hugepages-1Gi: "0"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      hugepages-2Mi: "0"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      memory: 20464216Ki</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      pods: "200"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    capacity:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      cpu: "10"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/kvm: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/tun: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      devices.kubevirt.io/vhost-net: 1k</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      ephemeral-storage: 153707984Ki</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      hugepages-1Gi: "0"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      hugepages-2Mi: "0"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      memory: 20464216Ki</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      pods: "200"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="resource-usage">Resource Usage<a class="hash-link" href="#resource-usage" title="Direct link to heading">​</a></h3><p>CPU and memory usage data is continuously collected and stored in the <code>NodeMetrics</code> object. Harvester reads the data from <code>usage.cpu</code> and <code>usage.memory</code>.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># kubectl get NodeMetrics -A -oyaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">items:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">- apiVersion: metrics.k8s.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  kind: NodeMetrics</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    name: harv41</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  timestamp: "2024-01-23T12:04:44Z"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  usage:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    cpu: 891736742n</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    memory: 9845008Ki</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  window: 10.149s</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="resource-reservation">Resource Reservation<a class="hash-link" href="#resource-reservation" title="Direct link to heading">​</a></h3><p>Harvester dynamically calculates the resource limits and requests of all pods running on a host, and updates the information to the annotations of the <code>NodeMetrics</code> object.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">      management.cattle.io/pod-limits: '{"cpu":"12715m",...,"memory":"17104951040"}'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      management.cattle.io/pod-requests: '{"cpu":"5657m",...,"memory":"9155862208"}'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>For more information, see <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits" target="_blank" rel="noopener noreferrer">Requests and Limits</a> in the Kubernetes documentation.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="storage">Storage<a class="hash-link" href="#storage" title="Direct link to heading">​</a></h2><p>Longhorn is the default Container Storage Interface (CSI) driver of Harvester, providing storage management features such as distributed block storage and tiering.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="reserved-storage-in-longhorn">Reserved Storage in Longhorn<a class="hash-link" href="#reserved-storage-in-longhorn" title="Direct link to heading">​</a></h3><p>Longhorn allows you to specify the percentage of disk space that is not allocated to the default disk on each new Longhorn node. The default value is "30". For more information, see <a href="https://longhorn.io/docs/1.5.3/references/settings/#storage-reserved-percentage-for-default-disk" target="_blank" rel="noopener noreferrer">Storage Reserved Percentage For Default Disk</a> in the Longhorn documentation.</p><p>Depending on the disk size, you can modify the default value using the <a href="https://docs.harvesterhci.io/v1.2/troubleshooting/harvester/#access-embedded-rancher-and-longhorn-dashboards" target="_blank" rel="noopener noreferrer">embedded Longhorn UI</a>.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>Before changing the settings, read the Longhorn documentation carefully.</p></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="data-sources-and-calculation">Data Sources and Calculation<a class="hash-link" href="#data-sources-and-calculation" title="Direct link to heading">​</a></h3><p>Harvester uses the following data to calculate metrics for storage resources.</p><ul><li><p>Sum of the <code>storageMaximum</code> values of all disks (<code>status.diskStatus.disk-name</code>): Total storage capacity</p></li><li><p>Total storage capacity - Sum of the <code>storageAvailable</code> values of all disks (<code>status.diskStatus.disk-name</code>): Data source for the <strong>Used</strong> field on the <strong>Hosts</strong> screen</p></li><li><p>Sum of the <code>storageReserved</code> values of all disks (<code>spec.disks</code>): Data source for the <strong>Reserved</strong> field on the <strong>Hosts</strong> screen</p></li></ul><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># kubectl get nodes.longhorn.io -n longhorn-system -oyaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">items:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">- apiVersion: longhorn.io/v1beta2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  kind: Node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    name: harv41</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    namespace: longhorn-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    allowScheduling: true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    disks:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      default-disk-ef11a18c36b01132:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        allowScheduling: true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        diskType: filesystem</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        evictionRequested: false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        path: /var/lib/harvester/defaultdisk</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        storageReserved: 24220101427</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        tags: []</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  status:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    diskStatus:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      default-disk-ef11a18c36b01132:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">..</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        diskType: filesystem</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        diskUUID: d2788933-8817-44c6-b688-dee414cc1f73</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        scheduledReplica:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          pvc-95561210-c39c-4c2e-ac9a-4a9bd72b3100-r-20affeca: 2147483648</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          pvc-9e83b2dc-6a4b-4499-ba70-70dc25b2d9aa-r-4ad05c86: 32212254720</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          pvc-bc25be1e-ca4e-4818-a16d-48353a0f2f96-r-c7b88c60: 3221225472</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          pvc-d9d3e54d-8d67-4740-861e-6373f670f1e4-r-f4c7c338: 2147483648</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          pvc-e954b5fe-bbd7-4d44-9866-6ff6684d5708-r-ba6b87b6: 5368709120</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        storageAvailable: 77699481600</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        storageMaximum:   80733671424</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        storageScheduled: 45097156608</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    region: ""</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    snapshotCheckStatus: {}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    zone: ""</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div>]]></content:encoded>
            <category>harvester</category>
            <category>resource metrics</category>
            <category>reserved resource</category>
            <category>calculation</category>
        </item>
        <item>
            <title><![CDATA[Best Practices for Optimizing Longhorn Disk Performance]]></title>
            <link>https://harvesterhci.io/kb/best_practices_for_optimizing_longhorn_disk_performance</link>
            <guid>best_practices_for_optimizing_longhorn_disk_performance</guid>
            <pubDate>Wed, 27 Dec 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Follow the recommendations for achieving optimal disk performance.]]></description>
            <content:encoded><![CDATA[<p>The Longhorn documentation provides <a href="https://longhorn.io/docs/1.6.0/best-practices/" target="_blank" rel="noopener noreferrer">best practice recommendations</a> for deploying Longhorn in production environments. Before configuring workloads, ensure that you have set up the following basic requirements for optimal disk performance.</p><ul><li>SATA/NVMe SSDs or disk drives with similar performance</li><li>10 Gbps network bandwidth between nodes</li><li>Dedicated Priority Classes for system-managed and user-deployed Longhorn components</li></ul><p>The following sections outline other recommendations for achieving optimal disk performance.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="io-performance">IO Performance<a class="hash-link" href="#io-performance" title="Direct link to heading">​</a></h2><ul><li><p><strong>Storage network</strong>: Use a <a href="https://docs.harvesterhci.io/v1.3/advanced/storagenetwork" target="_blank" rel="noopener noreferrer">dedicated storage network</a> to improve IO performance and stability.  </p></li><li><p><strong>Longhorn disk</strong>: Use a <a href="https://docs.harvesterhci.io/v1.3/host/#multi-disk-management" target="_blank" rel="noopener noreferrer">dedicated disk</a> for Longhorn storage instead of using the root disk.  </p></li><li><p><strong>Replica count</strong>: Set the <a href="https://docs.harvesterhci.io/v1.3/advanced/storageclass#parameters-tab" target="_blank" rel="noopener noreferrer">default replica count</a> to "2" to achieve data availability with better disk space usage or less impact to system performance. This practice is especially beneficial to data-intensive applications.  </p></li><li><p><strong>Storage tag</strong>: Use storage tags to define storage tiering for data-intensive applications. For example, only high-performance disks can be used for storing performance-sensitive data. You can either <a href="https://docs.harvesterhci.io/v1.3/host/#storage-tags" target="_blank" rel="noopener noreferrer">add disks with tags</a> or <a href="https://docs.harvesterhci.io/v1.3/advanced/storageclass#disk-selector-optional" target="_blank" rel="noopener noreferrer">create StorageClasses with tags</a>.  </p></li><li><p><strong>Data locality</strong>: Use <code>best-effort</code> as the default <a href="https://longhorn.io/docs/1.6.0/high-availability/data-locality/" target="_blank" rel="noopener noreferrer">data locality</a> of Longhorn Storage Classes.  </p><p>For applications that support data replication (for example, a distributed database), you can use the <code>strict-local</code> option to ensure that only one replica is created for each volume. This practice prevents the extra disk space usage and IO performance overhead associated with volume replication.  </p><p>For data-intensive applications, you can use pod scheduling functions such as node selector or taint toleration. These functions allow you to schedule the workload to a specific storage-tagged node together with one replica.  </p></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="space-efficiency">Space Efficiency<a class="hash-link" href="#space-efficiency" title="Direct link to heading">​</a></h2><ul><li><p><strong>Recurring snapshots</strong>: Periodically clean up system-generated snapshots and retain only the number of snapshots that makes sense for your implementation. </p><p>For applications with replication capability, periodically <a href="https://longhorn.io/docs/1.6.0/concepts/#243-deleting-snapshots" target="_blank" rel="noopener noreferrer">delete all types of snapshots</a>.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="disaster-recovery">Disaster Recovery<a class="hash-link" href="#disaster-recovery" title="Direct link to heading">​</a></h2><ul><li><p><strong>Recurring backups</strong>: Create <a href="https://longhorn.io/docs/1.6.0/snapshots-and-backups/scheduling-backups-and-snapshots/" target="_blank" rel="noopener noreferrer">recurring backup jobs</a> for mission-critical application volumes.</p></li><li><p><strong>System backup</strong>: Run periodic system backups.</p></li></ul>]]></content:encoded>
            <category>harvester</category>
            <category>longhorn</category>
            <category>best practices</category>
            <category>disk performance</category>
        </item>
        <item>
            <title><![CDATA[VM Live Migration Policy and Configuration]]></title>
            <link>https://harvesterhci.io/kb/vm_live_migration_policy_and_configuration</link>
            <guid>vm_live_migration_policy_and_configuration</guid>
            <pubDate>Fri, 01 Sep 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Know how VM live migration works, the migration policies, how to tune the policies and check status]]></description>
            <content:encoded><![CDATA[<p>In Harvester, the <strong>VM Live Migration</strong> is well supported by the UI. Please refer to <a href="https://docs.harvesterhci.io/v1.1/vm/live-migration" target="_blank" rel="noopener noreferrer">Harvester VM Live Migration</a> for more details.</p><p>The VM Live Migration process is finished smoothly in most cases. However, sometimes the migration may get stuck and not end as expected.</p><p>This article dives into the VM Live Migration process in more detail. There are three main parts:</p><ul><li>General Process of VM Live Migration</li><li>VM Live Migration Strategies</li><li>VM Live Migration Configurations</li></ul><p>Related issues:</p><ul><li><a href="https://github.com/harvester/harvester/issues/4352" target="_blank" rel="noopener noreferrer">Migration should show the proper status and progress in the UI</a></li><li><a href="https://github.com/harvester/harvester/issues/4376" target="_blank" rel="noopener noreferrer">VM Migration policy and status</a></li></ul><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>A big part of the following contents are copied from <code>kubevirt</code> document <a href="https://kubevirt.io/user-guide/operations/live_migration/" target="_blank" rel="noopener noreferrer">https://kubevirt.io/user-guide/operations/live_migration/</a>, some contents/formats are adjusted to fit in this document.</p></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="general-process-of-vm-live-migration">General Process of VM Live Migration<a class="hash-link" href="#general-process-of-vm-live-migration" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="starting-a-migration-from-harvester-ui">Starting a Migration from Harvester UI<a class="hash-link" href="#starting-a-migration-from-harvester-ui" title="Direct link to heading">​</a></h3><ol><li>Go to the <strong>Virtual Machines</strong> page.</li><li>Find the virtual machine that you want to migrate and select <strong>⋮</strong> &gt; <strong>Migrate</strong>.</li><li>Choose the node to which you want to migrate the virtual machine and select <strong>Apply</strong>.</li></ol><p>After successfully selecting <strong>Apply</strong>, a CRD <code>VirtualMachineInstanceMigration</code> object is created, and the related <code>controller/operator</code> will start the process.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="migration-crd-object">Migration CRD Object<a class="hash-link" href="#migration-crd-object" title="Direct link to heading">​</a></h3><p>You can also create the CRD <code>VirtualMachineInstanceMigration</code> object manually via <code>kubectl</code> or other tools.</p><p>The example below starts a migration process for a virtual machine instance (VMI) <code>new-vm</code>.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: kubevirt.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: VirtualMachineInstanceMigration</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: migration-job</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  vmiName: new-vm</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Under the hood, the open source projects <code>Kubevirt, Libvirt, QEMU, ... </code> perform most of the <code>VM Live Migration</code>. <a href="#references">References.</a></p><h3 class="anchor anchorWithStickyNavbar_mojV" id="migration-status-reporting">Migration Status Reporting<a class="hash-link" href="#migration-status-reporting" title="Direct link to heading">​</a></h3><p>When starting a virtual machine instance (VMI), it has also been calculated whether the machine is live migratable. The result is being stored in the VMI <code>VMI.status.conditions</code>. The calculation can be based on multiple parameters of the VMI, however, at the moment, the calculation is largely based on the Access Mode of the VMI volumes. Live migration is only permitted when the volume access mode is set to ReadWriteMany. Requests to migrate a non-LiveMigratable VMI will be rejected.</p><p>The reported Migration Method is also being calculated during VMI start. <code>BlockMigration</code> indicates that some of the VMI disks require copying from the source to the destination. <code>LiveMigration</code> means that only the instance memory will be copied.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">Status:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Conditions:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Status: True</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Type: LiveMigratable</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  Migration Method: BlockMigration</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="migration-status">Migration Status<a class="hash-link" href="#migration-status" title="Direct link to heading">​</a></h3><p>The migration progress status is reported in <code>VMI.status</code>. Most importantly, it indicates whether the migration has been completed or failed.</p><p>Below is an example of a successful migration.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">Migration State:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Completed:        true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    End Timestamp:    2019-03-29T03:37:52Z</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Migration Config:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      Completion Timeout Per GiB:  800</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      Progress Timeout:             150</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Migration UID:                  c64d4898-51d3-11e9-b370-525500d15501</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Source Node:                    node02</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Start Timestamp:                2019-03-29T04:02:47Z</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Target Direct Migration Node Ports:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      35001:                      0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      41068:                      49152</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      38284:                      49153</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Target Node:                  node01</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Target Node Address:          10.128.0.46</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Target Node Domain Detected:  true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    Target Pod:                   virt-launcher-testvmimcbjgw6zrzcmp8wpddvztvzm7x2k6cjbdgktwv8tkq</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="vm-live-migration-strategies">VM Live Migration Strategies<a class="hash-link" href="#vm-live-migration-strategies" title="Direct link to heading">​</a></h2><p>VM Live Migration is a process during which a running Virtual Machine Instance moves to another compute node while the guest workload continues to run and remain accessible.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="understanding-different-vm-live-migration-strategies">Understanding Different VM Live Migration Strategies<a class="hash-link" href="#understanding-different-vm-live-migration-strategies" title="Direct link to heading">​</a></h3><p>VM Live Migration is a complex process. During a migration, the source VM needs to transfer its whole state (mainly RAM) to the target VM. If there are enough resources available, such as network bandwidth and CPU power, migrations should converge nicely. If this is not the scenario, however, the migration might get stuck without an ability to progress.</p><p>The main factor that affects migrations from the guest perspective is its dirty rate, which is the rate by which the VM dirties memory. Guests with high dirty rate lead to a race during migration. On the one hand, memory would be transferred continuously to the target, and on the other, the same memory would get dirty by the guest. On such scenarios, one could consider to use more advanced migration strategies. Refer to <a href="https://kubevirt.io/user-guide/operations/live_migration/#understanding-different-migration-strategies" target="_blank" rel="noopener noreferrer">Understanding different migration strategies</a> for more details.</p><p>There are 3 <code>VM Live Migration</code> strategies/policies:</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="vm-live-migration-strategy-pre-copy">VM Live Migration Strategy: Pre-copy<a class="hash-link" href="#vm-live-migration-strategy-pre-copy" title="Direct link to heading">​</a></h4><p>Pre-copy is the default strategy. It should be used for most cases.</p><p>The way it works is as following:</p><ol><li>The target VM is created, but the guest keeps running on the source VM.</li><li>The source starts sending chunks of VM state (mostly memory) to the target. This continues until all of the state has been transferred to the target.</li><li>The guest starts executing on the target VM. 4. The source VM is being removed.</li></ol><p>Pre-copy is the safest and fastest strategy for most cases. Furthermore, it can be easily cancelled, can utilize multithreading, and more. If there is no real reason to use another strategy, this is definitely the strategy to go with.</p><p>However, on some cases migrations might not converge easily, that is, by the time the chunk of source VM state would be received by the target VM, it would already be mutated by the source VM (which is the VM the guest executes on). There are many reasons for migrations to fail converging, such as a high dirty-rate or low resources like network bandwidth and CPU. On such scenarios, see the following alternative strategies below.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="vm-live-migration-strategy-post-copy">VM Live Migration Strategy: Post-copy<a class="hash-link" href="#vm-live-migration-strategy-post-copy" title="Direct link to heading">​</a></h4><p>The way post-copy migrations work is as following:</p><ol><li>The target VM is created.</li><li>The guest is being run on the target VM.</li><li>The source starts sending chunks of VM state (mostly memory) to the target.</li><li>When the guest, running on the target VM, would access memory: 1. If the memory exists on the target VM, the guest can access it. 2. Otherwise, the target VM asks for a chunk of memory from the source VM.</li><li>Once all of the memory state is updated at the target VM, the source VM is being removed.</li></ol><p>The main idea here is that the guest starts to run immediately on the target VM. This approach has advantages and disadvantages:</p><p><strong>Advantages:</strong></p><ul><li>The same memory chink is never being transferred twice. This is possible due to the fact that with post-copy it doesn't matter that a page had been dirtied since the guest is already running on the target VM.</li><li>This means that a high dirty-rate has much less effect.</li><li>Consumes less network bandwidth.</li></ul><p><strong>Disadvantages:</strong></p><ul><li>When using post-copy, the VM state has no one source of truth. When the guest (running on the target VM) writes to memory, this memory is one part of the guest's state, but some other parts of it may still be updated only at the source VM. This situation is generally dangerous, since, for example, if either the target or guest VMs crash the state cannot be recovered.</li><li>Slow warmup: when the guest starts executing, no memory is present at the target VM. Therefore, the guest would have to wait for a lot of memory in a short period of time.</li><li>Slower than pre-copy on most cases.</li><li>Harder to cancel a migration.</li></ul><h4 class="anchor anchorWithStickyNavbar_mojV" id="vm-live-migration-strategy-auto-converge">VM Live Migration Strategy: Auto-converge<a class="hash-link" href="#vm-live-migration-strategy-auto-converge" title="Direct link to heading">​</a></h4><p>Auto-converge is a technique to help pre-copy migrations converge faster without changing the core algorithm of how the migration works.</p><p>Since a high dirty-rate is usually the most significant factor for migrations to not converge, auto-converge simply throttles the guest's CPU. If the migration would converge fast enough, the guest's CPU would not be throttled or throttled negligibly. But, if the migration would not converge fast enough, the CPU would be throttled more and more as time goes.</p><p>This technique dramatically increases the probability of the migration converging eventually.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="observe-the-vm-live-migration-progress-and-result">Observe the VM Live Migration Progress and Result<a class="hash-link" href="#observe-the-vm-live-migration-progress-and-result" title="Direct link to heading">​</a></h3><h4 class="anchor anchorWithStickyNavbar_mojV" id="migration-timeouts">Migration Timeouts<a class="hash-link" href="#migration-timeouts" title="Direct link to heading">​</a></h4><p>Depending on the type, the live migration process will copy virtual machine memory pages and disk blocks to the destination. During this process non-locked pages and blocks are being copied and become free for the instance to use again. To achieve a successful migration, it is assumed that the instance will write to the free pages and blocks (pollute the pages) at a lower rate than these are being copied.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="completion-time">Completion Time<a class="hash-link" href="#completion-time" title="Direct link to heading">​</a></h4><p>In some cases the virtual machine can write to different memory pages / disk blocks at a higher rate than these can be copied, which will prevent the migration process from completing in a reasonable amount of time. In this case, live migration will be aborted if it is running for a long period of time. The timeout is calculated base on the size of the VMI, it's memory and the ephemeral disks that are needed to be copied. The configurable parameter completionTimeoutPerGiB, which defaults to 800s is the time for GiB of data to wait for the migration to be completed before aborting it. A VMI with 8Gib of memory will time out after 6400 seconds.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="progress-timeout">Progress Timeout<a class="hash-link" href="#progress-timeout" title="Direct link to heading">​</a></h4><p>A VM Live Migration will also be aborted when it notices that copying memory doesn't make any progress. The time to wait for live migration to make progress in transferring data is configurable by the <code>progressTimeout</code> parameter, which defaults to 150 seconds.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="vm-live-migration-configurations">VM Live Migration Configurations<a class="hash-link" href="#vm-live-migration-configurations" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="changing-cluster-wide-migration-limits">Changing Cluster Wide Migration Limits<a class="hash-link" href="#changing-cluster-wide-migration-limits" title="Direct link to heading">​</a></h3><p>KubeVirt puts some limits in place so that migrations don't overwhelm the cluster. By default, it is to only run 5 migrations in parallel with an additional limit of a maximum of 2 outbound migrations per node. Finally, every migration is limited to a bandwidth of 64MiB/s.</p><p>You can change these values in the <code>kubevirt</code> CR:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    apiVersion: kubevirt.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kind: Kubevirt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      name: kubevirt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      namespace: kubevirt</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      configuration:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        migrations:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          parallelMigrationsPerCluster: 5</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          parallelOutboundMigrationsPerNode: 2</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          bandwidthPerMigration: 64Mi</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          completionTimeoutPerGiB: 800</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          progressTimeout: 150</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          disableTLS: false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          nodeDrainTaintKey: "kubevirt.io/drain"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          allowAutoConverge: false ---------------------&gt; related to: Auto-converge</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          allowPostCopy: false -------------------------&gt; related to: Post-copy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          unsafeMigrationOverride: false</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Remember that most of these configurations can be overridden and fine-tuned to a specified group of VMs. For more information, please refer to the Migration Policies section below.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="migration-policies">Migration Policies<a class="hash-link" href="#migration-policies" title="Direct link to heading">​</a></h3><p><a href="https://kubevirt.io/user-guide/operations/migration_policies/" target="_blank" rel="noopener noreferrer">Migration policies</a> provides a new way of applying migration configurations to Virtual Machines. The policies can refine Kubevirt CR's <code>MigrationConfiguration</code> that sets the cluster-wide migration configurations. This way, the cluster-wide settings default how the migration policy can be refined (i.e., changed, removed, or added).</p><p>Remember that migration policies are in version <code>v1alpha1</code>. This means that this API is not fully stable yet and that APIs may change in the future.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="migration-configurations">Migration Configurations<a class="hash-link" href="#migration-configurations" title="Direct link to heading">​</a></h4><p>Currently, the <code>MigrationPolicy</code> spec only includes the following configurations from Kubevirt CR's <code>MigrationConfiguration</code>. (In the future, more configurations that aren't part of Kubevirt CR will be added):</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: migrations.kubevirt.io/v1alpha1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: MigrationPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    allowAutoConverge: true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    bandwidthPerMigration: 217Ki</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    completionTimeoutPerGiB: 23</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    allowPostCopy: false</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>All the above fields are optional. When omitted, the configuration will be applied as defined in KubevirtCR's <code>MigrationConfiguration</code>. This way, KubevirtCR will serve as a configurable set of defaults for both VMs that are not bound to any <code>MigrationPolicy</code> and VMs that are bound to a <code>MigrationPolicy</code> that does not define all fields of the configurations.</p><h5 class="anchor anchorWithStickyNavbar_mojV" id="matching-policies-to-vms">Matching Policies to VMs<a class="hash-link" href="#matching-policies-to-vms" title="Direct link to heading">​</a></h5><p>Next in the spec are the selectors defining the group of VMs to apply the policy. The options to do so are the following.</p><p>This policy applies to the VMs in namespaces that have all the required labels:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: migrations.kubevirt.io/v1alpha1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: MigrationPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  selectors:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    namespaceSelector:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      hpc-workloads: true       # Matches a key and a value</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The policy below applies to the VMs that have all the required labels:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">apiVersion: migrations.kubevirt.io/v1alpha1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kind: MigrationPolicy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  selectors:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    virtualMachineInstanceSelector:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      workload-type: db       # Matches a key and a value</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="references">References<a class="hash-link" href="#references" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="documents">Documents<a class="hash-link" href="#documents" title="Direct link to heading">​</a></h3><h3 class="anchor anchorWithStickyNavbar_mojV" id="libvirt-guest-migration">Libvirt Guest Migration<a class="hash-link" href="#libvirt-guest-migration" title="Direct link to heading">​</a></h3><p><code>Libvirt</code> has a chapter to describe the pricipal of <code>VM/Guest Live Migration</code>.</p><p><a href="https://libvirt.org/migration.html" target="_blank" rel="noopener noreferrer">https://libvirt.org/migration.html</a></p><h3 class="anchor anchorWithStickyNavbar_mojV" id="kubevirt-live-migration">Kubevirt Live Migration<a class="hash-link" href="#kubevirt-live-migration" title="Direct link to heading">​</a></h3><p><a href="https://kubevirt.io/user-guide/operations/live_migration/" target="_blank" rel="noopener noreferrer">https://kubevirt.io/user-guide/operations/live_migration/</a></p><h3 class="anchor anchorWithStickyNavbar_mojV" id="source-code">Source Code<a class="hash-link" href="#source-code" title="Direct link to heading">​</a></h3><p>The <code>VM Live Migration</code> related configuration options are passed to each layer correspondingly.</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="kubevirt">Kubevirt<a class="hash-link" href="#kubevirt" title="Direct link to heading">​</a></h4><p><a href="https://github.com/kubevirt/kubevirt/blob/d425593ae392111dab80403ef0cde82625e37653/pkg/virt-launcher/virtwrap/live-migration-source.go#L103" target="_blank" rel="noopener noreferrer">https://github.com/kubevirt/kubevirt/blob/d425593ae392111dab80403ef0cde82625e37653/pkg/virt-launcher/virtwrap/live-migration-source.go#L103</a></p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">import "libvirt.org/go/libvirt"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">func generateMigrationFlags(isBlockMigration, migratePaused bool, options *cmdclient.MigrationOptions) libvirt.DomainMigrateFlags {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    if options.AllowAutoConverge {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        migrateFlags |= libvirt.MIGRATE_AUTO_CONVERGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    if options.AllowPostCopy {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        migrateFlags |= libvirt.MIGRATE_POSTCOPY</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="go-package-libvirt">Go Package Libvirt<a class="hash-link" href="#go-package-libvirt" title="Direct link to heading">​</a></h4><p><a href="https://pkg.go.dev/libvirt.org/go/libvirt" target="_blank" rel="noopener noreferrer">https://pkg.go.dev/libvirt.org/go/libvirt</a></p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">const (</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    MIGRATE_AUTO_CONVERGE                 = DomainMigrateFlags(C.VIR_MIGRATE_AUTO_CONVERGE)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    MIGRATE_RDMA_PIN_ALL                  = DomainMigrateFlags(C.VIR_MIGRATE_RDMA_PIN_ALL)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    MIGRATE_POSTCOPY                      = DomainMigrateFlags(C.VIR_MIGRATE_POSTCOPY)</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">)</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="libvirt">Libvirt<a class="hash-link" href="#libvirt" title="Direct link to heading">​</a></h4><p><a href="https://github.com/libvirt/libvirt/blob/bfe53e9145cd5996a791c5caff0686572b850f82/include/libvirt/libvirt-domain.h#L1030" target="_blank" rel="noopener noreferrer">https://github.com/libvirt/libvirt/blob/bfe53e9145cd5996a791c5caff0686572b850f82/include/libvirt/libvirt-domain.h#L1030</a></p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">    /* Enable algorithms that ensure a live migration will eventually converge.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * This usually means the domain will be slowed down to make sure it does</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * not change its memory faster than a hypervisor can transfer the changed</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * memory to the destination host. VIR_MIGRATE_PARAM_AUTO_CONVERGE_*</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * parameters can be used to tune the algorithm.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     *</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * Since: 1.2.3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     */</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    VIR_MIGRATE_AUTO_CONVERGE = (1 &lt;&lt; 13),</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">   /* Setting the VIR_MIGRATE_POSTCOPY flag tells libvirt to enable post-copy</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * migration. However, the migration will start normally and</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * virDomainMigrateStartPostCopy needs to be called to switch it into the</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * post-copy mode. See virDomainMigrateStartPostCopy for more details.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     *</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     * Since: 1.3.3</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     */</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    VIR_MIGRATE_POSTCOPY = (1 &lt;&lt; 15),</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div>]]></content:encoded>
            <category>harvester</category>
            <category>virtual machine</category>
            <category>VM</category>
            <category>live migration</category>
            <category>policy</category>
            <category>strategy</category>
            <category>configuration</category>
        </item>
        <item>
            <title><![CDATA[Use Rook Ceph External Storage with Harvester]]></title>
            <link>https://harvesterhci.io/kb/use_rook_ceph_external_storage</link>
            <guid>use_rook_ceph_external_storage</guid>
            <pubDate>Wed, 23 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Use Rook Ceph External Storage with Harvester]]></description>
            <content:encoded><![CDATA[<p>Starting with Harvester v1.2.0, it offers the capability to install a Container Storage Interface (CSI) in your Harvester cluster. This allows you to leverage external storage for the Virtual Machine's non-system data disk, giving you the flexibility to use different drivers tailored for specific needs, whether it's for performance optimization or seamless integration with your existing in-house storage solutions.</p><p>It's important to note that, despite this enhancement, the provisioner for the Virtual Machine (VM) image in Harvester still relies on Longhorn. Prior to version 1.2.0, Harvester exclusively supported Longhorn for storing VM data and did not offer support for external storage as a destination for VM data.</p><p>One of the options for integrating external storage with Harvester is Rook, an open-source cloud-native storage orchestrator. Rook provides a robust platform, framework, and support for Ceph storage, enabling seamless integration with cloud-native environments.</p><p><a href="https://ceph.io" target="_blank" rel="noopener noreferrer">Ceph</a> is a software-defined distributed storage system that offers versatile storage capabilities, including file, block, and object storage. It is designed for large-scale production clusters and can be deployed effectively in such environments.</p><p><a href="https://rook.io" target="_blank" rel="noopener noreferrer">Rook</a> simplifies the deployment and management of Ceph, offering self-managing, self-scaling, and self-healing storage services. It leverages Kubernetes resources to automate the deployment, configuration, provisioning, scaling, upgrading, and monitoring of Ceph.</p><p>In this article, we will walk you through the process of installing, configuring, and utilizing <a href="https://rook.io/docs/rook/v1.12/Getting-Started/intro/" target="_blank" rel="noopener noreferrer">Rook</a> to use storage from an <a href="https://www.rook.io/docs/rook/v1.12/CRDs/Cluster/external-cluster/" target="_blank" rel="noopener noreferrer">existing external Ceph cluster</a> as a data disk for a VM within the Harvester environment.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="install-harvester-cluster">Install Harvester Cluster<a class="hash-link" href="#install-harvester-cluster" title="Direct link to heading">​</a></h2><p>Harvester's operating system follows an immutable design, meaning that most OS files revert to their pre-configured state after a reboot. To accommodate Rook Ceph's requirements, you need to add specific persistent paths to the <code>os.persistentStatePaths</code> section in the <a href="https://docs.harvesterhci.io/dev/install/harvester-configuration#ospersistent_state_paths" target="_blank" rel="noopener noreferrer">Harvester configuration</a>. These paths include:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">os</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">persistent_state_paths</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> /var/lib/rook</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> /var/lib/ceph</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">modules</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> rbd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> nbd</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After the cluster is installed, refer to <a href="https://docs.harvesterhci.io/v1.1/faq#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster" target="_blank" rel="noopener noreferrer">How can I access the kubeconfig file of the Harvester cluster?</a> to get the kubeconfig of the Harvester cluster.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="install-rook-to-harvester">Install Rook to Harvester<a class="hash-link" href="#install-rook-to-harvester" title="Direct link to heading">​</a></h2><p>Install Rook to the Harvester cluster by referring to <a href="https://rook.io/docs/rook/v1.12/Getting-Started/quickstart/" target="_blank" rel="noopener noreferrer">Rook Quickstart</a>.</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> -fsSLo rook.tar.gz https://github.com/rook/rook/archive/refs/tags/v1.12.2.tar.gz </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">tar</span><span class="token plain"> -zxf rook.tar.gz </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token builtin class-name">cd</span><span class="token plain"> rook-1.12.2/deploy/examples</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># apply configurations ref: https://rook.github.io/docs/rook/v1.12/Getting-Started/example-configurations/</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f crds.yaml -f common.yaml -f operator.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl -n rook-ceph </span><span class="token function" style="color:#d73a49">wait</span><span class="token plain"> --for</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">condition</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">Available deploy rook-ceph-operator --timeout</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">10m</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="using-an-existing-external-ceph-cluster">Using an existing external Ceph cluster<a class="hash-link" href="#using-an-existing-external-ceph-cluster" title="Direct link to heading">​</a></h2><ol><li>Run the python script <code>create-external-cluster-resources.py</code> in the <a href="https://www.rook.io/docs/rook/v1.12/CRDs/Cluster/external-cluster/" target="_blank" rel="noopener noreferrer">existing external Ceph cluster</a> for creating all users and keys.</li></ol><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># script help ref: https://www.rook.io/docs/rook/v1.12/CRDs/Cluster/external-cluster/#1-create-all-users-and-keys</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> -s https://raw.githubusercontent.com/rook/rook/v1.12.2/deploy/examples/create-external-cluster-resources.py </span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> create-external-cluster-resources.py</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">python3 create-external-cluster-resources.py --rbd-data-pool-name </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">pool_name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> --namespace rook-ceph-external --format </span><span class="token function" style="color:#d73a49">bash</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>Copy the Bash output.</li></ol><p>Example output:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">export NAMESPACE=rook-ceph-external</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export ROOK_EXTERNAL_FSID=b3b47828-4c60-11ee-be38-51902f85c805</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export ROOK_EXTERNAL_USERNAME=client.healthchecker</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export ROOK_EXTERNAL_CEPH_MON_DATA=ceph-1=192.168.5.99:6789</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export ROOK_EXTERNAL_USER_SECRET=AQDd6/dkFyu/IhAATv/uCMbHtWk4AYK2KXzBhQ==</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export ROOK_EXTERNAL_DASHBOARD_LINK=https://192.168.5.99:8443/</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export CSI_RBD_NODE_SECRET=AQDd6/dk2HsjIxAA06Yw9UcOg0dfwV/9IFBRhA==</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export CSI_RBD_NODE_SECRET_NAME=csi-rbd-node</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export CSI_RBD_PROVISIONER_SECRET=AQDd6/dkEY1kIxAAAzrXZnVRf4x+wDUz1zyaQg==</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export CSI_RBD_PROVISIONER_SECRET_NAME=csi-rbd-provisioner</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export MONITORING_ENDPOINT=192.168.5.99</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export MONITORING_ENDPOINT_PORT=9283</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export RBD_POOL_NAME=test</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">export RGW_POOL_PREFIX=default</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="3"><li>Consume the external Ceph cluster resources on the Harvester cluster.</li></ol><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Paste the above output from create-external-cluster-resources.py into import-env.sh</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">vim</span><span class="token plain"> import-env.sh</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">source</span><span class="token plain"> import-env.sh</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># this script will create a StorageClass ceph-rbd</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">source</span><span class="token plain"> import-external-cluster.sh</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f common-external.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f cluster-external.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># wait for all pods to become Ready</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">watch</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'kubectl --namespace rook-ceph get pods'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="4"><li>Create the VolumeSnapshotClass <code>csi-rbdplugin-snapclass-external</code>.</li></ol><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">cat</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain">./csi/rbd/snapshotclass-external.yaml </span><span class="token operator" style="color:#393A34">&lt;&lt;</span><span class="token string" style="color:#e3116c">EOF</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">---</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">apiVersion: snapshot.storage.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">kind: VolumeSnapshotClass</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">  name: csi-rbdplugin-snapclass-external</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">driver: rook-ceph.rbd.csi.ceph.com # driver:namespace:operator</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">parameters:</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">  clusterID: rook-ceph-external # namespace:cluster</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">  csi.storage.k8s.io/snapshotter-secret-name: rook-csi-rbd-provisioner</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">  csi.storage.k8s.io/snapshotter-secret-namespace: rook-ceph-external # namespace:cluster</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">deletionPolicy: Delete</span><br></span><span class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">EOF</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f ./csi/rbd/snapshotclass-external.yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="configure-harvester-cluster">Configure Harvester Cluster<a class="hash-link" href="#configure-harvester-cluster" title="Direct link to heading">​</a></h2><p>Before you can make use of Harvester's <strong>Backup &amp; Snapshot</strong> features, you need to set up some essential configurations through the Harvester <a href="https://docs.harvesterhci.io/v1.4/advanced/index#csi-driver-config" target="_blank" rel="noopener noreferrer">csi-driver-config</a> setting. To set up these configurations, follow these steps:</p><ol><li>Login to the Harvester UI, then navigate to <strong>Advanced</strong> &gt; <strong>Settings</strong>.</li><li>Find and select <strong>csi-driver-config</strong>, and then click on the <strong>⋮</strong> &gt; <strong>Edit Setting</strong> to access the configuration options.</li><li>In the settings, set the <strong>Provisioner</strong> to <code>rook-ceph.rbd.csi.ceph.com</code>.</li><li>Next, specify the <strong>Volume Snapshot Class Name</strong> as <code>csi-rbdplugin-snapclass-external</code>. This setting points to the name of the <code>VolumeSnapshotClass</code> used for creating volume snapshots or VM snapshots.</li></ol><p><img loading="lazy" alt="csi-driver-config-external" src="/assets/images/csi-driver-config-external-145956b2392b5f1bbcc1981568333384.png" width="3824" height="1848"></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="use-rook-ceph-in-harvester">Use Rook Ceph in Harvester<a class="hash-link" href="#use-rook-ceph-in-harvester" title="Direct link to heading">​</a></h2><p>After successfully configuring these settings, you can proceed to utilize the Rook Ceph StorageClass, which is named <code>rook-ceph-block</code> for the internal Ceph cluster or named <code>ceph-rbd</code> for the external Ceph cluster. You can apply this StorageClass when creating an empty volume or adding a new block volume to a VM, enhancing your Harvester cluster's storage capabilities.</p><p>With these configurations in place, your Harvester cluster is ready to make the most of the Rook Ceph storage integration.</p><p><img loading="lazy" alt="rook-ceph-volume-external" src="/assets/images/rook-ceph-volume-external-974d73b9b863e95495c7b119d2c50954.png" width="3824" height="1848"></p><p><img loading="lazy" alt="rook-ceph-vm-external" src="/assets/images/rook-ceph-vm-external-4c1b4f6b6a6676e13d312cac3498d786.png" width="3824" height="1848"></p>]]></content:encoded>
            <category>harvester</category>
            <category>rook</category>
            <category>ceph</category>
            <category>csi</category>
        </item>
        <item>
            <title><![CDATA[Upgrade Guest Kubernetes Clusters to be Compatible with Harvester IP Pools]]></title>
            <link>https://harvesterhci.io/kb/upgrading_guest_clusters_with_harvester_ip_pool_compatibility</link>
            <guid>upgrading_guest_clusters_with_harvester_ip_pool_compatibility</guid>
            <pubDate>Mon, 21 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Explain how to keep load balancer IP during upgrading guest cluster]]></description>
            <content:encoded><![CDATA[<p>As <strong>Harvester v1.2.0</strong> is released, a new Harvester cloud provider version <strong>0.2.2</strong> is integrated into RKE2 <strong>v1.24.15+rke2r1</strong>, <strong>v1.25.11+rke2r1</strong>,  <strong>v1.26.6+rke2r1</strong>, <strong>v1.27.3+rke2r1</strong>, and newer versions.</p><p>With Harvester v1.2.0, the new Harvester cloud provider offers enhanced load balancing capabilities for guest Kubernetes services. Specifically, it introduces the Harvester IP Pool feature, a built-in IP address management (IPAM) solution for the Harvester load balancer. It allows you to define an IP pool specific to a particular guest cluster by specifying the guest cluster name. For example, you can create an IP pool exclusively for the guest cluster named cluster2:</p><p><img loading="lazy" alt="image" src="/assets/images/ippoolforcluster2-264c61833ccd9a79fb03dd73930d2401.png" width="3050" height="972"></p><p>However, after upgrading, the feature is not automatically compatible with existing guest Kubernetes clusters, as they do not pass the correct cluster name to the Harvester cloud provider. Refer to <a href="https://github.com/harvester/harvester/issues/4232" target="_blank" rel="noopener noreferrer">issue 4232</a> for more details. Users can manually upgrade the Harvester cloud provider using Helm as a workaround and provide the correct cluster name after upgrading. However, this would result in a change in the load balancer IPs. </p><p>This article outlines a workaround that allows you to leverage the new IP pool feature while keeping the load balancer IPs unchanged.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="prerequisites">Prerequisites<a class="hash-link" href="#prerequisites" title="Direct link to heading">​</a></h2><ul><li><p>Download the Harvester kubeconfig file from the Harvester UI. If you have imported Harvester into Rancher, do not use the kubeconfig file from the Rancher UI. Refer to <a href="https://docs.harvesterhci.io/v1.1/faq#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster" target="_blank" rel="noopener noreferrer">Access Harvester Cluster</a> to get the desired one.</p></li><li><p>Download the kubeconfig file for the guest Kubernetes cluster you plan to upgrade. Refer to <a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/manage-clusters/access-clusters/use-kubectl-and-kubeconfig#accessing-clusters-with-kubectl-from-your-workstation" target="_blank" rel="noopener noreferrer">Accessing Clusters with kubectl from Your Workstation</a> for instructions on how to download the kubeconfig file.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_mojV" id="steps-to-keep-load-balancer-ip">Steps to Keep Load Balancer IP<a class="hash-link" href="#steps-to-keep-load-balancer-ip" title="Direct link to heading">​</a></h2><ol><li><p>Execute the following script before upgrading.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">curl -sfL https://raw.githubusercontent.com/harvester/harvesterhci.io/main/kb/2023-08-21/keepip.sh | sh -s before_upgrade &lt;Harvester-kubeconfig-path&gt; &lt;guest-cluster-kubeconfig-path&gt; &lt;guest-cluster-name&gt; &lt;guest-cluster-nodes-namespace&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ul><li><code>&lt;Harvester-kubeconfig-path&gt;</code>: Path to the Harvester kubeconfig file.</li><li><code>&lt;guest-cluster-kubeconfig-path&gt;</code>: Path to the kubeconfig file of your guest Kubernetes cluster.</li><li><code>&lt;guest-cluster-name&gt;</code>: Name of your guest cluster.</li><li><code>&lt;guest-cluster-nodes-namespace&gt;</code>: Namespace where the VMs of the guest cluster are located.</li></ul><p>The script will help users copy the DHCP information to the service annotation and modify the IP pool allocated history to make sure the IP is unchanged.</p><p><img loading="lazy" alt="image" src="/assets/images/before-upgrade-32da6d40ebe06324de4a258174ac6220.png" width="2196" height="780"></p><p>After executing the script, the load balancer service with DHCP mode will be annotated with the DHCP information. For example:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Service</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kube-vip.io/hwaddr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 00</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">00</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">6c</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">4f</span><span class="token punctuation" style="color:#393A34">:</span><span class="token datetime number" style="color:#36acaa">18:68</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kube-vip.io/requestedIP</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 172.19.105.215</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> lb0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> default</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>As for the load balancer service with pool mode, the IP pool allocated history will be modified as the new load balancer name. For example:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> loadbalancer.harvesterhci.io/v1beta1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> IPPool</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">status</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">allocatedHistory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">192.168.100.2</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> default/cluster</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">name</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">default</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">lb1</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ddc13071 </span><span class="token comment" style="color:#999988;font-style:italic"># replace the new load balancer name</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Add network selector for the pool.</p><p>For example, the following cluster is under the VM network <code>default/mgmt-untagged</code>. The network selector should be <code>default/mgmt-untagged</code>.</p><p><img loading="lazy" alt="image" src="/assets/images/network-ba7294269bf230843a11803191e20f1e.png" width="3498" height="1980"></p><p><img loading="lazy" alt="image" src="/assets/images/network-selector-0f179a6c97e2fa3621bcaadd8c09e39d.png" width="3054" height="1232"></p></li><li><p>Upgrade the RKE2 cluster in the Rancher UI and select the new version.</p><p><img loading="lazy" alt="image" src="/assets/images/upgrade-6356d7891793f5c94e25da1f6aa22944.png" width="3502" height="2052"></p></li><li><p>Execute the script after upgrading.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">curl -sfL https://raw.githubusercontent.com/harvester/harvesterhci.io/main/kb/2023-08-21/keepip.sh | sh -s after_upgrade &lt;Harvester-kubeconfig-path&gt; &lt;guest-cluster-kubeconfig-path&gt; &lt;guest-cluster-name&gt; &lt;guest-cluster-nodes-namespace&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p><img loading="lazy" alt="image" src="/assets/images/before-upgrade-32da6d40ebe06324de4a258174ac6220.png" width="2196" height="780"></p><p> In this step, the script wraps the operations to upgrade the Harvester cloud provider to set the cluster name. After the Harvester cloud provider is running, the new Harvester load balancers will be created with the unchanged IPs.</p></li></ol>]]></content:encoded>
            <category>harvester</category>
            <category>load balancer</category>
            <category>cloud provider</category>
            <category>ip pool</category>
            <category>upgrade</category>
        </item>
        <item>
            <title><![CDATA[Using NetApp Storage on Harvester]]></title>
            <link>https://harvesterhci.io/kb/install_netapp_trident_csi</link>
            <guid>install_netapp_trident_csi</guid>
            <pubDate>Fri, 11 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Installation procedure for NetApp Astra Trident CSI Driver]]></description>
            <content:encoded><![CDATA[<p>This article covers instructions for installing the Netapp Astra Trident CSI driver into a Harvester cluster, which enables NetApp storage systems to store storage volumes usable by virtual machines running in Harvester.</p><p>The NetApp storage will be an option in addition to the normal Longhorn storage; it will not replace Longhorn. Virtual machine images will still be stored using Longhorn.</p><p>This has been tested with Harvester 1.2.0 and Trident v23.07.0.</p><p>This procedure only works to access storage via iSCSI, not NFS.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>3rd party storage classes (including those based on Trident) can only be used for non-boot volumes of Harvester VMs.</p></div></div><h1>Detailed Instructions</h1><p>We assume that before beginning this procedure, a Harvester cluster and a NetApp ONTAP storage system are both installed and configured for use.</p><p>Most of these steps can be performed on any system with the <code>helm</code> and <code>kubectl</code> commands installed and network connectivity to the management port of the Harvester cluster.  Let's call this your workstation.  Certain steps must be performed on one or more cluster nodes themselves.  The steps described below should be done on your workstation unless otherwise indicated.</p><p>The last step (enabling multipathd) should be done on all nodes after the Trident CSI has been installed.</p><p>Certain parameters of your installation will require modification of details in the examples in the procedure given below. Those which you may wish to modify include:</p><ul><li>The namespace.  <code>trident</code> is used as the namespace in the examples, but you may prefer to use another.</li><li>The name of the deployment. <code>mytrident</code> is used but you can change this to something else.</li><li>The management IP address of the ONTAP storage system</li><li>Login credentials (username and password) of the ONTAP storage system</li></ul><p>The procedure is as follows.</p><ol><li><p>Read the NetApp Astra Trident documentation:</p><ul><li><a href="https://docs.netapp.com/us-en/trident/" target="_blank" rel="noopener noreferrer">https://docs.netapp.com/us-en/trident/</a></li><li><a href="https://docs.netapp.com/us-en/trident/trident-get-started/kubernetes-deploy-operator.html" target="_blank" rel="noopener noreferrer">https://docs.netapp.com/us-en/trident/trident-get-started/kubernetes-deploy-operator.html</a></li><li><a href="https://docs.netapp.com/us-en/trident/trident-get-started/kubernetes-deploy-helm.html#deploy-the-trident-operator-and-install-astra-trident-using-helm" target="_blank" rel="noopener noreferrer">https://docs.netapp.com/us-en/trident/trident-get-started/kubernetes-deploy-helm.html#deploy-the-trident-operator-and-install-astra-trident-using-helm</a></li></ul><p>The simplest method is to install using Helm; that process is described here.</p></li><li><p>Download the KubeConfig from the Harvester cluster.</p><ul><li>Open the web UI for your Harvester cluster</li><li>In the lower left corner, click the "Support" link.  This will take you to a "Harvester Support" page.</li><li>Click the button labeled "Download KubeConfig".  This will download a your cluster config in a file called "local.yaml" by default.</li><li>Move this file to a convenient location and set your <code>KUBECONFIG</code> environment variable to the path of this file.</li></ul></li><li><p>Prepare the cluster for installation of the Helm chart.</p><p>Before starting installation of the helm chart, special authorization must be provided to enable certain modifications to be made during the installation.
This addresses the issue described here: <a href="https://github.com/NetApp/trident/issues/839" target="_blank" rel="noopener noreferrer">https://github.com/NetApp/trident/issues/839</a></p><ul><li><p>Put the following text into a file.  For this example we'll call it <code>authorize_trident.yaml</code>.</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rbac.authorization.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterRole</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> trident</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">operator</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">psa</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">rules</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">apiGroups</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> management.cattle.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">resources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> projects</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">verbs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> updatepsa</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rbac.authorization.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterRoleBinding</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> trident</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">operator</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">psa</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">roleRef</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">apiGroup</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rbac.authorization.k8s.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterRole</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> trident</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">operator</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">psa</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">subjects</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ServiceAccount</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> trident</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">operator</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> trident</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Apply this manifest via the command <code>kubectl apply -f authorize_trident.yaml</code>.</p></li></ul></li><li><p>Install the helm chart.</p><ul><li><p>First you will need to add the Astra Trident Helm repository:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">helm repo </span><span class="token function" style="color:#d73a49">add</span><span class="token plain"> netapp-trident https://netapp.github.io/trident-helm-chart</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">helm repo update</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Set these variables for the Helm chart you are installing:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">helm search repo netapp-trident --versions</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token builtin class-name">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:#36acaa">CHART_VERSION</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:#36acaa">APP_VERSION</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">""</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Next, install the Helm chart.  This example uses <code>trident</code> as the deployment name, <code>trident</code> as the namespace, and 100.2406.1 as the Helm chart version to install:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">helm </span><span class="token function" style="color:#d73a49">install</span><span class="token plain"> trident netapp-trident/trident-operator --version </span><span class="token variable" style="color:#36acaa">${CHART_VERSION}</span><span class="token plain"> --create-namespace --namespace trident</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>The NetApp documentation describes variations on how you can do this.</p></li></ul></li><li><p>Download and extract the tridentctl command, which will be needed for the next few steps.</p><p>This and the next few steps need to be performed logged into a master node of the Harvester cluster, using root access.</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token builtin class-name">cd</span><span class="token plain"> /tmp</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> -L -o trident-installer-</span><span class="token variable" style="color:#36acaa">${APP_VERSION}</span><span class="token plain">.tar.gz https://github.com/NetApp/trident/releases/download/v</span><span class="token variable" style="color:#36acaa">${APP_VERSION}</span><span class="token plain">/trident-installer-</span><span class="token variable" style="color:#36acaa">${APP_VERSION}</span><span class="token plain">.tar.gz</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">tar</span><span class="token plain"> -xf trident-installer-</span><span class="token variable" style="color:#36acaa">${APP_VERSION}</span><span class="token plain">.tar.gz</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">cd</span><span class="token plain"> trident-installer</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Install a backend.</p><p>This part is specific to Harvester.</p><ol><li><p>Create the following text file:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">cat &lt;&lt;EOF</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"> /tmp/backend.yaml</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">backendName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> default_backend_san</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">storageDriverName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;ontap</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">san</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">economy or ontap</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">san</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">managementLIF</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;ADMIN_IPADDRESS</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic">## Often the same as the storage UI IP address</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">dataLIF</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;DATA_IPADDRESS</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic">## IP assigned to the iSCSI-only SVM</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">svm</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;SVM_NAME</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">username</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;ONTAP storage admin user</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">password</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;password</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> default_backend_san</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Update the IP addresses, SVM name, username, and password in this file
with the appropriate values for the the ONTAP system.</p></li><li><p>Create the backend</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">./tridentctl create backend -f /tmp/backend.yaml -n trident</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><ul><li>A successful completion of the command will result in an output similar to the following:<div class="codeBlockContainer_I0IT language-text theme-code-block"><div class="codeBlockContent_wNvx text"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------+----------------+--------------------------------------+--------+---------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">|          NAME          | STORAGE DRIVER |                 UUID                 | STATE  | VOLUMES |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------+----------------+--------------------------------------+--------+---------+</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">| default_backend_san    | ontap-san      | 6788533c-7fea-4a35-b797-fb9bb3322b91 | online |       0 |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">+------------------------+----------------+--------------------------------------+--------+---------+</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ul><ol><li><p>You can verify the status of the backend at any time with:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">./tridentctl get backend -n trident</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><ul><li>You should see an output similar to the output for a successful backend creation.</li></ul></li><li><p>Define a StorageClass and SnapshotClass.</p><ol><li><p>Put the following into a file, for example <code>/tmp/storage.yaml</code></p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> storage.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> StorageClass</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ontap</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">san</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">provisioner</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi.trident.netapp.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">parameters</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">backendType</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;&lt;"ontap</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">san" or "ontap</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">san</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">economy"</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">allowVolumeExpansion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> snapshot.storage.k8s.io/v1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VolumeSnapshotClass</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">snapclass</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">driver</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> csi.trident.netapp.io</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">deletionPolicy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Delete</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Select the correct value for the backendType in this file before applying.</p></li><li><p>Apply the definitions:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f /tmp/storage.yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol></li><li><p>Enable multipathd</p><p>The following is required to enable multipathd.
This must be done on every node of the Harvester cluster, using root access.
The preceding steps should only be done once on a single node.</p><ol><li><p>Create this file in <code>/oem/99_multipathd.yaml</code>:</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">stages</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">   </span><span class="token key atrule" style="color:#00a4db">initramfs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">   </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Setup multipathd"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">systemctl</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         </span><span class="token key atrule" style="color:#00a4db">enable</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> multipathd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         </span><span class="token key atrule" style="color:#00a4db">start</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> multipathd</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Configure <code>multipathd</code> to exclude pathnames used by Longhorn.</p><p>This part is a little tricky.  <code>multipathd</code> will automatically discover
device names matching a certain pattern, and attempt to set up multipathing on them.
Unfortunately, Longhorn's device names follow the same pattern, and
will not work correctly if <code>multipathd</code> tries to use those devices.</p><p>Therefore the file <code>/etc/multipath.conf</code> must be set up on each node
so as to prevent <code>multipathd</code> from touching any of the devices
that Longhorn will use.  Unfortunately, it is not possible to know
in advance which device names will be used until the volumes are attached
to a VM when the VM is started, or when the volumes are hot-added to a running VM.
The recommended method is to "whitelist" the Trident devices using device
properties rather than device naming.  The properties to allow are the
device vendor and product.  Here is an example of what you'll want in <code>/etc/multipath.conf</code>:</p><div class="codeBlockContainer_I0IT language-text theme-code-block"><div class="codeBlockContent_wNvx text"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">blacklist {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    device {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        vendor "!NETAPP"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        product "!LUN"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">}</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">blacklist_exceptions {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    device {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        vendor "NETAPP"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        product "LUN"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p> This example only works if NetApp is the only storage provider in the system for which <code>multipathd</code> must be used.  More complex environments will require more complex configuration.</p><p> Explicitly putting that content into <code>/etc/multipath.conf</code> will work when you start <code>multipathd</code> as described below, but the change in <code>/etc</code> will not persist across node reboots.  To solve that problem, you should add another file to <code>/oem</code> that will re-generate <code>/etc/multipath.conf</code> when the node reboots.  The following example will create the <code>/etc/multipath.conf</code> given in the example above, but may need to be modified for your environment if you have a more complex iSCSI configuration:</p><div class="codeBlockContainer_I0IT language-text theme-code-block"><div class="codeBlockContent_wNvx text"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">stages:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">   initramfs:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">     - name: "Configure multipath blacklist and whitelist"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">       files:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">       - path: /etc/multipath.conf</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         permissions: 0644</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         owner: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         group: 0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">         content: |</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">           blacklist {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">               device {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                   vendor "!NETAPP"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                   product "!LUN"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            blacklist_exceptions {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                device {</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    vendor "NETAPP"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                    product "LUN"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">                }</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            }</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p> Remember, this has to be done on every node.</p></li><li><p>Enable multipathd.</p><p>Adding the above files to <code>/oem</code> will take effect on the next reboot of the node; <code>multipathd</code> can be enabled immediately without rebooting the node using the following commands:</p><div class="codeBlockContainer_I0IT language-shell theme-code-block"><div class="codeBlockContent_wNvx shell"><pre tabindex="0" class="prism-code language-shell codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">systemctl </span><span class="token builtin class-name">enable</span><span class="token plain"> multipathd</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">systemctl start multipathd</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>  After the above steps, the <code>ontap-san-economy</code> storage class should be available when creating a volume for a Harvester VM.</p></li></ol></li></ol>]]></content:encoded>
            <category>harvester</category>
        </item>
        <item>
            <title><![CDATA[Configure PriorityClass on Longhorn System Components]]></title>
            <link>https://harvesterhci.io/kb/configure_priority_class_longhorn</link>
            <guid>configure_priority_class_longhorn</guid>
            <pubDate>Tue, 25 Jul 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Configure priority classes on Longhorn system components]]></description>
            <content:encoded><![CDATA[<p><strong>Harvester v1.2.0</strong>  introduces a new enhancement where Longhorn system-managed components in newly-deployed clusters are automatically assigned a <code>system-cluster-critical</code> priority class by default. However, when upgrading your Harvester clusters from previous versions, you may notice that Longhorn system-managed components do not have any priority class set.</p><p>This behavior is intentional and aimed at supporting zero-downtime upgrades. Longhorn does not allow changing the <code>priority-class</code> setting when attached volumes exist. For more details, please refer to <a href="https://longhorn.io/docs/1.4.3/advanced-resources/deploy/priority-class/#setting-priority-class-during-longhorn-installation" target="_blank" rel="noopener noreferrer">Setting Priority Class During Longhorn Installation</a>).</p><p>This article explains how to manually configure priority classes for Longhorn system-managed components after upgrading your Harvester cluster, ensuring that your Longhorn components have the appropriate priority class assigned and maintaining the stability and performance of your system.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="stop-all-virtual-machines">Stop all virtual machines<a class="hash-link" href="#stop-all-virtual-machines" title="Direct link to heading">​</a></h2><p>Stop all virtual machines (VMs) to detach all volumes. Please back up any work before doing this.</p><ol><li><p><a href="https://docs.harvesterhci.io/v1.1/troubleshooting/os#how-to-log-into-a-harvester-node" target="_blank" rel="noopener noreferrer">Login to a Harvester controller node and become root</a>.</p></li><li><p>Get all running VMs and write down their namespaces and names:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get vmi -A</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Alternatively, you can get this information by backing up the Virtual Machine Instance (VMI) manifests with the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get vmi -A -o json </span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> vmi-backup.json</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Shut down all VMs. Log in to all running VMs and shut them down gracefully (recommended). Or use the following command to send shutdown signals to all VMs:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get vmi -A -o json </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> jq -r </span><span class="token string" style="color:#e3116c">'.items[] | [.metadata.name, .metadata.namespace] | @tsv'</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">while</span><span class="token plain"> </span><span class="token assign-left variable environment constant" style="color:#36acaa">IFS</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">$'</span><span class="token string entity" style="color:#36acaa">\t</span><span class="token string" style="color:#e3116c">'</span><span class="token plain"> </span><span class="token builtin class-name">read</span><span class="token plain"> -r name namespace</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">do</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"> -z </span><span class="token string" style="color:#e3116c">"</span><span class="token string variable" style="color:#36acaa">$name</span><span class="token string" style="color:#e3116c">"</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">then</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token builtin class-name">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token keyword" style="color:#00009f">fi</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token builtin class-name">echo</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Stop </span><span class="token string variable" style="color:#36acaa">${namespace}</span><span class="token string" style="color:#e3116c">/</span><span class="token string variable" style="color:#36acaa">${name}</span><span class="token string" style="color:#e3116c">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      virtctl stop </span><span class="token variable" style="color:#36acaa">$name</span><span class="token plain"> -n </span><span class="token variable" style="color:#36acaa">$namespace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">done</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>  You can also stop all VMs from the Harvester UI:</p><ol><li>Go to the <strong>Virtual Machines</strong> page.</li><li>For each VM, select <strong>⋮</strong> &gt; <strong>Stop</strong>.</li></ol></div></div></li><li><p>Ensure there are no running VMs:</p><p>Run the command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get vmi -A</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The above command must return:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">No resources found</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="scale-down-monitoring-pods">Scale down monitoring pods<a class="hash-link" href="#scale-down-monitoring-pods" title="Direct link to heading">​</a></h2><ol><li><p>Scale down the Prometheus deployment. Run the following command and wait for all Prometheus pods to terminate:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch -n cattle-monitoring-system prometheus/rancher-monitoring-prometheus --patch </span><span class="token string" style="color:#e3116c">'{"spec": {"replicas": 0}}'</span><span class="token plain"> --type merge </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system statefulset/prometheus-rancher-monitoring-prometheus</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">prometheus.monitoring.coreos.com/rancher-monitoring-prometheus patched</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">statefulset rolling update complete 0 pods at revision prometheus-rancher-monitoring-prometheus-cbf6bd5f7...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Scale down the AlertManager deployment. Run the following command and wait for all AlertManager pods to terminate:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch -n cattle-monitoring-system alertmanager/rancher-monitoring-alertmanager --patch </span><span class="token string" style="color:#e3116c">'{"spec": {"replicas": 0}}'</span><span class="token plain"> --type merge </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system statefulset/alertmanager-rancher-monitoring-alertmanager</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">alertmanager.monitoring.coreos.com/rancher-monitoring-alertmanager patched</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">statefulset rolling update complete 0 pods at revision alertmanager-rancher-monitoring-alertmanager-c8c459dff...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Scale down the Grafana deployment. Run the following command and wait for all Grafana pods to terminate:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl scale --replicas</span><span class="token operator" style="color:#393A34">=</span><span class="token number" style="color:#36acaa">0</span><span class="token plain"> deployment/rancher-monitoring-grafana -n cattle-monitoring-system </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system deployment/rancher-monitoring-grafana</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/rancher-monitoring-grafana scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment "rancher-monitoring-grafana" successfully rolled out</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="scale-down-vm-import-controller-pods">Scale down vm-import-controller pods<a class="hash-link" href="#scale-down-vm-import-controller-pods" title="Direct link to heading">​</a></h2><ol><li><p>Check if the <a href="https://docs.harvesterhci.io/v1.1/advanced/vmimport" target="_blank" rel="noopener noreferrer"><code>vm-import-controller</code></a> addon is enabled and configured with a persistent volume with the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get pvc -n harvester-system harvester-vm-import-controller</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>If the above command returns an output like this, you must scale down the <code>vm-import-controller</code> pod. Otherwise, you can skip the following step.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                             STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS         AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-vm-import-controller   Bound    pvc-eb23e838-4c64-4650-bd8f-ba7075ab0559   200Gi      RWO            harvester-longhorn   2m53s</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Scale down the <code>vm-import-controller</code> pods with the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl scale --replicas</span><span class="token operator" style="color:#393A34">=</span><span class="token number" style="color:#36acaa">0</span><span class="token plain"> deployment/harvester-vm-import-controller -n harvester-system </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n harvester-system deployment/harvester-vm-import-controller</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/harvester-vm-import-controller scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment "harvester-vm-import-controller" successfully rolled out</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="set-the-priority-class-setting">Set the <code>priority-class</code> setting<a class="hash-link" href="#set-the-priority-class-setting" title="Direct link to heading">​</a></h2><ol><li><p>Before applying the <code>priority-class</code> setting, you need to verify all volumes are detached. Run the following command to verify the <code>STATE</code> of each volume is <code>detached</code>:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get volumes.longhorn.io -A</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Verify the output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE         NAME                                       STATE      ROBUSTNESS   SCHEDULED   SIZE           NODE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-5743fd02-17a3-4403-b0d3-0e9b401cceed   detached   unknown                  5368709120            15d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-7e389fe8-984c-4049-9ba8-5b797cb17278   detached   unknown                  53687091200           15d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-8df64e54-ecdb-4d4e-8bab-28d81e316b8b   detached   unknown                  2147483648            15d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">longhorn-system   pvc-eb23e838-4c64-4650-bd8f-ba7075ab0559   detached   unknown                  214748364800          11m</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Set the <code>priority-class</code> setting with the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch -n longhorn-system settings.longhorn.io priority-class --patch </span><span class="token string" style="color:#e3116c">'{"value": "system-cluster-critical"}'</span><span class="token plain"> --type merge</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Longhorn system-managed pods will restart and then you need to check if all the system-managed components have a priority class set:</p><p>Get the value of the priority class <code>system-cluster-critical</code>:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get priorityclass system-cluster-critical</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Verify the output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME                      VALUE        GLOBAL-DEFAULT   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">system-cluster-critical   2000000000   false            15d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Use the following command to get pods' priority in the <code>longhorn-system</code> namespace:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get pods -n longhorn-system -o custom-columns</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">"Name"</span><span class="token plain">:metadata.name,</span><span class="token string" style="color:#e3116c">"Priority"</span><span class="token plain">:.spec.priority</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Verify all system-managed components' pods have the correct priority. System-managed components include:</p><ul><li><code>csi-attacher</code></li><li><code>csi-provisioner</code></li><li><code>csi-resizer</code></li><li><code>csi-snapshotter</code></li><li><code>engine-image-ei</code></li><li><code>instance-manager-e</code></li><li><code>instance-manager-r</code></li><li><code>longhorn-csi-plugin</code></li></ul></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="scale-up-vm-import-controller-pods">Scale up vm-import-controller pods<a class="hash-link" href="#scale-up-vm-import-controller-pods" title="Direct link to heading">​</a></h2><p>If you scale down the <code>vm-import-controller</code> pods, you must scale it up again. </p><ol><li><p>Scale up the <code>vm-import-controller</code> pod. Run the command: </p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl scale --replicas</span><span class="token operator" style="color:#393A34">=</span><span class="token number" style="color:#36acaa">1</span><span class="token plain"> deployment/harvester-vm-import-controller -n harvester-system </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n harvester-system deployment/harvester-vm-import-controller</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/harvester-vm-import-controller scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Waiting for deployment "harvester-vm-import-controller" rollout to finish: 0 of 1 updated replicas are available...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment "harvester-vm-import-controller" successfully rolled out</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Verify <code>vm-import-controller</code> is running using the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get pods --selector app.kubernetes.io/instance</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">vm-import-controller -A</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this, the pod's <code>STATUS</code> must be <code>Running</code>:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAMESPACE          NAME                                              READY   STATUS    RESTARTS   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">harvester-system   harvester-vm-import-controller-6bd8f44f55-m9k86   1/1     Running   0          4m53s</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="scale-up-monitoring-pods">Scale up monitoring pods<a class="hash-link" href="#scale-up-monitoring-pods" title="Direct link to heading">​</a></h2><ol><li><p>Scale up the Prometheus deployment. Run the following command and wait for all Prometheus pods to roll out:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch -n cattle-monitoring-system prometheus/rancher-monitoring-prometheus --patch </span><span class="token string" style="color:#e3116c">'{"spec": {"replicas": 1}}'</span><span class="token plain"> --type merge </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system statefulset/prometheus-rancher-monitoring-prometheus</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">prometheus.monitoring.coreos.com/rancher-monitoring-prometheus patched</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Waiting for 1 pods to be ready...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">statefulset rolling update complete 1 pods at revision prometheus-rancher-monitoring-prometheus-cbf6bd5f7...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Scale down the AlertManager deployment. Run the following command and wait for all AlertManager pods to roll out:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl patch -n cattle-monitoring-system alertmanager/rancher-monitoring-alertmanager --patch </span><span class="token string" style="color:#e3116c">'{"spec": {"replicas": 1}}'</span><span class="token plain"> --type merge </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system statefulset/alertmanager-rancher-monitoring-alertmanager</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">alertmanager.monitoring.coreos.com/rancher-monitoring-alertmanager patched</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Waiting for 1 pods to be ready...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">statefulset rolling update complete 1 pods at revision alertmanager-rancher-monitoring-alertmanager-c8bd4466c...</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Scale down the Grafana deployment. Run the following command and wait for all Grafana pods to roll out:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl scale --replicas</span><span class="token operator" style="color:#393A34">=</span><span class="token number" style="color:#36acaa">1</span><span class="token plain"> deployment/rancher-monitoring-grafana -n cattle-monitoring-system </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function" style="color:#d73a49">sleep</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">5</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    kubectl rollout status --watch</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">true -n cattle-monitoring-system deployment/rancher-monitoring-grafana</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>A sample output looks like this:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">deployment.apps/rancher-monitoring-grafana scaled</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Waiting for deployment "rancher-monitoring-grafana" rollout to finish: 0 of 1 updated replicas are available...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">deployment "rancher-monitoring-grafana" successfully rolled out</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="start-virtual-machines">Start virtual machines<a class="hash-link" href="#start-virtual-machines" title="Direct link to heading">​</a></h2><ol><li><p>Start a VM with the command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virtctl start </span><span class="token variable" style="color:#36acaa">$name</span><span class="token plain"> -n </span><span class="token variable" style="color:#36acaa">$namespace</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Replace <code>$name</code> with the VM's name and <code>$namespace</code> with the VM's namespace. You can list all virtual machines with the command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get vms -A</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p> You can also stop all VMs from the Harvester UI:</p><ol><li>Go to the <strong>Virtual Machines</strong> page.</li><li>For each VM, select <strong>⋮</strong> &gt; <strong>Start</strong>.</li></ol></div></div><p>Alternatively, you can start all running VMs with the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">cat</span><span class="token plain"> vmi-backup.json </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> jq -r </span><span class="token string" style="color:#e3116c">'.items[] | [.metadata.name, .metadata.namespace] | @tsv'</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">while</span><span class="token plain"> </span><span class="token assign-left variable environment constant" style="color:#36acaa">IFS</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">$'</span><span class="token string entity" style="color:#36acaa">\t</span><span class="token string" style="color:#e3116c">'</span><span class="token plain"> </span><span class="token builtin class-name">read</span><span class="token plain"> -r name namespace</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">do</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"> -z </span><span class="token string" style="color:#e3116c">"</span><span class="token string variable" style="color:#36acaa">$name</span><span class="token string" style="color:#e3116c">"</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">then</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token builtin class-name">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token keyword" style="color:#00009f">fi</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token builtin class-name">echo</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Start </span><span class="token string variable" style="color:#36acaa">${namespace}</span><span class="token string" style="color:#e3116c">/</span><span class="token string variable" style="color:#36acaa">${name}</span><span class="token string" style="color:#e3116c">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      virtctl start </span><span class="token variable" style="color:#36acaa">$name</span><span class="token plain"> -n </span><span class="token variable" style="color:#36acaa">$namespace</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">done</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li></ol>]]></content:encoded>
            <category>harvester</category>
            <category>longhorn</category>
            <category>priority class</category>
        </item>
        <item>
            <title><![CDATA[Package your own Toolbox Image]]></title>
            <link>https://harvesterhci.io/kb/package_your_own_toolbox_image</link>
            <guid>package_your_own_toolbox_image</guid>
            <pubDate>Thu, 06 Jul 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[How to package your own toolbox image]]></description>
            <content:encoded><![CDATA[<p>Harvester OS is designed as an immutable operating system, which means you cannot directly install additional packages on it. While there is a way to <a href="https://docs.harvesterhci.io/dev/troubleshooting/os#how-can-i-install-packages-why-are-some-paths-read-only" target="_blank" rel="noopener noreferrer">install packages</a>, it is strongly advised against doing so, as it may lead to system instability.</p><p>If you only want to debug with the system, the preferred way is to package the toolbox image with all the needed packages. </p><p>This article shares how to package your toolbox image and how to install any packages on the toolbox image that help you debug the system.</p><p>For example, if you want to analyze a storage performance issue, you can install <code>blktrace</code> on the toolbox image.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="create-a-dockerfile">Create a Dockerfile<a class="hash-link" href="#create-a-dockerfile" title="Direct link to heading">​</a></h2><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">FROM opensuse/leap:15.4</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Install blktrace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">RUN </span><span class="token function" style="color:#d73a49">zypper</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">in</span><span class="token plain"> -y </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    blktrace</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">RUN </span><span class="token function" style="color:#d73a49">zypper</span><span class="token plain"> clean --all</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="build-the-image-and-push">Build the image and push<a class="hash-link" href="#build-the-image-and-push" title="Direct link to heading">​</a></h2><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># assume you are in the directory of Dockerfile</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">docker</span><span class="token plain"> build -t harvester/toolbox:dev </span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">naming to docker.io/harvester/toolbox:dev </span><span class="token punctuation" style="color:#393A34">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">docker</span><span class="token plain"> push harvester/toolbox:dev</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">d4b76d0683d4: Pushed </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">a605baa225e2: Pushed </span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">9e9058bdf63c: Layer already exists </span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After you build and push the image, you can run the toolbox using this image to trace storage performance.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="run-the-toolbox">Run the toolbox<a class="hash-link" href="#run-the-toolbox" title="Direct link to heading">​</a></h2><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># use `privileged` flag only when you needed. blktrace need debugfs, so I add extra mountpoint.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">docker</span><span class="token plain"> run -it --privileged -v /sys/kernel/debug/:/sys/kernel/debug/ --rm harvester/toolbox:dev </span><span class="token function" style="color:#d73a49">bash</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># test blktrace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">6ffa8eda3aaf:/ $ blktrace -d /dev/nvme0n1 -o - </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> blkparse -i -</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3414</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020814875</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  Q  WS </span><span class="token number" style="color:#36acaa">2414127984</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3415</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020815190</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  G  WS </span><span class="token number" style="color:#36acaa">2414127984</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3416</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020815989</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  C  WS </span><span class="token number" style="color:#36acaa">3206896544</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">0</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3417</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020816652</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  C  WS </span><span class="token number" style="color:#36acaa">2140319184</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">0</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3418</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020817992</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  P   N </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3419</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020818227</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  U   N </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3420</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020818437</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  D  WS </span><span class="token number" style="color:#36acaa">2414127984</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3421</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020821826</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  Q  WS </span><span class="token number" style="color:#36acaa">1743934904</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token number" style="color:#36acaa">259,0</span><span class="token plain">   </span><span class="token number" style="color:#36acaa">10</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">3422</span><span class="token plain">     </span><span class="token number" style="color:#36acaa">0.020822150</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">34084</span><span class="token plain">  G  WS </span><span class="token number" style="color:#36acaa">1743934904</span><span class="token plain"> + </span><span class="token number" style="color:#36acaa">8</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">fio</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div>]]></content:encoded>
            <category>debug</category>
            <category>harvester</category>
            <category>container</category>
        </item>
        <item>
            <title><![CDATA[Scan and Repair Root Filesystem of VirtualMachine]]></title>
            <link>https://harvesterhci.io/kb/scan-and-repair-vm-root-filesystem</link>
            <guid>scan-and-repair-vm-root-filesystem</guid>
            <pubDate>Wed, 01 Feb 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Scan and repair root filesystem of VM]]></description>
            <content:encoded><![CDATA[<p>In earlier versions of Harvester (v1.0.3 and prior), Longhorn volumes may get corrupted during the replica rebuilding process (reference: <a href="https://longhorn.io/kb/troubleshooting-volume-filesystem-corruption/#solution" target="_blank" rel="noopener noreferrer">Analysis: Potential Data/Filesystem Corruption</a>). In Harvester v1.1.0 and later versions, the Longhorn team has fixed this issue. This article covers manual steps you can take to scan the VM's filesystem and repair it if needed.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="stop-the-vm-and-backup-volume">Stop The VM And Backup Volume<a class="hash-link" href="#stop-the-vm-and-backup-volume" title="Direct link to heading">​</a></h2><p>Before you scan the filesystem, it is recommend you back up the volume first. For an example, refer to the following steps to stop the VM and backup the volume.</p><ul><li>Find the target VM.</li></ul><p><img loading="lazy" alt="finding the target VM" src="/assets/images/finding_the_target_vm-c3f5c227fdeda94499a32e880a302e80.png" width="2560" height="880"></p><ul><li>Stop the target VM.</li></ul><p><img loading="lazy" alt="Stop the target VM" src="/assets/images/stop_the_target_vm-35b68914885fd42f4b7310aa849f944f.png" width="2546" height="856"></p><p>The target VM is stopped and the related volumes are detached. Now go to the Longhorn UI to backup this volume.</p><ul><li>Enable <code>Developer Tools &amp; Features</code> (Preferences -&gt; Enable Developer Tools &amp; Features).</li></ul><p><img loading="lazy" alt="Preferences then enable developer mode" src="/assets/images/preferences_enable_developer_mode-1379680f02f9980091177736ed7ce523.png" width="2570" height="1090">
<img loading="lazy" alt="Enable the developer mode" src="/assets/images/enable_the_developer_mode-8dffb1796b8e5da9863d6c69ad7f0209.png" width="2760" height="350"></p><ul><li>Click the <code>⋮</code> button and select <strong>Edit Config</strong> to edit the config page of the VM.</li></ul><p><img loading="lazy" alt="goto edit config page of VM" src="/assets/images/goto_vm_edit_config_page-52e958d3a5e04c912e77615d3ab05616.png" width="2526" height="964"></p><ul><li>Go to the <code>Volumes</code> tab and select <code>Check volume details.</code></li></ul><p><img loading="lazy" alt="link to longhorn volume page" src="/assets/images/link_to_longhorn_volume-ced67ce270fd55fa7ff5a73c651ae940.png" width="2522" height="1372"></p><ul><li>Click the dropdown menu on the right side and select 'Attach' to attach the volume again. </li></ul><p><img loading="lazy" alt="attach this volume again" src="/assets/images/attach_this_volume_again-f008c1d56b9cdfa2b141e30093cc51fe.png" width="2972" height="1358"></p><ul><li>Select the attached node. </li></ul><p><img loading="lazy" alt="choose the attached node" src="/assets/images/choose_the_attached_node-cde38647a09abf50189b40f5a37da9cb.png" width="2964" height="1362"></p><ul><li>Check the volume attached under <code>Volume Details</code> and select <code>Take Snapshot</code> on this volume page.</li></ul><p><img loading="lazy" alt="take snapshot on volume page" src="/assets/images/take_snapshot_on_volume_page-fe966d238b47aea3360b6f5c55664846.png" width="2976" height="1358"></p><ul><li>Confirm that the snapshot is ready.</li></ul><p><img loading="lazy" alt="check the snapshot is ready" src="/assets/images/check_the_snapshot_is_ready-7f0716b1b699c668c11ad5b5b46596b0.png" width="2968" height="1356"></p><p>Now that you completed the volume backup, you need to scan and repair the root filesystem.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="scanning-the-root-filesystem-and-repairing">Scanning the root filesystem and repairing<a class="hash-link" href="#scanning-the-root-filesystem-and-repairing" title="Direct link to heading">​</a></h2><p>This section will introduce how to scan the filesystem (e.g., XFS, EXT4) using related tools.</p><p>Before scanning, you need to know the filesystem's device/partition.</p><ul><li>Identify the filesystem's device by checking the major and minor numbers of that device.</li></ul><ol><li><p>Obtain the major and minor numbers from the listed volume information.</p><p>In the following example, the volume name is <code>pvc-ea7536c0-301f-479e-b2a2-e40ddc864b58</code>.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester-node-0:~ # ls /dev/longhorn/pvc-ea7536c0-301f-479e-b2a2-e40ddc864b58 -al</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">brw-rw---- 1 root root 8, 0 Oct 23 14:43 /dev/longhorn/pvc-ea7536c0-301f-479e-b2a2-e40ddc864b58</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The output indicates that the major and minor numbers are <code>8:0</code>.</p></li><li><p>Obtain the device name from the output of the <code>lsblk</code> command.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">harvester-node-0:~ # lsblk</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">loop0    7:0    0     3G  1 loop /</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">sda      8:0    0    40G  0 disk</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">├─sda1   8:1    0     2M  0 part</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">├─sda2   8:2    0    20M  0 part</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">└─sda3   8:3    0    40G  0 part</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>The output indicates that <code>8:0</code> are the major and minor numbers of the device named <code>sda</code>. Therefore, <code>/dev/sda</code> is related to the volume named <code>pvc-ea7536c0-301f-479e-b2a2-e40ddc864b58</code>.</p></li></ol><ul><li>You should now know the filesystem's partition. In the example below, sda3 is the filesystem's partition.</li><li>Use the Filesystem toolbox image to scan and repair.</li></ul><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># docker run -it --rm --privileged registry.opensuse.org/isv/rancher/harvester/toolbox/main/fs-toolbox:latest -- bash</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Then we try to scan with this target device.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="xfs">XFS<a class="hash-link" href="#xfs" title="Direct link to heading">​</a></h3><p>When scanning an XFS filesystem, use the <code>xfs_repair</code> command and specify the problematic partition of the device.</p><p>In the following example, <code>/dev/sda3</code> is the problematic partition.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># xfs_repair -n /dev/sda3</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>To repair the corrupted partition, run the following command.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># xfs_repair /dev/sda3</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="ext4">EXT4<a class="hash-link" href="#ext4" title="Direct link to heading">​</a></h3><p>When scanning a EXT4 filesystem, use the <code>e2fsck</code> command as follows, where the <code>/dev/sde1</code> is the problematic partition of the device.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># e2fsck -f /dev/sde1</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>To repair the corrupted partition, run the following command.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># e2fsck -fp /dev/sde1</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After using the 'e2fsck' command, you should also see logs related to scanning and repairing the partition. Scanning and repairing the corrupted partition is successful if there are no errors in these logs. </p><h2 class="anchor anchorWithStickyNavbar_mojV" id="detach-and-start-vm-again">Detach and Start VM again.<a class="hash-link" href="#detach-and-start-vm-again" title="Direct link to heading">​</a></h2><p>After the corrupted partition is scanned and repaired, detach the volume and try to start the related VM again.</p><ul><li>Detach the volume from the Longhorn UI.</li></ul><p><img loading="lazy" alt="detach volume on longhorn UI" src="/assets/images/detach_volume-a71a0c79f0a6052fd5ecb562bf532b71.png" width="2964" height="1364"></p><ul><li>Start the related VM again from the Harvester UI.</li></ul><p><img loading="lazy" alt="Start VM again" src="/assets/images/start_vm_again-6ce38c23de061f1587da9e4f8698b7e8.png" width="2540" height="854"></p><p>Your VM should now work normally.</p>]]></content:encoded>
            <category>storage</category>
            <category>longhorn</category>
            <category>root</category>
            <category>filesystem</category>
        </item>
        <item>
            <title><![CDATA[Evicting Replicas From a Disk (the CLI way)]]></title>
            <link>https://harvesterhci.io/kb/evicting-replicas-from-a-disk-the-cli-way</link>
            <guid>evicting-replicas-from-a-disk-the-cli-way</guid>
            <pubDate>Thu, 12 Jan 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Evicting replicas from a disk (the CLI way)]]></description>
            <content:encoded><![CDATA[<p>Harvester replicates volumes data across disks in a cluster. Before removing a disk, the user needs to evict replicas on the disk to other disks to preserve the volumes' configured availability. For more information about eviction in Longhorn, please check <a href="https://longhorn.io/docs/1.3.2/volumes-and-nodes/disks-or-nodes-eviction/" target="_blank" rel="noopener noreferrer">Evicting Replicas on Disabled Disks or Nodes</a>.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="preparation">Preparation<a class="hash-link" href="#preparation" title="Direct link to heading">​</a></h2><p>This document describes how to evict Longhorn disks using the <code>kubectl</code> command. Before that, users must ensure the environment is set up correctly.
There are two recommended ways to do this:</p><ol><li>Log in to any management node and switch to root (<code>sudo -i</code>).</li><li>Download Kubeconfig file and use it locally<ul><li>Install <code>kubectl</code> and <code>yq</code> program manually.</li><li>Open Harvester GUI,  click <code>support</code> at the bottom left of the page and click <code>Download KubeConfig</code> to download the Kubeconfig file.</li><li>Set the Kubeconfig file's path to <code>KUBECONFIG</code> environment variable. For example, <code>export KUBECONFIG=/path/to/kubeconfig</code>.</li></ul></li></ol><h2 class="anchor anchorWithStickyNavbar_mojV" id="evicting-replicas-from-a-disk">Evicting replicas from a disk<a class="hash-link" href="#evicting-replicas-from-a-disk" title="Direct link to heading">​</a></h2><ol><li><p>List Longhorn nodes (names are identical to Kubernetes nodes):</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get -n longhorn-system nodes.longhorn.io</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Sample output:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">NAME    READY   ALLOWSCHEDULING   SCHEDULABLE   AGE</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">node1   True    true              True          24d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">node2   True    true              True          24d</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">node3   True    true              True          24d</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>List disks on a node. Assume we want to evict replicas of a disk on <code>node1</code>:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get -n longhorn-system nodes.longhorn.io node1 -o yaml | yq e '.spec.disks'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Sample output:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">default-disk-ed7af10f5b8356be:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  allowScheduling: true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  evictionRequested: false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  path: /var/lib/harvester/defaultdisk</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  storageReserved: 36900254515</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  tags: []</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Assume disk <code>default-disk-ed7af10f5b8356be</code> is the target we want to evict replicas out of.</p><p>Edit the node:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl edit -n longhorn-system nodes.longhorn.io node1 </span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Update these two fields and save:</p><ul><li><code>spec.disks.&lt;disk_name&gt;.allowScheduling</code> to <code>false</code></li><li><code>spec.disks.&lt;disk_name&gt;.evictionRequested</code> to <code>true</code></li></ul><p>Sample editing:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">default-disk-ed7af10f5b8356be:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  allowScheduling: false</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  evictionRequested: true</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  path: /var/lib/harvester/defaultdisk</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  storageReserved: 36900254515</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  tags: []</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></li><li><p>Wait for all replicas on the disk to be evicted.</p><p>Get current scheduled replicas on the disk:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kubectl get -n longhorn-system nodes.longhorn.io node1 -o yaml | yq e '.status.diskStatus.default-disk-ed7af10f5b8356be.scheduledReplica'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Sample output:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">pvc-86d3d212-d674-4c64-b69b-4a2eb1df2272-r-7b422db7: 5368709120</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">pvc-b06f0b09-f30c-4936-8a2a-425b993dd6cb-r-bb0fa6b3: 2147483648</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">pvc-b844bcc6-3b06-4367-a136-3909251cb560-r-08d1ab3c: 53687091200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">pvc-ea6e0dff-f446-4a38-916a-b3bea522f51c-r-193ca5c6: 10737418240</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Run the command repeatedly, and the output should eventually become an empty map:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">{}</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>This means Longhorn evicts replicas on the disk to other disks.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If a replica always stays in a disk, please open the <a href="https://docs.harvesterhci.io/v1.1/troubleshooting/harvester#access-embedded-rancher-and-longhorn-dashboards" target="_blank" rel="noopener noreferrer">Longhorn GUI</a> and check if there is free space on other disks.</p></div></div></li></ol>]]></content:encoded>
            <category>storage</category>
            <category>longhorn</category>
            <category>disk</category>
        </item>
        <item>
            <title><![CDATA[NIC Naming Scheme]]></title>
            <link>https://harvesterhci.io/kb/nic-naming-scheme</link>
            <guid>nic-naming-scheme</guid>
            <pubDate>Wed, 06 Apr 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[NIC Naming Scheme changed after upgrading to v1.0.1]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="nic-naming-scheme-changed-after-upgrading-to-v101">NIC Naming Scheme changed after upgrading to v1.0.1<a class="hash-link" href="#nic-naming-scheme-changed-after-upgrading-to-v101" title="Direct link to heading">​</a></h2><p><code>systemd</code> in OpenSUSE Leap 15.3 which is the base OS of Harvester is upgraded to <code>246.16-150300.7.39.1</code>. In this version, <code>systemd</code> will enable additional naming scheme <code>sle15-sp3</code> which is <code>v238</code> with <code>bridge_no_slot</code>. When there is a PCI bridge associated with NIC, <code>systemd</code> will never generate <code>ID_NET_NAME_SLOT</code> and naming policy in <code>/usr/lib/systemd/network/99-default.link</code> will fallback to <code>ID_NET_NAME_PATH</code>. According to this change, NIC names might be changed in your Harvester nodes during the upgrade process from <code>v1.0.0</code> to <code>v1.0.1-rc1</code> or above, and it will cause network issues that are associated with NIC names.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="effect-settings-and-workaround">Effect Settings and Workaround<a class="hash-link" href="#effect-settings-and-workaround" title="Direct link to heading">​</a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="startup-network-configuration">Startup Network Configuration<a class="hash-link" href="#startup-network-configuration" title="Direct link to heading">​</a></h3><p>NIC name changes will need to update the name in <code>/oem/99_custom.yaml</code>. You could use <a href="https://github.com/harvester/upgrade-helpers/blob/main/hack/udev_v238_sle15-sp3.py" target="_blank" rel="noopener noreferrer">migration script</a> to change the NIC names which are associated with a PCI bridge.</p><div class="admonition admonition-tip alert alert--success"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</h5></div><div class="admonition-content"><p>You could find an identical machine to test naming changes before applying the configuration to production machines</p></div></div><p>You could simply execute the script with root account in <code>v1.0.0</code> via</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># python3 udev_v238_sle15-sp3.py</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>It will output the patched configuration to the screen and you could compare it to the original one to ensure there is no exception. (e.g. We could use <code>vimdiff</code> to check the configuration)</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># python3 udev_v238_sle15-spe3.py &gt; /oem/test</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># vimdiff /oem/test /oem/99_custom.yaml</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>After checking the result, we could execute the script with <code>--really-want-to-do</code> to override the configuration. It will also back up the original configuration file with a timestamp before patching it.</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># python3 udev_v238_sle15-sp3.py --really-want-to-do</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="harvester-vlan-network-configuration">Harvester VLAN Network Configuration<a class="hash-link" href="#harvester-vlan-network-configuration" title="Direct link to heading">​</a></h3><p>If your VLAN network is associated with NIC name directly without <code>bonding</code>, you will need to migrate <code>ClusterNetwork</code> and <code>NodeNetwork</code> with the previous section together.</p><div class="admonition admonition-note alert alert--secondary"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</h5></div><div class="admonition-content"><p>If your VLAN network is associated with the <code>bonding</code> name in <code>/oem/99_custom.yaml</code>, you could skip this section.</p></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="modify-clusternetworks">Modify ClusterNetworks<a class="hash-link" href="#modify-clusternetworks" title="Direct link to heading">​</a></h4><p>You need to modify <code>ClusterNetworks</code> via </p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl edit clusternetworks vlan</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>search this pattern</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">defaultPhysicalNIC</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;Your NIC name</span><span class="token punctuation" style="color:#393A34">&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>and change to new NIC name</p><h4 class="anchor anchorWithStickyNavbar_mojV" id="modify-nodenetworks">Modify NodeNetworks<a class="hash-link" href="#modify-nodenetworks" title="Direct link to heading">​</a></h4><p>You need to modify <code>NodeNetworks</code> via</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ kubectl edit nodenetworks </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Node name</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain">-vlan</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>search this pattern</p><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nic</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;Your NIC name</span><span class="token punctuation" style="color:#393A34">&gt;</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>and change to new NIC name</p>]]></content:encoded>
            <category>network</category>
        </item>
        <item>
            <title><![CDATA[Multiple NICs VM Connectivity]]></title>
            <link>https://harvesterhci.io/kb/multiple-nics-vm-connectivity</link>
            <guid>multiple-nics-vm-connectivity</guid>
            <pubDate>Thu, 10 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[What is the default behavior of a VM with multiple NICs]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="what-is-the-default-behavior-of-a-vm-with-multiple-nics">What is the default behavior of a VM with multiple NICs<a class="hash-link" href="#what-is-the-default-behavior-of-a-vm-with-multiple-nics" title="Direct link to heading">​</a></h2><p>In <a href="https://github.com/harvester/harvester/issues/1059" target="_blank" rel="noopener noreferrer">some scenarios</a>, you'll setup two or more NICs in your VM to serve different networking purposes. If all networks are setup by default with DHCP, you might get random connectivity issues. And while it might get fixed after rebooting the VM, it still will lose connection randomly after some period.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-identify-connectivity-issues">How-to identify connectivity issues<a class="hash-link" href="#how-to-identify-connectivity-issues" title="Direct link to heading">​</a></h2><p>In a Linux VM, you can use commands from the <code>iproute2</code> package to identify the default route.</p><p>In your VM, execute the following command:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">ip</span><span class="token plain"> route show default</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-tip alert alert--success"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</h5></div><div class="admonition-content"><p>If you get the <code>access denied</code> error, please run the command using <code>sudo</code></p></div></div><p>The output of this command will only show the default route with the gateway and VM IP of the primary network interface (<code>eth0</code> in the example below).</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">default via &lt;Gateway IP&gt; dev eth0 proto dhcp src &lt;VM IP&gt; metric 100</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Here is the full example:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ ip route show default</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default via 192.168.0.254 dev eth0 proto dhcp src 192.168.0.100 metric 100</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>However, if the issue covered in this KB occurs, you'll only be able to connect to the VM via the VNC or serial console.</p><p>Once connected, you can run again the same command as before:</p><div class="codeBlockContainer_I0IT language-bash theme-code-block"><div class="codeBlockContent_wNvx bash"><pre tabindex="0" class="prism-code language-bash codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">ip</span><span class="token plain"> route show default</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>However, this time you'll get a default route with an incorrect gateway IP.
For example:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">default via &lt;Incorrect Gateway IP&gt; dev eth0 proto dhcp src &lt;VM's IP&gt; metric 100</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="why-do-connectivity-issues-occur-randomly">Why do connectivity issues occur randomly<a class="hash-link" href="#why-do-connectivity-issues-occur-randomly" title="Direct link to heading">​</a></h2><p>In a standard setup, cloud-based VMs typically use DHCP for their NICs configuration. It will set an IP and a gateway for each NIC. Lastly, a default route to the gateway IP will also be added, so you can use its IP to connect to the VM.</p><p>However, Linux distributions start multiple DHCP clients at the same time and do not have a <strong>priority</strong> system. This means that if you have two or more NICs configured with DHCP, the client will enter a <strong>race condition</strong> to configure the default route. And depending on the currently running Linux distribution DHCP script, there is no guarantee which default route will be configured.</p><p>As the default route might change in every DHCP renewing process or after every OS reboot, this will create network connectivity issues.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-avoid-the-random-connectivity-issues">How to avoid the random connectivity issues<a class="hash-link" href="#how-to-avoid-the-random-connectivity-issues" title="Direct link to heading">​</a></h2><p>You can easily avoid these connectivity issues by having only one NIC attached to the VM and having only one IP and one gateway configured.</p><p>However, for VMs in more complex infrastructures, it is often not possible to use just one NIC. For example, if your infrastructure has a storage network and a service network. For security reasons, the storage network will be isolated from the service network and have a separate subnet. In this case, you must have two NICs to connect to both the service and storage networks.</p><p>You can choose a solution below that meets your requirements and security policy.</p><h3 class="anchor anchorWithStickyNavbar_mojV" id="disable-dhcp-on-secondary-nic">Disable DHCP on secondary NIC<a class="hash-link" href="#disable-dhcp-on-secondary-nic" title="Direct link to heading">​</a></h3><p>As mentioned above, the problem is caused by a <code>race condition</code> between two DHCP clients. One solution to avoid this problem is to disable DHCP for all NICs and configure them with static IPs only. Likewise, you can configure the secondary NIC with a static IP and keep the primary NIC enabled with DHCP.</p><ol><li>To configure the primary NIC with a static IP (<code>eth0</code> in this example), you can edit the file <code>/etc/sysconfig/network/ifcfg-eth0</code> with the following values:</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BOOTPROTO='static'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">IPADDR='192.168.0.100'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NETMASK='255.255.255.0'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><p>Alternatively, if you want to reserve the primary NIC using DHCP (<code>eth0</code> in this example), use the following values instead:</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BOOTPROTO='dhcp'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">DHCLIENT_SET_DEFAULT_ROUTE='yes'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>You need to configure the default route by editing the file <code>/etc/sysconfig/network/ifroute-eth0</code> (if you configured the primary NIC using DHCP, skip this step):</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain"># Destination  Dummy/Gateway  Netmask  Interface</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">default        192.168.0.254  -        eth0</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><div class="admonition admonition-warning alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>warning</h5></div><div class="admonition-content"><p>Do not put other default route for your secondary NIC</p></div></div><ol start="3"><li>Finally, configure a static IP for the secondary NIC by editing the file <code>/etc/sysconfig/network/ifcfg-eth1</code>:</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BOOTPROTO='static'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">IPADDR='10.0.0.100'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">NETMASK='255.255.255.0'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="cloud-init-config">Cloud-Init config<a class="hash-link" href="#cloud-init-config" title="Direct link to heading">​</a></h4><div class="codeBlockContainer_I0IT language-yaml theme-code-block"><div class="codeBlockContent_wNvx yaml"><pre tabindex="0" class="prism-code language-yaml codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">network</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> physical</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> eth0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">subnets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> dhcp</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> physical</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> eth1</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">subnets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> static</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">address</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 10.0.0.100/24</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h3 class="anchor anchorWithStickyNavbar_mojV" id="disable-secondary-nic-default-route-from-dhcp">Disable secondary NIC default route from DHCP<a class="hash-link" href="#disable-secondary-nic-default-route-from-dhcp" title="Direct link to heading">​</a></h3><p>If your secondary NIC requires to get its IP from DHCP, you'll need to disable the secondary NIC default route configuration.</p><ol><li>Confirm that the primary NIC configures its default route in the file <code>/etc/sysconfig/network/ifcfg-eth0</code>:</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BOOTPROTO='dhcp'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">DHCLIENT_SET_DEFAULT_ROUTE='yes'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><ol start="2"><li>Disable the secondary NIC default route configuration by editing the file <code>/etc/sysconfig/network/ifcfg-eth1</code>:</li></ol><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">BOOTPROTO='dhcp'</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">DHCLIENT_SET_DEFAULT_ROUTE='no'</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h4 class="anchor anchorWithStickyNavbar_mojV" id="cloud-init-config-1">Cloud-Init config<a class="hash-link" href="#cloud-init-config-1" title="Direct link to heading">​</a></h4><p>This solution is not available in Cloud-Init. Cloud-Init didn't allow any option for DHCP.</p>]]></content:encoded>
            <category>vm</category>
            <category>network</category>
        </item>
        <item>
            <title><![CDATA[VM Scheduling]]></title>
            <link>https://harvesterhci.io/kb/vm-scheduling</link>
            <guid>vm-scheduling</guid>
            <pubDate>Mon, 07 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[How does Harvester schedule VMs?]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithStickyNavbar_mojV" id="how-does-harvester-schedule-a-vm">How does Harvester schedule a VM?<a class="hash-link" href="#how-does-harvester-schedule-a-vm" title="Direct link to heading">​</a></h2><p>Harvester doesn't directly schedule a VM in Kubernetes, it relies on <a href="http://kubevirt.io/" target="_blank" rel="noopener noreferrer">KubeVirt</a> to create the custom resource <code>VirtualMachine</code>. When the request to create a new VM is sent, a <code>VirtualMachineInstance</code> object is created and it creates the corresponding <code>Pod</code>.</p><p>The whole VM creation processt leverages <code>kube-scheduler</code>, which allows Harvester to use <code>nodeSelector</code>, <code>affinity</code>, and resources request/limitation to influence where a VM will be deployed.</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-does-kube-scheduler-decide-where-to-deploy-a-vm">How does kube-scheduler decide where to deploy a VM?<a class="hash-link" href="#how-does-kube-scheduler-decide-where-to-deploy-a-vm" title="Direct link to heading">​</a></h2><p>First, <code>kube-scheduler</code> finds Nodes available to run a pod. After that, <code>kube-scheduler</code> scores each available Node by a list of <a href="https://github.com/kubernetes/kubernetes/tree/v1.22.7/pkg/scheduler/framework/plugins" target="_blank" rel="noopener noreferrer">plugins</a> like <a href="https://github.com/kubernetes/kubernetes/blob/v1.22.7/pkg/scheduler/framework/plugins/imagelocality/image_locality.go" target="_blank" rel="noopener noreferrer">ImageLocality</a>, <a href="https://github.com/kubernetes/kubernetes/tree/v1.22.7/pkg/scheduler/framework/plugins/interpodaffinity" target="_blank" rel="noopener noreferrer">InterPodAffinity</a>, <a href="https://github.com/kubernetes/kubernetes/tree/v1.22.7/pkg/scheduler/framework/plugins/nodeaffinity" target="_blank" rel="noopener noreferrer">NodeAffinity</a>, etc. </p><p>Finally, <code>kube-scheduler</code> calculates the scores from the plugins results for each Node, and select the Node with the highest score to deploy the Pod.</p><p>For example, let's say  we have a three nodes Harvester cluster with 6 cores CPU and 16G RAM each, and we want to deploy a VM with 1 CPU and 1G RAM (without resources overcommit). </p><p><code>kube-scheduler</code> will summarize the scores, as displayed in  <em>Table 1</em> below, and will select the node with the highest score, <code>harvester-node-2</code> in this case, to deploy the VM.</p><details class="details_lb9f alert alert--info details_BAp3" data-collapsed="true"><summary>kube-scheduler logs</summary><div><div class="collapsibleContent_i85q"><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-0: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-1: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 45,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-2: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5350 memory:5941231616] ,score 46,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-0: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 4,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-1: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 34,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm-without-overcommit-75q9b -&gt; harvester-node-2: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5350 memory:5941231616] ,score 37,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="ImageLocality" node="harvester-node-0" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="ImageLocality" node="harvester-node-1" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="ImageLocality" node="harvester-node-2" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="InterPodAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="InterPodAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="InterPodAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesLeastAllocated" node="harvester-node-0" score=4</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesLeastAllocated" node="harvester-node-1" score=34</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesLeastAllocated" node="harvester-node-2" score=37</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodePreferAvoidPods" node="harvester-node-0" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodePreferAvoidPods" node="harvester-node-2" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodePreferAvoidPods" node="harvester-node-1" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="PodTopologySpread" node="harvester-node-0" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="PodTopologySpread" node="harvester-node-1" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="PodTopologySpread" node="harvester-node-2" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="TaintToleration" node="harvester-node-0" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="TaintToleration" node="harvester-node-1" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="TaintToleration" node="harvester-node-2" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesBalancedAllocation" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesBalancedAllocation" node="harvester-node-1" score=45</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" plugin="NodeResourcesBalancedAllocation" node="harvester-node-2" score=46</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" node="harvester-node-0" score=1000358</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" node="harvester-node-1" score=1000433</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm-without-overcommit-75q9b" node="harvester-node-2" score=1000437</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm-without-overcommit-75q9b", node "harvester-node-2"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm-without-overcommit-75q9b", node "harvester-node-2": all PVCs bound and nothing to do</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Attempting to bind pod to node" pod="default/virt-launcher-vm-without-overcommit-75q9b" node="harvester-node-2"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></div></div></details><p><strong>Table 1 - kube-scheduler scores example</strong></p><table><thead><tr><th align="center"></th><th align="center">harvester-node-0</th><th align="center">harvester-node-1</th><th align="center">harvester-node-2</th></tr></thead><tbody><tr><td align="center">ImageLocality</td><td align="center">54</td><td align="center">54</td><td align="center">54</td></tr><tr><td align="center">InterPodAffinity</td><td align="center">0</td><td align="center">0</td><td align="center">0</td></tr><tr><td align="center">NodeResourcesLeastAllocated</td><td align="center">4</td><td align="center">34</td><td align="center">37</td></tr><tr><td align="center">NodeAffinity</td><td align="center">0</td><td align="center">0</td><td align="center">0</td></tr><tr><td align="center">NodePreferAvoidPods</td><td align="center">1000000</td><td align="center">1000000</td><td align="center">1000000</td></tr><tr><td align="center">PodTopologySpread</td><td align="center">200</td><td align="center">200</td><td align="center">200</td></tr><tr><td align="center">TaintToleration</td><td align="center">100</td><td align="center">100</td><td align="center">100</td></tr><tr><td align="center">NodeResourcesBalancedAllocation</td><td align="center">0</td><td align="center">45</td><td align="center">46</td></tr><tr><td align="center">Total</td><td align="center">1000358</td><td align="center">1000433</td><td align="center">1000437</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_mojV" id="why-vms-are-distributed-unevenly-with-overcommit">Why VMs are distributed unevenly with overcommit?<a class="hash-link" href="#why-vms-are-distributed-unevenly-with-overcommit" title="Direct link to heading">​</a></h2><p>With resources overcommit, Harvester modifies the resources request. By default, the <code>overcommit</code> configuration is <code>{"cpu": 1600, "memory": 150, "storage":  200}</code>. This means that if we request a VM with 1 CPU and 1G RAM, its <code>resources.requests.cpu</code> will become <code>62m</code>. </p><p>!!! note
The unit suffix <code>m</code> stands for "thousandth of a core."</p><p>To explain it, let's take the case of CPU overcommit. The default value of 1 CPU is equal to 1000m CPU, and with the default overcommit configuration of <code>"cpu": 1600</code>, the CPU resource will be 16x smaller. Here is the calculation: <code>1000m * 100 / 1600 = 62m</code>.</p><p>Now, we can see how overcommitting influences <code>kube-scheduler</code> scores.</p><p>In this example, we use a three nodes Harvester cluster with 6 cores and 16G RAM each. We will deploy two VMs with 1 CPU and 1G RAM, and we will compare the scores for both cases of "with-overcommit" and "without-overcommit" resources. </p><p>The results of both tables <em>Table 2</em> and <em>Table 3</em> can be explained as follow:</p><p>In the "with-overcommit" case, both VMs are deployed on <code>harvester-node-2</code>, however in the "without-overcommit" case, the VM1 is deployed on <code>harvester-node-2</code>, and VM2 is deployed on <code>harvester-node-1</code>. </p><p>If we look at the detailed scores, we'll see a variation of <code>Total Score</code> for <code>harvester-node-2</code> from <code>1000459</code> to <code>1000461</code> in the "with-overcommit" case, and <code>1000437</code> to <code>1000382</code> in the "without-overcommit case". It's because resources overcommit influences <code>request-cpu</code> and <code>request-memory</code>. </p><p>In the "with-overcommit" case, the <code>request-cpu</code> changes from <code>4412m</code> to <code>4474m</code>. The difference between the two numbers is <code>62m</code>, which is what we calculated above. However, in the "without-overcommit" case, we send <strong>real</strong> requests to <code>kube-scheduler</code>, so the <code>request-cpu</code> changes from <code>5350m</code> to <code>6350m</code>.</p><p>Finally, since most plugins give the same scores for each node except <code>NodeResourcesBalancedAllocation</code> and <code>NodeResourcesLeastAllocated</code>, we'll see a difference of these two scores for each node.</p><p>From the results, we can see the overcommit feature influences the final score of each Node, so VMs are distributed unevenly. Although the <code>harvester-node-2</code> score for VM 2 is higher than VM 1, it's not always increasing. In <em>Table 4</em>, we keep deploying VM with 1 CPU and 1G RAM, and we can see the score of <code>harvester-node-2</code> starts decreasing from 11th VM. The behavior of <code>kube-scheduler</code> depends on your cluster resources and the workload you deployed.</p><details class="details_lb9f alert alert--info details_BAp3" data-collapsed="true"><summary>kube-scheduler logs for vm1-with-overcommit</summary><div><div class="collapsibleContent_i85q"><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-0: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9022 memory:14807289856] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-1: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4622 memory:5992960000] ,score 58,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-2: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4412 memory:5581918208] ,score 59,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-0: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9022 memory:14807289856] ,score 5,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-1: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4622 memory:5992960000] ,score 43,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-ljlmq -&gt; harvester-node-2: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4412 memory:5581918208] ,score 46,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="InterPodAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="InterPodAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="InterPodAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-0" score=5</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-1" score=43</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-2" score=46</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodePreferAvoidPods" node="harvester-node-0" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodePreferAvoidPods" node="harvester-node-1" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodePreferAvoidPods" node="harvester-node-2" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="PodTopologySpread" node="harvester-node-0" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="PodTopologySpread" node="harvester-node-1" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="PodTopologySpread" node="harvester-node-2" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="TaintToleration" node="harvester-node-0" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="TaintToleration" node="harvester-node-1" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="TaintToleration" node="harvester-node-2" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-1" score=58</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-2" score=59</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="ImageLocality" node="harvester-node-0" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="ImageLocality" node="harvester-node-1" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" plugin="ImageLocality" node="harvester-node-2" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" node="harvester-node-0" score=1000359</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" node="harvester-node-1" score=1000455</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" node="harvester-node-2" score=1000459</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm1-with-overcommit-ljlmq", node "harvester-node-2"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm1-with-overcommit-ljlmq", node "harvester-node-2": all PVCs bound and nothing to do</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Attempting to bind pod to node" pod="default/virt-launcher-vm1-with-overcommit-ljlmq" node="harvester-node-2"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></div></div></details><details class="details_lb9f alert alert--info details_BAp3" data-collapsed="true"><summary>kube-scheduler logs for vm2-with-overcommit</summary><div><div class="collapsibleContent_i85q"><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-0: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9022 memory:14807289856] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-1: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4622 memory:5992960000] ,score 58,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-2: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4474 memory:6476701696] ,score 64,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-0: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9022 memory:14807289856] ,score 5,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-1: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4622 memory:5992960000] ,score 43,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-with-overcommit-pwrx4 -&gt; harvester-node-2: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:4474 memory:6476701696] ,score 43,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodePreferAvoidPods" node="harvester-node-0" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodePreferAvoidPods" node="harvester-node-1" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodePreferAvoidPods" node="harvester-node-2" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="PodTopologySpread" node="harvester-node-0" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="PodTopologySpread" node="harvester-node-1" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="PodTopologySpread" node="harvester-node-2" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="TaintToleration" node="harvester-node-0" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="TaintToleration" node="harvester-node-1" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="TaintToleration" node="harvester-node-2" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesBalancedAllocation" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesBalancedAllocation" node="harvester-node-1" score=58</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesBalancedAllocation" node="harvester-node-2" score=64</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="ImageLocality" node="harvester-node-0" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="ImageLocality" node="harvester-node-1" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="ImageLocality" node="harvester-node-2" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="InterPodAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="InterPodAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="InterPodAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesLeastAllocated" node="harvester-node-0" score=5</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesLeastAllocated" node="harvester-node-1" score=43</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" plugin="NodeResourcesLeastAllocated" node="harvester-node-2" score=43</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" node="harvester-node-0" score=1000359</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" node="harvester-node-1" score=1000455</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" node="harvester-node-2" score=1000461</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm2-with-overcommit-pwrx4", node "harvester-node-2"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm2-with-overcommit-pwrx4", node "harvester-node-2": all PVCs bound and nothing to do</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Attempting to bind pod to node" pod="default/virt-launcher-vm2-with-overcommit-pwrx4" node="harvester-node-2"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></div></div></details><details class="details_lb9f alert alert--info details_BAp3" data-collapsed="true"><summary>kube-scheduler logs for vm1-without-overcommit</summary><div><div class="collapsibleContent_i85q"><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-0: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-1: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 45,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-2: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5350 memory:5941231616] ,score 46,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-0: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 4,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-1: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 34,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm1-with-overcommit-6xqmq -&gt; harvester-node-2: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5350 memory:5941231616] ,score 37,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="InterPodAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="InterPodAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="InterPodAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-0" score=4</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-1" score=34</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesLeastAllocated" node="harvester-node-2" score=37</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodePreferAvoidPods" node="harvester-node-0" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodePreferAvoidPods" node="harvester-node-1" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodePreferAvoidPods" node="harvester-node-2" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="PodTopologySpread" node="harvester-node-0" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="PodTopologySpread" node="harvester-node-1" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="PodTopologySpread" node="harvester-node-2" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="TaintToleration" node="harvester-node-0" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="TaintToleration" node="harvester-node-1" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="TaintToleration" node="harvester-node-2" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-1" score=45</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="NodeResourcesBalancedAllocation" node="harvester-node-2" score=46</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="ImageLocality" node="harvester-node-0" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="ImageLocality" node="harvester-node-1" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" plugin="ImageLocality" node="harvester-node-2" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" node="harvester-node-0" score=1000358</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" node="harvester-node-1" score=1000433</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" node="harvester-node-2" score=1000437</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm1-with-overcommit-6xqmq", node "harvester-node-2"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm1-with-overcommit-6xqmq", node "harvester-node-2": all PVCs bound and nothing to do</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Attempting to bind pod to node" pod="default/virt-launcher-vm1-with-overcommit-6xqmq" node="harvester-node-2"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></div></div></details><details class="details_lb9f alert alert--info details_BAp3" data-collapsed="true"><summary>kube-scheduler logs for vm2-without-overcommit</summary><div><div class="collapsibleContent_i85q"><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-0: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-1: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 45,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-2: NodeResourcesBalancedAllocation, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:6350 memory:7195328512] ,score 0,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-0: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:9960 memory:15166603264] ,score 4,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-1: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:5560 memory:6352273408] ,score 34,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">virt-launcher-vm2-without-overcommit-mf5vk -&gt; harvester-node-2: NodeResourcesLeastAllocated, map of allocatable resources map[cpu:6000 memory:16776437760], map of requested resources map[cpu:6350 memory:7195328512] ,score 28,</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="PodTopologySpread" node="harvester-node-0" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="PodTopologySpread" node="harvester-node-1" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="PodTopologySpread" node="harvester-node-2" score=200</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="TaintToleration" node="harvester-node-0" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="TaintToleration" node="harvester-node-1" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="TaintToleration" node="harvester-node-2" score=100</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesBalancedAllocation" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesBalancedAllocation" node="harvester-node-1" score=45</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesBalancedAllocation" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="ImageLocality" node="harvester-node-0" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="ImageLocality" node="harvester-node-1" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="ImageLocality" node="harvester-node-2" score=54</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="InterPodAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="InterPodAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="InterPodAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesLeastAllocated" node="harvester-node-0" score=4</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesLeastAllocated" node="harvester-node-1" score=34</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeResourcesLeastAllocated" node="harvester-node-2" score=28</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeAffinity" node="harvester-node-0" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeAffinity" node="harvester-node-1" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodeAffinity" node="harvester-node-2" score=0</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodePreferAvoidPods" node="harvester-node-0" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodePreferAvoidPods" node="harvester-node-1" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Plugin scored node for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" plugin="NodePreferAvoidPods" node="harvester-node-2" score=1000000</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" node="harvester-node-0" score=1000358</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" node="harvester-node-1" score=1000433</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Calculated node's final score for pod" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" node="harvester-node-2" score=1000382</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm2-without-overcommit-mf5vk", node "harvester-node-1"</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">AssumePodVolumes for pod "default/virt-launcher-vm2-without-overcommit-mf5vk", node "harvester-node-1": all PVCs bound and nothing to do</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">"Attempting to bind pod to node" pod="default/virt-launcher-vm2-without-overcommit-mf5vk" node="harvester-node-1"</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div></div></div></details><p><strong>Table 2 - With Overcommit</strong></p><table><thead><tr><th align="center">VM 1 / VM 2</th><th align="right">harvester-node-0</th><th align="right">harvester-node-1</th><th align="right">harvester-node-2</th></tr></thead><tbody><tr><td align="center">request-cpu (m)</td><td align="right">9022 / 9022</td><td align="right">4622 / 4622</td><td align="right"><strong>4412</strong> / <strong>4474</strong></td></tr><tr><td align="center">request-memory</td><td align="right">14807289856 / 14807289856</td><td align="right">5992960000 / 5992960000</td><td align="right"><strong>5581918208</strong> / <strong>6476701696</strong></td></tr><tr><td align="center">NodeResourcesBalancedAllocation Score</td><td align="right">0 / 0</td><td align="right">58 / 58</td><td align="right"><strong>59</strong> / <strong>64</strong></td></tr><tr><td align="center">NodeResourcesLeastAllocated Score</td><td align="right">5 / 5</td><td align="right">43 / 43</td><td align="right"><strong>46</strong> / <strong>43</strong></td></tr><tr><td align="center">Other Scores</td><td align="right">1000354 / 1000354</td><td align="right">1000354 / 1000354</td><td align="right">1000354 / 1000354</td></tr><tr><td align="center">Total Score</td><td align="right">1000359 / 1000359</td><td align="right">1000455 / 1000455</td><td align="right"><strong>1000459</strong> / <strong>1000461</strong></td></tr></tbody></table><p><strong>Table 3 - Without Overcommit</strong></p><table><thead><tr><th align="center">VM 1 / VM 2</th><th align="right">harvester-node-0</th><th align="right">harvester-node-1</th><th align="right">harvester-node-2</th></tr></thead><tbody><tr><td align="center">request-cpu (m)</td><td align="right">9960 / 9960</td><td align="right">5560 / <strong>5560</strong></td><td align="right"><strong>5350</strong> / 6350</td></tr><tr><td align="center">request-memory</td><td align="right">15166603264 / 15166603264</td><td align="right">6352273408 / <strong>6352273408</strong></td><td align="right"><strong>5941231616</strong> / 7195328512</td></tr><tr><td align="center">NodeResourcesBalancedAllocation Score</td><td align="right">0 / 0</td><td align="right">45 / <strong>45</strong></td><td align="right"><strong>46</strong> / 0</td></tr><tr><td align="center">NodeResourcesLeastAllocated Score</td><td align="right">4 / 4</td><td align="right">34 / <strong>34</strong></td><td align="right"><strong>37</strong> / 28</td></tr><tr><td align="center">Other Scores</td><td align="right">1000354 / 1000354</td><td align="right">1000354 / <strong>1000354</strong></td><td align="right"><strong>1000354</strong> / 1000354</td></tr><tr><td align="center">Total Score</td><td align="right">1000358 / 1000358</td><td align="right">1000358 / <strong>1000433</strong></td><td align="right"><strong>1000437</strong> / 1000382</td></tr></tbody></table><p><strong>Table 4</strong></p><table><thead><tr><th align="center">Score</th><th align="right">harvester-node-0</th><th align="right">harvester-node-1</th><th align="right">harvester-node-2</th></tr></thead><tbody><tr><td align="center">VM 1</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000459</td></tr><tr><td align="center">VM 2</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000461</td></tr><tr><td align="center">VM 3</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000462</td></tr><tr><td align="center">VM 4</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000462</td></tr><tr><td align="center">VM 5</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000463</td></tr><tr><td align="center">VM 6</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000465</td></tr><tr><td align="center">VM 7</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000466</td></tr><tr><td align="center">VM 8</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000467</td></tr><tr><td align="center">VM 9</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000469</td></tr><tr><td align="center">VM 10</td><td align="right">1000359</td><td align="right">1000455</td><td align="right">1000469</td></tr><tr><td align="center">VM 11</td><td align="right">1000359</td><td align="right">1000455</td><td align="right"><strong>1000465</strong></td></tr><tr><td align="center">VM 12</td><td align="right">1000359</td><td align="right">1000455</td><td align="right"><strong>1000457</strong></td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-avoid-uneven-distribution-of-vms">How to avoid uneven distribution of VMs?<a class="hash-link" href="#how-to-avoid-uneven-distribution-of-vms" title="Direct link to heading">​</a></h2><p>There are many plugins in <code>kube-scheduler</code> which we can use to influence the scores. For example, we can add the <code>podAntiAffinity</code> plugin to avoid VMs with the same labels being deployed on the same node.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">  affinity:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    podAntiAffinity:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      preferredDuringSchedulingIgnoredDuringExecution:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      - podAffinityTerm:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          labelSelector:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            matchExpressions:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">            - key: harvesterhci.io/creator</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">              operator: Exists</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">          topologyKey: kubernetes.io/hostname</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        weight: 100</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="how-to-see-scores-in-kube-scheduler">How to see scores in kube-scheduler?<a class="hash-link" href="#how-to-see-scores-in-kube-scheduler" title="Direct link to heading">​</a></h2><p><code>kube-scheduler</code> is deployed as a static pod in Harvester. The file is under <code>/var/lib/rancher/rke2/agent/pod-manifests/kube-scheduler.yaml</code> in each Management Node. We can add <code>- --v=10</code> to the <code>kube-scheduler</code> container to show score logs.</p><div class="codeBlockContainer_I0IT theme-code-block"><div class="codeBlockContent_wNvx"><pre tabindex="0" class="prism-code language-text codeBlock_jd64 thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_mRuA"><span class="token-line" style="color:#393A34"><span class="token plain">kind: Pod</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">metadata:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  labels:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    component: kube-scheduler</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    tier: control-plane</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  name: kube-scheduler</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  namespace: kube-system</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">spec:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  containers:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  - command:</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - kube-scheduler</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    # ...</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    - --v=10</span><br></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_wuS7 clean-btn">Copy</button></div></div>]]></content:encoded>
            <category>vm</category>
            <category>scheduling</category>
        </item>
    </channel>
</rss>