<?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[cloud-init Cloud Config use of {name}]]></title><description><![CDATA[<p dir="auto">I'm starting to work with cloud-init and Cloud Configs.  Setting the hostname is straighforward via:</p>
<p dir="auto"><code>hostname: {name}</code></p>
<p dir="auto">This looks somewhat like a jinja template.  Is the standard...</p>
<p dir="auto"><code>## template: jinja</code></p>
<p dir="auto">...implicit here, or is this a special implementation?  Can <code>{name}</code>, for example, be used elsewhere?  Does it require the jinja format of <code>{{ ref }}</code> or not?  If jinja is needed, I assume both python and jinja need to be installed in when the template is created, correct?  I need to write a simple config file with the hostname in it.</p>
<p dir="auto">What is the recommended approach?  Thanks!</p>
]]></description><link>https://xcp-ng.org/forum/topic/12522/cloud-init-cloud-config-use-of-name</link><generator>RSS for Node</generator><lastBuildDate>Wed, 07 Oct 2026 17:46:11 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/12522.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Oct 2026 16:43:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to cloud-init Cloud Config use of {name} on Wed, 07 Oct 2026 17:01:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/bug-meister" aria-label="Profile: bug-meister">@<bdi>bug-meister</bdi></a> Nope. This is not Jinja nor any other kind of templating engine. This is a simple search-and-replace kind of implementation and is limited to <code>name</code> and <code>%</code>, the later being VM index. From the docs:</p>
<blockquote>
<p dir="auto">Xen Orchestra offers the ability to insert variables such as the virtual machine name {name} or a virtual machine index %. However, the expressive power is limited to the graphical interface. For instance, it is not possible to build a series of virtual machines with complex values or from external data.</p>
</blockquote>
<p dir="auto">Reference:</p>
<ul>
<li><a href="https://docs.xcp-ng.org/guides/create-use-custom-xcpng-ubuntu-templates/" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.xcp-ng.org/guides/create-use-custom-xcpng-ubuntu-templates/</a></li>
</ul>
<p dir="auto">In other words, there is no advanced templating of cloud-init configuration but you could probably template it outside XenOrchestra and apply it via Terraform:</p>
<ul>
<li><a href="https://registry.terraform.io/providers/vatesfr/xenorchestra/latest/docs/resources/vm" target="_blank" rel="noopener noreferrer nofollow ugc">https://registry.terraform.io/providers/vatesfr/xenorchestra/latest/docs/resources/vm</a></li>
</ul>
]]></description><link>https://xcp-ng.org/forum/post/108929</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/108929</guid><dc:creator><![CDATA[bvitnik]]></dc:creator><pubDate>Wed, 07 Oct 2026 17:01:15 GMT</pubDate></item></channel></rss>