<?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[Best way for automatic creation of Linux FDE VMs with secure boot and VTPM using IaC]]></title><description><![CDATA[<p dir="auto">Hi there,<br />
I have researched the forum but i can not find a reply to my issues so far. At work i need to automatically and quickly create new VMs either via ansible or Terraform/Opentofu.<br />
Rerquirements:</p>
<ol>
<li>Full disk encryption.</li>
<li>Clevis /tang for additional security.</li>
<li>SecureBoot support.</li>
</ol>
<p dir="auto">Problems are the following.</p>
<ol>
<li>Found I can enable secure boot in ansible with<br />
custom_params:
<ul>
<li>key: 'platform'<br />
value:<br />
secureboot: 'true'<br />
Is there a similar parametr to enable VTPM in ansible using   community.general.xenserver_guest?<br />
Or I can only enable it via xe-cli: xe vtpm-create vm-uuid=&lt;uuid&gt;?</li>
</ul>
</li>
<li>Is there a command for terraform/Opentofu provider to enable secure boot/vtpm? I can not find it.</li>
<li>It does not belong to xcp, but maybe someone knows. It is preferable to have both boot and root partitions encrypted and at the same time allow automatic creation and start of VMs via IaC tools. If grub2 with encrypted boot partition (linux ubuntu) is used, it requires manual password input for cryptomount module. After it initramfs can load clevis module and root partition is decrypted via tang server. Is there some way to allow autodecrypt of the boot partition via VTPM on this pre-load stage?<br />
I thought about using unified kernel image, but I do not like the idea it is stored in not encrypted efi partition. Also default cloud-config is forced to install grub as bootloader and fails if it cant. I am looking for a solution to create many vms with either encrypted boot and root partitions or with UKI and encrypted root partition without boot partition at all. This all in completely automated way.  I already have a similar working setup, but with unencrypted boot partiotion. Any advice is highly appreciated. Thank you!</li>
</ol>
]]></description><link>https://xcp-ng.org/forum/topic/9974/best-way-for-automatic-creation-of-linux-fde-vms-with-secure-boot-and-vtpm-using-iac</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 20:29:22 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/9974.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Nov 2024 12:20:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Best way for automatic creation of Linux FDE VMs with secure boot and VTPM using IaC on Sat, 16 Nov 2024 22:55:53 GMT]]></title><description><![CDATA[<p dir="auto">I wasn't aware of this plugin even existing (thanks for the discovery). I'm not sure it's really maintained, but we have a clear goal of getting one officially maintained anyway.</p>
]]></description><link>https://xcp-ng.org/forum/post/85898</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/85898</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Sat, 16 Nov 2024 22:55:53 GMT</pubDate></item><item><title><![CDATA[Reply to Best way for automatic creation of Linux FDE VMs with secure boot and VTPM using IaC on Fri, 15 Nov 2024 19:26:11 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> thank you for reply.<br />
<a href="https://docs.ansible.com/ansible/latest/collections/community/general/xenserver_guest_module.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.ansible.com/ansible/latest/collections/community/general/xenserver_guest_module.html</a><br />
I meant this module. It allows to create vms, but with limited capabilities.</p>
]]></description><link>https://xcp-ng.org/forum/post/85870</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/85870</guid><dc:creator><![CDATA[mrssw]]></dc:creator><pubDate>Fri, 15 Nov 2024 19:26:11 GMT</pubDate></item><item><title><![CDATA[Reply to Best way for automatic creation of Linux FDE VMs with secure boot and VTPM using IaC on Fri, 15 Nov 2024 18:10:49 GMT]]></title><description><![CDATA[<p dir="auto">I think what you seek is Packer, because I'm not aware of our Ansible plugin able to create VMs, it's a inventory plugin.</p>
]]></description><link>https://xcp-ng.org/forum/post/85862</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/85862</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Fri, 15 Nov 2024 18:10:49 GMT</pubDate></item><item><title><![CDATA[Reply to Best way for automatic creation of Linux FDE VMs with secure boot and VTPM using IaC on Fri, 15 Nov 2024 12:37:43 GMT]]></title><description><![CDATA[<p dir="auto">And one more thing, now If I use ansible, I have to create a raw disk with cloud-init config (iso cd-rom is occupied by Linux installation image). If i just indicate disk as a part of a new VM during its creation it will not see its contents.</p>
<ul>
<li>name: Creating VMs<br />
community.general.xenserver_guest:<br />
hostname: '{{ xenserver_host }}'<br />
username: '{{ xenserver_user }}'<br />
password: '{{ xenserver_pass }}'<br />
validate_certs: true<br />
name: '{{ item.value.vm_name }}'<br />
...<br />
disks:<br />
- name: '{{ item.value.hd_name }}'<br />
size_gb: '{{ item.value.hd_size_gb }}'<br />
sr: '{{ item.value.sr_name }}'<br />
At this stage if i add 2nd disk with cloud-init config, VM does not see its content and autoinstall does not start. I have to create vbd after a new VM is created:<br />
xe vbd-create vm-uuid={{ item.1 }} vdi-uuid={{ item.0 }} device=1 bootable=false mode=RW type=Disk<br />
Something like this. Only after it I can start VM. Only after it it sees cloud-init config. In this scenario I can not use wait_for_ip_address function, which i do really need to automatically trigger another playbook with guest OS setup.<br />
Is there some way to attach cloud-init image or supply cloud-init config same way as it is done in terraform right at the VM creation stage?</li>
</ul>
]]></description><link>https://xcp-ng.org/forum/post/85836</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/85836</guid><dc:creator><![CDATA[mrssw]]></dc:creator><pubDate>Fri, 15 Nov 2024 12:37:43 GMT</pubDate></item></channel></rss>