hashicorp / packer-plugin-cloudstack

packer plugin for CloudStack Builder
https://www.packer.io/docs/builders/cloudstack
Mozilla Public License 2.0
3 stars 15 forks source link

How to automate the installation from ISO? #56

Open meyayl opened 1 year ago

meyayl commented 1 year ago

I try to perform unattended installations of Ubuntu 20,04.05 using the "ubuntu-20.04.5-live-server-amd64.iso" iso.

Due to the absence of the boot_command, there seem to be no way to influence how the installer is started from the iso. Adding userdata with "#cloud-config/autoinstall" has no effect on the Subiquityinstaller, if there is no possibility to tell Subiquity that it should be used and where it can be accesses from..

Oddly, the boot_command is mentioned in the description of http_directory and http_content, but it doesn't seem it is implemented for the CloudStack provider.

What am I missing here? How do we make the CloudStack provider use userdata for Subiquity, preseed.cfg for Debootstrap or kickstart. ks for Kickstart?

sbrueseke commented 10 months ago

I am asking myself the exact same question. I did not find a way to automate the template creating with ubuntu using this plugin. Maybe with the newly added feature of api driven console access it would be possible for packer to send boot commands to the instance? https://www.shapeblue.com/api-driven-console-access/

MartinEmrich commented 10 months ago

... and I thought I missed something. Is boot_command indeed not implemented?

Is there another way to provide preseed/kickstart/etc. to Linux installer ISOs?

sbrueseke commented 10 months ago

... and I thought I missed something. Is boot_command indeed not implemented?

Is there another way to provide preseed/kickstart/etc. to Linux installer ISOs?

As far as I understand there was no technical way for packer to access vnc console directly before Cloudstack 4.18. You only had access to the VM console via https (webgui) and not via websocket. You can only send commands via websocket. We are looking into this at the moment and I hope we are able to implement this feature to the Cloudstack plugin. A possible way to go is using the new api driven console api call and get a websocket connection running to send boot_commands. If you want to join us be our guest! We do not have a lot knowledge in GO.

MartinEmrich commented 10 months ago

Never mind... I was more thinking of alternative ways (sending boot parameters to the hypervisor, providing userdata via instance metadata (Cloudstack VR), and so on).

Similar to the OP with Ubuntu, the Debian installer can install automatically, but that has to be selected at the boot menu and via a kernel command line parameter.

Tbh, I consider the _bootcommand concept quite fragile (typing keys and waiting fixed amounts of time), it just would have been nice for a quick experiment here.

A more stable option if regular use is planned could be a PXE boot setup, too.