I’m attempting to understand how datastore init scripts files operate for contextuailization.
My idea is to write a bash script that installs some software on first boot only. I thought adding a shell script to the datastore and selecting it on the template would work.
I’ve read about VM_Hooks. However, from my understanding these are executed on every VM. While I only want to execute it on a specific VM, which is why I am adding it to the VM Template.
I’ve tried uploading a bash script (e.g., program-init.sh) and selecting it to no avail. Same with creating an ISO with the bash script and uploading it to the file datastore.
My question is, where does INIT_SCRIPTS look for an init.sh script? What is it expecting?
Hi, I used it in past. You have to upload you scripts to FILES type datastore and them select that “files” in VM tempalte and and set it as init_script. It will be automatically added to context cdrom and executed.
If you want execute only one, you can add some check to the start of the script.