There are a lot of paths you can take, but I would start by looking into cloud-init: https://cloudinit.readthedocs.io/en/latest/
I would also consider some kind of configuration management tool such as Puppet, Chef, Salt, Ansible, and/or Gru cloud-init can be used to bootstrap your VM into being managed by one of the aforementioned tools Casey Boone Systems Engineer Education Networks of America <http://www.ena.com/> 618 Grassmere Park Drive Suite 12 Nashville, TN 37211 Phone: 615-312-6037 CTAC: 888-612-2880 General Office: 615-312-6000 website <http://www.ena.com/> blog <http://www.ena.com/blog> support <http://support.ena.com/> <http://www.facebook.com/ENAConnects> <http://twitter.com/#!/ENAConnects/> <http://www.linkedin.com/company/15330> On 5/31/17, 1:54 PM, "Muhammad Adeel Zahid" <[email protected]> wrote: Hi, I have installed apache cloudstack 4.9 and am using KVM for hpyervisors. I need to have some startup scripts that executes automatically once the VM is up and running. Basically, that script would be responsible for creating db from .sql files in mysql database and also make few changes in a config file to reflect the connection string settings. Currently, I have no idea what to start with? How do I write a script? should it be a bash script or something? How to make it execute on VM creation? I am using CentOS 6.8 on cloudstack and my hypervisors as well. Regards Adeel
