1

We want to use cloud-init to resize the rootfs in our pipeline. The resize itself works fine, but it seems like the default cloud-init config (/etc/cloud.cfg) changes also other settings like SSH for example.

We really dont want that, but there is seemingly no information on how to disable this behaviour?! We tried to remove everything that seems not relevant for us from /etc/cloud.cfg but no change...

Our config file now looks like this:

resize_rootfs_tmp: /dev

cloud_init_modules:
 - disk_setup
 - growpart
 - resizefs

cloud_config_modules:

cloud_final_modules:
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance

Even if we just install cloud-init without enabling the service, we get SSH errors in our pipeline. Any idea on how to disable every cloud-init config except for the things we want (growpart)?!

MSC
  • 11
  • 1
  • How are you providing that config file? If you are providing as user data through your cloud environment, it is a no-op unless it starts with `#cloud-config`. – larsks Aug 29 '22 at 11:30
  • Have you checked `/etc/cloud/cloud.cfg.d` ? That gets sourced for config along with `/etc/cloud/cloud.cfg`. Additional config can also be provided via userdata (if you passed any) and vendordata via the cloud fabric (assuming you're on a public cloud). Can you provide a pastebin of `/var/log/cloud-init.log` along with any other logs of ssh errors you're getting? Does `cloud-init query userdata` or `cloud-init query vendordata` yield anything you didn't expect? – falcojr Aug 29 '22 at 13:58

0 Answers0