cloudopenstackopenstack-novaopenstack-heat

How to inject file for instace(Linux) , Which is in Running state


In Openstack, I launced image and afetr launching image I want to inject a file for that instace. Is it possible in openstack ? If yes then how ?


Solution

  • Yes it possible using cloud init.

    Cloud init already injects some files for you, for example it manages the ssh config so that you can login with your keypair after boot.

    Look at this example in the section Writing out arbitrary files: https://cloudinit.readthedocs.io/en/latest/topics/examples.html#yaml-examples

    You have to create the yaml file based on this example and add it to user data when launching the instance in openstack.