Saturday, February 20, 2016

OpenStack File Injection

novainjectfile

OpenStack File Injection

工作上突然有一個需求,需要在每個VM啟動時塞入一個Configuration,第一階段有600個VMs,得用script方式才行。

用Inject File方式可完成,如下。
http://docs.openstack.org/openstack-ops/content/instances.html

File injection Arbitrary local files can also be placed into the instance file system at creation time by using the --file option. You may store up to five files. For example, let's say you have a special authorizedkeys file named specialauthorized_keysfile that for some reason you want to put on the instance instead of using the regular SSH key injection. In this case, you can use the following command:

$ nova boot --image ubuntu-cloudimage --flavor 1  \
  --file /root/.ssh/authorized_keys=special_authorized_keysfile authkeyinstance

No comments:

Post a Comment