<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Script to add all virtual machines to Proxmox High Availability - Proxmox help				            </title>
            <link>https://www.virtualizationhowto.com/community/proxmox-help/script-to-add-all-virtual-machines-to-proxmox-high-availability/</link>
            <description>Virtualization Howto Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 14 Jul 2026 04:11:52 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Script to add all virtual machines to Proxmox High Availability</title>
                        <link>https://www.virtualizationhowto.com/community/proxmox-help/script-to-add-all-virtual-machines-to-proxmox-high-availability/#post-1531</link>
                        <pubDate>Sun, 25 Jan 2026 14:08:52 +0000</pubDate>
                        <description><![CDATA[Hi all, just a quick note I wanted to toss out here. If you are looking for a script to add all of your Proxmox virtual machines to HA without having to click through the GUI to add each one...]]></description>
                        <content:encoded><![CDATA[<p>Hi all, just a quick note I wanted to toss out here. If you are looking for a script to add all of your Proxmox virtual machines to HA without having to click through the GUI to add each one individually. In the script below, you will see that I have my storage defined (we are adding all VMs on shared storage), and I am excluding VMs that match my Veeam worker nodes (vm-worker*).</p>
<p>First confirm your storage ID:</p>
<pre contenteditable="false">grep -Rho --include="*.conf" -E '^(scsi|virtio|sata|ide)+:\s*+:' /etc/pve/nodes/*/qemu-server/*.conf \
| sed -E 's/^(scsi|virtio|sata|ide)+:\s*(+):.*/\2/' \
| sort -u
</pre>
923
<p>In this output, my storage id was "rbd-vm:</p>
<pre contenteditable="false">STORAGE_ID="rbd-vm"

# Get list of HA-managed VMIDs
HA_VMS=$(ha-manager config | awk '/^vm:/{print $1}' | sed 's/vm://')

for cfg in /etc/pve/nodes/*/qemu-server/*.conf; do
  id=$(basename "$cfg" .conf)

  # Skip if already HA-managed
  if echo "$HA_VMS" | grep -qx "$id"; then
    continue
  fi

  # Skip templates
  if grep -q '^template: 1' "$cfg"; then
    continue
  fi

  # Skip vbr-worker VMs
  name=$(awk '/^name:/{print $2}' "$cfg")
  if []; then
    continue
  fi

  # Only include Ceph RBD-backed VMs
  if grep -q "${STORAGE_ID}:" "$cfg"; then
    ha-manager add "vm:$id" --state started
    echo "Added vm:$id ($name) to HA"
  fi
done</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
						                            <category domain="https://www.virtualizationhowto.com/community/proxmox-help/">Proxmox help</category>                        <dc:creator>Brandon Lee</dc:creator>
                        <guid isPermaLink="true">https://www.virtualizationhowto.com/community/proxmox-help/script-to-add-all-virtual-machines-to-proxmox-high-availability/#post-1531</guid>
                    </item>
							        </channel>
        </rss>
		