Ask Your Question
0

How to install software in openstack vm instance using scripts?

asked 2019-02-15 02:03:26 -0500

bharghvi gravatar image

I have openstack running with VM instances created. Now I wish to install any software eg. Git, sublime inside the instance using scripts (python or bash). How can I do that?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2019-02-15 03:13:45 -0500

That depends on your scripts. You could copy the scripts to the instance, log on to the instance and run the scripts.

Alternatively, you can use cloud-init to install software when the instance starts. To do this, write a cloud-init file and submit it to the instance using the --user-data option of the openstack server create command. See also the cloud-init documentation.

Of course, you can also use tools like Ansible or Puppet, but in my opinion the cloud-init option is the best for your requirement.

edit flag offensive delete link more

Comments

Thanks for your answer. I want to allow user to click on the UI that I provide which contains the names of the software. When the user clicks, the software's installation should begin. Is this scenario possible with cloud Init?

bharghvi gravatar imagebharghvi ( 2019-02-15 03:24:21 -0500 )edit

cloud-init runs when the instance boots for the first time. The user's mouse click could generate a YAML file which describes cloud-init's actions, and which you then use when launching the instance. Would this work for you?

Bernd Bausch gravatar imageBernd Bausch ( 2019-02-15 07:44:49 -0500 )edit

Or if you need to install the software after the instance has booted for the first time, you could do something like

ssh INSTANCE_IP_ADDRESS apt-get install SOFTWARE
Bernd Bausch gravatar imageBernd Bausch ( 2019-02-15 07:45:49 -0500 )edit

@Bernd Bausch can you provide link to some documentation on how to use cloud init and how to use YAML file to descibe cloud init action?

vatsal gravatar imagevatsal ( 2019-02-15 08:49:35 -0500 )edit

I did. See the blue text in my answer.

Bernd Bausch gravatar imageBernd Bausch ( 2019-02-15 15:59:06 -0500 )edit
0

answered 2019-02-15 10:49:03 -0500

novainfinite gravatar image

you can use heat

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-02-15 02:03:26 -0500

Seen: 49 times

Last updated: Feb 15