Skip to content

Commit 6257be1

Browse files
committed
Add cloud-init config for disk resize on cloud environments
Bundles are RHCOS so it have the host root filesystem is mounted at /sysroot, not / on cloud init side this is the mount point we should try to resize. Reference: https://gitlab.com/fedora/bootc/examples/-/tree/main/cloud-init
1 parent 27588c4 commit 6257be1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

createdisk.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ network:
200200
EFF
201201
EOF
202202

203+
# Add file resize cloud-init config
204+
# Taken from https://gitlab.com/fedora/bootc/examples/-/blob/main/cloud-init/10_bootc.cfg
205+
${SSH} core@${VM_IP} 'sudo bash -x -s' << EOF
206+
cat << EFF > /etc/cloud/cloud.cfg.d/10_disk_resize.cfg
207+
growpart:
208+
mode: auto
209+
devices: ["/sysroot"]
210+
211+
resize_rootfs: false
212+
EOF
213+
203214
# Disable cloud-init hostname update
204215
${SSH} core@${VM_IP} -- 'sudo sed -i "s/^preserve_hostname: false$/preserve_hostname: true/" /etc/cloud/cloud.cfg'
205216

0 commit comments

Comments
 (0)