2013-11-24 01:36:43 +00:00
|
|
|
==============================
|
|
|
|
Getting Started With OpenStack
|
|
|
|
==============================
|
|
|
|
|
|
|
|
OpenStack is one the most popular cloud projects. It's an open source project
|
|
|
|
to build public and/or private clouds. You can use Salt Cloud to launch
|
|
|
|
OpenStack instances.
|
|
|
|
|
2014-09-04 02:10:51 +00:00
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
|
|
|
* Libcloud >= 0.13.2
|
|
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
=============
|
2014-04-24 08:23:22 +00:00
|
|
|
* Using the new format, set up the cloud configuration at
|
|
|
|
``/etc/salt/cloud.providers`` or
|
2013-11-25 13:21:25 +00:00
|
|
|
``/etc/salt/cloud.providers.d/openstack.conf``:
|
2013-11-24 01:36:43 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
my-openstack-config:
|
|
|
|
# Set the location of the salt-master
|
|
|
|
#
|
|
|
|
minion:
|
|
|
|
master: saltmaster.example.com
|
|
|
|
|
2013-11-25 13:13:37 +00:00
|
|
|
# Configure the OpenStack driver
|
2013-11-24 01:36:43 +00:00
|
|
|
#
|
2014-06-03 19:02:09 +00:00
|
|
|
identity_url: http://identity.youopenstack.com/v2.0/tokens
|
2013-11-24 01:36:43 +00:00
|
|
|
compute_name: nova
|
|
|
|
protocol: ipv4
|
|
|
|
|
|
|
|
compute_region: RegionOne
|
|
|
|
|
2013-11-25 13:13:37 +00:00
|
|
|
# Configure Openstack authentication credentials
|
2013-11-24 01:36:43 +00:00
|
|
|
#
|
|
|
|
user: myname
|
|
|
|
password: 123456
|
|
|
|
# tenant is the project name
|
|
|
|
tenant: myproject
|
|
|
|
|
2015-06-17 22:41:03 +00:00
|
|
|
driver: openstack
|
2013-11-24 01:36:43 +00:00
|
|
|
|
2014-04-24 08:23:22 +00:00
|
|
|
# skip SSL certificate validation (default false)
|
|
|
|
insecure: false
|
|
|
|
|
2013-11-24 01:36:43 +00:00
|
|
|
|
|
|
|
Using nova client to get information from OpenStack
|
|
|
|
===================================================
|
|
|
|
|
|
|
|
One of the best ways to get information about OpenStack is using the novaclient
|
|
|
|
python package (available in pypi as python-novaclient). The client
|
|
|
|
configuration is a set of environment variables that you can get from the
|
|
|
|
Dashboard. Log in and then go to Project -> Access & security -> API Access and
|
|
|
|
download the "OpenStack RC file". Then:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
2013-12-01 07:29:16 +00:00
|
|
|
|
2013-11-24 01:36:43 +00:00
|
|
|
source /path/to/your/rcfile
|
|
|
|
nova credentials
|
|
|
|
nova endpoints
|
|
|
|
|
|
|
|
In the ``nova endpoints`` output you can see the information about
|
|
|
|
``compute_region`` and ``compute_name``.
|
|
|
|
|
|
|
|
|
|
|
|
Compute Region
|
|
|
|
==============
|
|
|
|
|
|
|
|
It depends on the OpenStack cluster that you are using. Please, have a look at
|
|
|
|
the previous sections.
|
|
|
|
|
|
|
|
|
|
|
|
Authentication
|
|
|
|
==============
|
|
|
|
|
|
|
|
The ``user`` and ``password`` is the same user as is used to log into the
|
|
|
|
OpenStack Dashboard.
|
|
|
|
|
|
|
|
|
|
|
|
Profiles
|
|
|
|
========
|
|
|
|
|
|
|
|
Here is an example of a profile:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
2013-12-01 07:29:16 +00:00
|
|
|
|
2013-11-24 01:36:43 +00:00
|
|
|
openstack_512:
|
2014-06-06 19:55:51 +00:00
|
|
|
provider: my-openstack-config
|
|
|
|
size: m1.tiny
|
|
|
|
image: cirros-0.3.1-x86_64-uec
|
|
|
|
ssh_key_file: /tmp/test.pem
|
|
|
|
ssh_key_name: test
|
|
|
|
ssh_interface: private_ips
|
2013-11-24 01:36:43 +00:00
|
|
|
|
2014-06-06 01:36:37 +00:00
|
|
|
The following list explains some of the important properties.
|
2013-11-24 01:36:43 +00:00
|
|
|
|
2014-06-06 01:36:37 +00:00
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
size
|
2014-06-06 19:55:51 +00:00
|
|
|
can be one of the options listed in the output of ``nova flavor-list``.
|
2014-06-06 01:36:37 +00:00
|
|
|
|
|
|
|
image
|
2014-06-06 19:55:51 +00:00
|
|
|
can be one of the options listed in the output of ``nova image-list``.
|
2014-06-06 01:36:37 +00:00
|
|
|
|
|
|
|
ssh_key_file
|
2014-06-06 19:55:51 +00:00
|
|
|
The SSH private key that the salt-cloud uses to SSH into the VM after its
|
|
|
|
first booted in order to execute a command or script. This private key's
|
|
|
|
*public key* must be the openstack public key inserted into the
|
2014-12-11 15:51:43 +00:00
|
|
|
authorized_key's file of the VM's root user account.
|
2014-06-06 01:36:37 +00:00
|
|
|
|
|
|
|
ssh_key_name
|
2014-06-06 19:55:51 +00:00
|
|
|
The name of the openstack SSH public key that is inserted into the
|
|
|
|
authorized_keys file of the VM's root user account. Prior to using this
|
|
|
|
public key, you must use openstack commands or the horizon web UI to load
|
|
|
|
that key into the tenant's account. Note that this openstack tenant must be
|
2014-12-11 15:51:43 +00:00
|
|
|
the one you defined in the cloud provider.
|
2014-06-06 01:36:37 +00:00
|
|
|
|
|
|
|
ssh_interface
|
2014-06-06 19:55:51 +00:00
|
|
|
This option allows you to create a VM without a public IP. If this option
|
|
|
|
is omitted and the VM does not have a public IP, then the salt-cloud waits
|
2014-12-11 15:51:43 +00:00
|
|
|
for a certain period of time and then destroys the VM.
|
|
|
|
|
2014-06-09 16:07:17 +00:00
|
|
|
For more information concerning cloud profiles, see :doc:`here
|
|
|
|
</topics/cloud/profiles>`.
|
2013-11-24 01:36:43 +00:00
|
|
|
|
2014-05-14 15:37:58 +00:00
|
|
|
|
|
|
|
change_password
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
If no ssh_key_file is provided, and the server already exists, change_password
|
|
|
|
will use the api to change the root password of the server so that it can be
|
|
|
|
bootstrapped.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
2014-05-14 19:30:28 +00:00
|
|
|
|
2014-05-14 15:37:58 +00:00
|
|
|
change_password: True
|
2014-08-03 18:38:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
userdata_file
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
Use `userdata_file` to specify the userdata file to upload for use with
|
|
|
|
cloud-init if available.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
userdata_file: /etc/salt/cloud-init/packages.yml
|