Ask Your Question
0

How to set environment variable for a VM at the time of launch?

asked 2017-05-15 07:27:06 -0500

Mohan gravatar image

I want to launch a VM with few of the environmetn variables set up at the time of launch. Is there a way to do this? Can I do this with Metadata tab at launch instance pop-up?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-05-17 08:52:56 -0500

RHK gravatar image

You can place user data in a local file and pass it through the --user-data <user-data-file> parameter at instance creation.

$ openstack server create --image ubuntu-cloudimage --flavor 1 --user-data mydata.file VM_INSTANCE

edit flag offensive delete link more
0

answered 2017-05-15 07:36:27 -0500

eblock gravatar image

updated 2017-05-15 07:38:54 -0500

Hi, you have to use cloud-init for that kind of configuration during instance launch. Your base image needs cloud-init to be running, that way you can provide scripts and config options during the first launch of an instance. Read the docs for examples.

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: 2017-05-15 07:27:06 -0500

Seen: 654 times

Last updated: May 17 '17