<?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[Documenting Templates Better]]></title><description><![CDATA[<p dir="auto">I'm willing to contribute some documentation on templates, because I keep looking up how to work with them. Every so often another person posts some basic questions about them, and there isn't one central place to send them.</p>
<p dir="auto">What I wanted to do was collect the basics of what I know here in this thread, and give people an opportunity to add other things they think should be in a documentation page on templates, and then I'll go write the page and contribute it to <a href="https://github.com/vatesfr/xen-orchestra/tree/master/docs" target="_blank" rel="noopener noreferrer nofollow ugc">the docs</a>.</p>
<p dir="auto">My thinking is to organize it around "<strong>CRUD</strong>": Create, Read, Update, Delete.</p>
<h1>Create</h1>
<p dir="auto">There's basically 3 ways to create templates.</p>
<ol>
<li>From an existing VM. For example, you can install Linux or FreeBSD or whatever on your VM at some basic level with a few customizations, and then make a template from that.</li>
<li>Duplicate one of the default templates and then modify it (subject to the limitations in "Update" below)</li>
<li>Create a VM, then convert it to a template. The only difference between this and #1 above is that if you never boot it or install any OS, you create a template that has an unformatted disk. This just gives you customized RAM, CPU and other values. See the section on "Delete" where I talk about diskless templates. Am I understanding it right?</li>
</ol>
<p dir="auto">Any other useful ways to create that I haven't mentioned?</p>
<h1>Read</h1>
<p dir="auto">How can I see the properties of a template in Xen Orchestra? If I click the hamburger menu, all I can see are tags, CPU and RAM. If I want to see other values, it seems like I have to start to create a VM, choose the template, and then click on the "Advanced Settings" to see what the template sets them to.</p>
<p dir="auto">Pull from the API? <a href="https://xcp-ng.org/forum/topic/8519/fetching-a-list-of-available-templates">This forum post mentions that</a>. Is that <a href="https://docs.xen-orchestra.com/architecture#list-available-objects" target="_blank" rel="noopener noreferrer nofollow ugc">this documentation on the <code>xo</code> command</a> or something else? What should I link to for more information on invoking the API?</p>
<p dir="auto">From the CLI you can get all the information from a template. If I've created a template called <em>My Debian Template</em>, this is how to see its values.</p>
<pre><code>xe template-list name-label="My Debian Template"
uuid=$(xe template-list name-label="My Debian Template" --minimal)
xe template-param-list uuid=$uuid | less
</code></pre>
<h1>Update</h1>
<p dir="auto">I can't find a way in Xen Orchestra to modify the parameters of a template. There's a <a href="https://xcp-ng.org/forum/topic/9904/vm-templates-override?">thread here</a> that talks about finding it, clicking the hamburger menu, then editing the values. When I do that, I see a little green check mark next to the value I changed, but the values don't actually change. Is this meant to work? And those are really basic settings. What about changing advanced settings in Xen Orchestra?</p>
<p dir="auto">I guess there's a cumbersome way to modify a template in XO: I could create a VM from my template, modifying the values to what I want them to be, and then convert that VM to a new template. Then I delete the old template? Does that work?</p>
<p dir="auto">The only way I have found to update a template is to set values from the command line <a href="https://xcp-ng.org/forum/topic/813/problem-creating-templates-with-preseed">following this post</a>. For example (assuming <code>$uuid</code> is set from my prior example) this will set <code>memory-static-min</code> to 512Mb.</p>
<pre><code>xe template-param-set memory-static-min=$((1024 * 1024 * 512)) uuid=$uuid
</code></pre>
<p dir="auto">Any other ways to update the properties of an existing template?</p>
<h1>Delete</h1>
<p dir="auto">It seems simple enough to find a template in Xen Orchestra, select the box next to it, and click the trash can.  <a href="https://xcp-ng.org/forum/topic/9037/template-delete-expected-behavior/">According to this post</a>, that will leave orphan VDIs that have to be deleted manually. But this is not true of the default templates, right? So:</p>
<ol>
<li>Deleting a default template: you just find it in the GUI and delete it.</li>
<li>Deleting a custom template you created: you need to do the steps in that post: find the drives, delete them, then delete the template?</li>
</ol>
<p dir="auto">This also leads me to ask whether it's possible to create a template like the default templates, where there's no associated disk? I guess you just create a VM without a disk and turn that into a template?</p>
<p dir="auto">Also, you can delete the default templates, but they get re-installed again during a major version upgrade, right? So you either live with them, or you have to delete them again after every major upgrade?</p>
<h1>Cloud-init and Cloudbase-Init</h1>
<p dir="auto">There's some useful docs on <a href="https://docs.xen-orchestra.com/advanced#example-how-to-create-a-cloud-init-template-with-ubuntu-2204-lts" target="_blank" rel="noopener noreferrer nofollow ugc">cloud-init and cloudbase-init</a> that could move to this page if we have a whole page devoted to working with templates.</p>
<p dir="auto">Thoughts?</p>
<h1>What Am I Missing?</h1>
<p dir="auto">This is as much as I know right now. Anything else we should add to docs on templates?</p>
]]></description><link>https://xcp-ng.org/forum/topic/10422/documenting-templates-better</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 04:43:44 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/10422.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Feb 2025 02:33:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Documenting Templates Better on Fri, 07 Feb 2025 10:31:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/olivierlambert" aria-label="Profile: olivierlambert">@<bdi>olivierlambert</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/paco" aria-label="Profile: paco">@<bdi>paco</bdi></a> Thanks! Will work on it</p>
]]></description><link>https://xcp-ng.org/forum/post/89369</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/89369</guid><dc:creator><![CDATA[thomas-dkmt]]></dc:creator><pubDate>Fri, 07 Feb 2025 10:31:55 GMT</pubDate></item><item><title><![CDATA[Reply to Documenting Templates Better on Fri, 07 Feb 2025 10:24:14 GMT]]></title><description><![CDATA[<p dir="auto">Ping <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/thomas-dkmt" aria-label="Profile: thomas-dkmt">@<bdi>thomas-dkmt</bdi></a></p>
]]></description><link>https://xcp-ng.org/forum/post/89366</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/89366</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Fri, 07 Feb 2025 10:24:14 GMT</pubDate></item></channel></rss>