We have a cloud-config made for virtual servers and we want to remove the virtualization layer and have the same setup on bare metal server. Is it possible to manually run that cloud-init user data script on the bare metal servers, after the server setup ? (OS install - Centos 7)
I have read about nocloud datasource for cloud-init and configuring os setup to fetch cloud-init data from an usb drive but for me it's not possible, I must find a solution to run run my user data via cloud-init manually after OS was installed
The NoCloud datasource is still the easiest way to accomplish this. As part of install (or directly after install), you could create a filesystem (or VFS) with the files needed for NoCloud. If that's too cumbersome, you can also create a file at
/etc/cloud/cloud.cfg.d/99-mydata.cfg
with something like:using your cloud-config rather than what I have there. See the docs example.
To have cloud-init run, it's easiest to reboot and let cloud-init run on next boot. Cloud-init isn't really intended to be run manually, but it can be done with something like: