<?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[Ubuntu 22.04 Cloud-init disk size issue]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have suddenly come across a issue that I am guessing has appeared with a recent change in Ubuntu that is now preventing growpart in the cloud-init to resize the disk when spun up from template.</p>
<p dir="auto">I do recall a post on here that i have saved within my notes as a reminder that something will go wrong at some point. They has provided detailed instructions to get cloud-init working with Ubuntu and finished the post with the following:</p>
<p dir="auto"><em>"This post will no longer lead to a working cloud-init deployment within 3-6 months based on my previous experience"<br />
"You have to examine the default file you get line by line and work towards the values above until the template works properly."<br />
(<a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fohdeesha" aria-label="Profile: FOHDEESHA">@<bdi>FOHDEESHA</bdi></a>, Vates - Pro Support Team)</em></p>
<p dir="auto">I completed the following steps before converting to temaplate:</p>
<p dir="auto">Install packages: cloud-init cloud-utils cloud-initramfs-growroot<br />
Remove all or comment out from /etc/resolv.conf<br />
Remove all but localhost from /etc/hosts</p>
<p dir="auto">Remove any datasource_list or datasource blocks, and replace them with these values in /etc/cloud/cloud.cfg</p>
<pre><code>#XOA Cloud-init Data Source
datasource_list: [ NoCloud, ConfigDrive ]
datasource:
    ConfigDrive:
        dsmode: local
    NoCloud:
        fs_label: cidata
</code></pre>
<p dir="auto">Add network handling in /etc/cloud/cloud.cfg</p>
<pre><code>#XOA Network Handling
manage_resolv_conf: true
manage_etc_hosts: true
preserve_hostname: false
</code></pre>
<p dir="auto">Remove any of the old configs left by the Ubuntu install.</p>
<pre><code>sudo rm -rf /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/90_dpkg.cfg /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
</code></pre>
<p dir="auto">Clean up logs, history and remove any ssh keys.</p>
<pre><code>sudo rm -rf /etc/ssh/ssh_host_*
sudo cloud-init clean --logs
sudo cat /dev/null &gt; ~/.bash_history &amp;&amp; history -c
</code></pre>
<p dir="auto">Convert to template.</p>
<p dir="auto">Cloud Config file is very basic, to try reduce the amount that could be going wrong to locate the isssue.</p>
<pre><code>#cloud-config
hostname: {name}
fqdn: {name}.example.com 

growpart:
  mode: auto
  devices: ['/']
  ignore_growroot_disabled: false

packages:
  - nano
  - wget
  - unzip
  - tmux
  - cron

package_update: true
package_upgrade: true

final_message: "Setup complete in $UPTIME seconds, please allow two minuets for DNS records to update!"
</code></pre>
<p dir="auto">My template is build on a 16GB disk, as the point of VM creation I set the disk to 128GB.<br />
running <em>lsblk</em> shows the 128GB is there.</p>
<pre><code>NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0                        11:0    1 1024M  0 rom
xvda                      202:0    0  128G  0 disk
├─xvda1                   202:1    0    1M  0 part
├─xvda2                   202:2    0  1.8G  0 part /boot
└─xvda3                   202:3    0 14.2G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 14.2G  0 lvm  /
</code></pre>
<p dir="auto">as you can see my / mount is still at the 14GB. Running <em>vgdisplay</em> and <em>df -h</em> both do not show the 128GB disk and has also preventing me from resizing.</p>
<pre><code> --- Volume group ---
  VG Name               ubuntu-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               &lt;14.25 GiB
  PE Size               4.00 MiB
  Total PE              3647
  Alloc PE / Size       3647 / &lt;14.25 GiB
  Free  PE / Size       0 / 0
  VG UUID               NZTIlD-5YHf-eUf1-xCzL-RMX7-BI72-HG200D
</code></pre>
<pre><code>Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              389M  744K  388M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   14G  4.5G  8.9G  34% /
tmpfs                              1.9G     0  1.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              1.9G     0  1.9G   0% /run/qemu
/dev/xvda2                         1.7G  252M  1.4G  16% /boot
tmpfs                              389M  4.0K  389M   1% /run/user/1000
</code></pre>
<p dir="auto">Has anyone come across this issue, i feel this is something new that has caused this with a update in Ubuntu as this has been working.</p>
]]></description><link>https://xcp-ng.org/forum/topic/8512/ubuntu-22-04-cloud-init-disk-size-issue</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 11:39:45 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/8512.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 Mar 2024 12:02:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ubuntu 22.04 Cloud-init disk size issue on Wed, 13 Mar 2024 08:20:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/jubin3" aria-label="Profile: jubin3">@<bdi>jubin3</bdi></a> As this is totally unrelated to XOA and XCP-ng, you'll (hopefully) get a better response in the cloud-init community, as it's their project which has (once again) been broken by an OS update. I gave up chasing them some time ago, especially with brand new OS releases.</p>
]]></description><link>https://xcp-ng.org/forum/post/73364</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/73364</guid><dc:creator><![CDATA[fohdeesha]]></dc:creator><pubDate>Wed, 13 Mar 2024 08:20:07 GMT</pubDate></item></channel></rss>