<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Tag-Based Automation Plugin: Tag-Based VM Performance &amp; Permission Management via assigned tag(s)]]></title><description><![CDATA[<h3>UPDATE: Tag-Based-Automation Plugin</h3>
<p dir="auto"><strong>WHAT</strong>: The xo-tag-automation plugn is a native xo-server plugin that enforces VM performance tiers, manages group permissions, and synchronizes VM metadata -- all driven by VM tags and NFS-hosted CSV files (see below for more details).</p>
<h4>FEATURES</h4>
<p dir="auto"><strong>PERFORMANCE SYNC</strong><br />
Automatically applies CPU weights and IO priorities (sched-pri) based on VM performance tier tags:</p>
<pre><code>0-core   -- CPU weight: 2048  IO priority: 7
1-high   -- CPU weight: 1024  IO priority: 7
2-normal -- CPU weight: 512   IO priority: 5
3-low    -- CPU weight: 256   IO priority: 2
</code></pre>
<p dir="auto">All tier weights and IO priorities are fully configurable in the plugin UI. An optional pool-specific tag suffix (e.g. -1=POOL1, -2=POOL2, etc.) allows you to manage multiple pools from a single XO instance without tag collisions.</p>
<p dir="auto"><strong>PERMISSION SYNC</strong><br />
VM tags ending in -Admin, -Operator, or -Viewer (e.g. "Dept1-Operator",  "Dept2-Admin", etc.) automatically trigger appropriate XO Group creation and ACL assignments for the designated VM.</p>
<p dir="auto"><strong>CSV PERMISSION MANAGEMENT FILES</strong><br />
Two CSV files on your NFS share drive the workflow:</p>
<p dir="auto"><strong>current-vms.csv</strong><br />
A live export of your entire VM inventory. Contains UUID, Name, CurrentTags, NewTags, CurrentNotes, and NewNotes columns.  Edit the NewTags and NewNotes columns and run the plugin (e.g. push the [Test plugin] button) to apply changes in bulk. The CSV auto-refreshes after each run. A staleness warning fires if the CSV has not been updated<br />
within a configurable number of days.</p>
<p dir="auto"><strong>preload-vms.csv</strong><br />
Pre-stage tag and notes configurations for VMs that do not exist yet -- before they are migrated or created. The moment a VM matching a preload entry appears in XO, the plugin applies (on next scheduled interval) its tags and notes automatically and removes the entry from the preload file.</p>
<p dir="auto"><strong>PERMISSION AUTOPILOT</strong><br />
Designed for active migration and onboarding projects. Automatically applies permission settings on scheduled interval, based on preload-vms.csv contents. Note: Should be disabled when not actively involved in migration projects.</p>
<p dir="auto"><strong>DRY-RUN / EXPORT-CSV MODE</strong><br />
When Dry-Run is ON (the default), the plugin previews all changes in the XO logs without applying any changes, and simultaneously exports a fresh copy of all VM metadata to current-vms.csv with blank NewTags and NewNotes columns ready to fill in. Turn Dry-Run OFF to apply changes for real.</p>
<p dir="auto"><strong>RUN NOW</strong> (e.g. The [Test plugin] button)<br />
Trigger a full enforcement cycle instantly from the XO plugin UI without waiting for the next scheduled run.</p>
<p dir="auto"><strong>NFS LOGGING</strong><br />
All activity is written to structured log files on your NFS share:</p>
<pre><code>xo-tag-automation.log         -- full run log (auto-rotates at 2MB)
xo-tag-automation.log.1      -- previous log backup
xo-tag-automation-summary.log -- run summary entries only
daily-summary.log             -- nightly VM count and new VM report
</code></pre>
<p dir="auto">Logs are also available via xo-cli API methods (see below).</p>
<p dir="auto"><strong>LEGACY MIGRATION</strong><br />
If you have an existing vm_metadata.csv from an older version, the plugin automatically renames it to current-vms.csv on first run. No manual migration needed.</p>
<h4>SECURITY -- PLEASE READ CAREFULLY</h4>
<p dir="auto">This plugin automates infrastructure changes. Security is not optional. Please take both of the following seriously before enabling Permission Sync or Autopilot.</p>
<p dir="auto"><strong>-- REST API SERVICE ACCOUNT --</strong></p>
<p dir="auto">The plugin uses the XO JSON-RPC API internally. Use a dedicated service account -- never your personal admin credentials.</p>
<p dir="auto">Recommended setup (generic -- adapt to your environment):</p>
<ol>
<li>
<p dir="auto">Create a dedicated XO user account for the service (e.g. a non-admin account with only the minimal access permissions required)</p>
</li>
<li>
<p dir="auto">Generate a scoped API token via xo-cli:<br />
xo-cli --register<br />
xo-cli token.create</p>
</li>
<li>
<p dir="auto">Store the token securely -- treat it like a password!</p>
</li>
<li>
<p dir="auto">Refer to the official Vates REST API documentation for full token management guidance:<br />
<a href="https://xen-orchestra.com/docs/restapi.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/docs/restapi.html</a></p>
</li>
</ol>
<p dir="auto"><strong>-- NFS SHARE SECURITY --</strong></p>
<p dir="auto">The NFS share hosts your CSV files and logs. Anyone with write access to the share can modify VM tags and permissions.</p>
<p dir="auto"><strong>STRONGLY RECOMMENDED</strong></p>
<ul>
<li>
<p dir="auto">Run the NFS share from a dedicated VM -- not a general-purpose NFS server.</p>
</li>
<li>
<p dir="auto">Restrict NFS exports to the XOA IP address only:<br />
/srv/nfs/share&lt;XOAIP&gt;/32(rw,sync,no_subtree_check,no_root_squash)</p>
</li>
<li>
<p dir="auto">Do NOT expose the NFS share to the general network or to end-user access.</p>
</li>
<li>
<p dir="auto">Admins who need to edit CSV files can SCP them to/from the XOA:<br />
EXAMPLE:<br />
Download CSV from XOA to your workstation<br />
scp &lt;xoa-user&gt;@&lt;xoa-ip&gt;:/path/to/current-vms.csv ./</p>
<p dir="auto">Upload edited CSV back to XOA<br />
scp ./current-vms.csv &lt;xoa-user&gt;@&lt;xoa-ip&gt;:/path/to/current-vms.csv</p>
</li>
<li>
<p dir="auto">Use firewall rules to enforce NFS access at the network level in addition to the exports configuration</p>
</li>
</ul>
<p dir="auto">Failure to secure the NFS share is a serious security risk.</p>
<h4>UPGRADING FROM THE STANDALONE SCRIPT</h4>
<p dir="auto">If you installed the old standalone  <a href="https://xcp-ng.org/forum/topic/12215/tag-based-automation-manage-vm-cpu-priority-via-assigned-tag.">set-performance.sh</a> script, you can remove it before enabling the plugin as follows:</p>
<ol>
<li>
<p dir="auto">Remove the script:</p>
<pre><code class="language-bash">sudo rm /usr/local/bin/set-performance.sh
</code></pre>
</li>
<li>
<p dir="auto">Remove the crontab entry:</p>
<pre><code>  crontab -e
  (delete the line referencing set-performance.sh)
</code></pre>
</li>
<li>
<p dir="auto">Note: The plugin handles its own scheduling via the XO UI. No manual cron configuration is required.</p>
</li>
</ol>
<h4>INSTALLATION</h4>
<ol>
<li>
<p dir="auto">Download the latest airgap release tarball from GitHub:<br />
<a href="https://github.com/johnezero/xo-tag-automation_plugin/releases" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/johnezero/xo-tag-automation_plugin/releases</a></p>
</li>
<li>
<p dir="auto">SCP the tarball to your XOA:</p>
<pre><code class="language-bash">scp xo-tag-automation-airgap-vX.X.X.tar.gz &lt;xoa-user&gt;@&lt;xoa-ip&gt;:/tmp/
</code></pre>
</li>
<li>
<p dir="auto">Create the plugin folder:</p>
<pre><code class="language-bash">sudo mkdir -p /usr/local/lib/node_modules/xo-server-tag-automation
</code></pre>
</li>
<li>
<p dir="auto">Extract directly into the plugin directory:</p>
<pre><code class="language-bash">sudo tar -xzvf /tmp/xo-tag-automation-airgap-vX.X.X.tar.gz -C /usr/local/lib/node_modules/xo-server-tag-automation/ --strip-components=1
</code></pre>
</li>
<li>
<p dir="auto">Restart xo-server:</p>
<pre><code class="language-bash">sudo systemctl restart xo-server
</code></pre>
</li>
<li>
<p dir="auto">Verify registration:</p>
<pre><code class="language-bash">sudo journalctl -u xo-server -n 100 --no-pager | grep -A3 "tag-automation"
</code></pre>
<p dir="auto">You should see:</p>
<pre><code>[INFO] xo-tag-automation: Plugin factory called -- xo context: YES
[INFO] xo-tag-automation: Plugin loaded -- waiting for core started.
xo:plugin INFO successfully register tag-automation
</code></pre>
</li>
<li>
<p dir="auto">Enable and configure the plugin options in XO:<br />
Settings -&gt; Plugins -&gt; tag-automation -&gt; Enable</p>
</li>
</ol>
<h4>XO-CLI API METHODS</h4>
<p dir="auto">The plugin exposes several API methods accessible via xo-cli:</p>
<p dir="auto">xo-cli xo-server-tag-automation.exportCsv<br />
Export current VM inventory to current-vms.csv</p>
<p dir="auto">xo-cli xo-server-tag-automation.downloadCsvApi<br />
Print CSV content to stdout</p>
<p dir="auto">xo-cli xo-server-tag-automation.uploadCsvApi content@./current-vms.csv<br />
Push an edited CSV back to the NFS share</p>
<p dir="auto">xo-cli xo-server-tag-automation.getLog lines=100<br />
View the last N lines of the plugin log</p>
<p dir="auto">xo-cli xo-server-tag-automation.getDailySummary<br />
View the nightly VM count summary</p>
<p dir="auto">xo-cli xo-server-tag-automation.getFilePaths<br />
Show all configured file paths</p>
<h4>LINKS</h4>
<p dir="auto">GitHub:   <a href="https://github.com/johnezero/xo-tag-automation_plugin" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/johnezero/xo-tag-automation_plugin</a><br />
Vates REST API docs: <a href="https://xen-orchestra.com/docs/restapi.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/docs/restapi.html</a></p>
<p dir="auto"><strong>STANDARD DISCLAIMER HERE</strong></p>
<p dir="auto">This software is provided "AS-IS" without any express or implied warranty.  While this plugin is being used in a production environment managing live VMs, you should always review the code and test it in a non-production environment before full deployment.<br />
Note: The plugin is designed to ONLY take action on VMs with specific tags assigned (e.g. untagged VMs are never modified).<br />
Use Dry-Run mode to preview all changes (via log file output) before applying them.</p>
<p dir="auto">That said, as always - your mileage may vary...</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1780884996846-johnezero-logo.jpg" alt="johnezero-logo.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://xcp-ng.org/forum/topic/12265/tag-based-automation-plugin-tag-based-vm-performance-permission-management-via-assigned-tag-s</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 05:11:13 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/12265.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Jun 2026 02:29:36 GMT</pubDate><ttl>60</ttl></channel></rss>