Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 1 | ================== |
| 2 | OpenStack Provider |
| 3 | ================== |
| 4 | |
| 5 | It's possible to use Vagrant to provision VMs on OpenStack using the |
| 6 | `Vagrant OpenStack Cloud Provider <https://github.com/ggiamarchi/vagrant-openstack-provider/>`. |
| 7 | The only requirement for the Cloud provider is to have an Ubuntu Cloud |
| 8 | image accesible to your tenant and a Security Rule that allows to do |
| 9 | SSH into the instance. |
| 10 | |
| 11 | Environment variables |
| 12 | --------------------- |
| 13 | |
| 14 | The usage of environment variables in OpenStack command-line clients |
| 15 | is to avoid repeating some values. These variables have *OS_* as |
| 16 | prefix. This provider will use them for authentication to Keystone |
| 17 | service. |
| 18 | |
| 19 | .. code-block:: console |
| 20 | |
| 21 | export OS_AUTH_URL=http://<keystone_ip>:5000/v3 |
| 22 | export OS_TENANT_NAME=<project_or_tenant_name> |
| 23 | export OS_PROJECT_NAME=<project_or_tenant_name> |
| 24 | export OS_USERNAME=<openstack_username> |
| 25 | export OS_PASSWORD=<openstack_password> |
| 26 | export OS_REGION_NAME=<openstack_region_name> |
| 27 | export OS_IDENTITY_API_VERSION=<keystone_version_number> |
| 28 | export OS_PROJECT_DOMAIN_ID=<openstack_domain_name> |
| 29 | |
| 30 | .. end |
| 31 | |
| 32 | OpenStack Vagrant provider needs additional information about the |
| 33 | name of the image to be used and the networking where the instance |
| 34 | will be provisioned. That information can be passed using the |
| 35 | following variables |
| 36 | |
| 37 | .. code-block:: console |
| 38 | |
| 39 | export OS_IMAGE=<ubuntu_cloud_image_name> |
| 40 | export OS_NETWORK=<neutron_private_network> |
| 41 | export OS_FLOATING_IP_POOL=<neutron_floating_ip_pool> |
| 42 | export OS_SEC_GROUP=<onap-ssh-secgroup> |
| 43 | |
| 44 | .. end |
| 45 | |
| 46 | Tenant setup |
| 47 | ------------ |
| 48 | |
| 49 | The *tools/setup_openstack.sh* script can be useful to get an idea |
| 50 | of the process to setup the OpenStack environment with the necessary |
| 51 | requirements. This script depends on the Environment Variables |
| 52 | explained previously. |
| 53 | |
| 54 | ---- |
| 55 | |
| 56 | Devstack |
| 57 | -------- |
| 58 | |
| 59 | It's possible to use this plugin to provision instances on |
| 60 | `Devstack <https://docs.openstack.org/devstack/latest/>`. This is |
| 61 | an example of the *local.conf* file that can be used as input |
| 62 | for Devstack |
| 63 | |
| 64 | .. path local.conf |
| 65 | .. code-block:: ini |
| 66 | |
| 67 | [[local|localrc]] |
| 68 | ADMIN_PASSWORD=<password> |
| 69 | DATABASE_PASSWORD=<password> |
| 70 | RABBIT_PASSWORD=<password> |
| 71 | SERVICE_PASSWORD=<password> |
| 72 | SERVICE_TOKEN=<token> |
| 73 | |
| 74 | # Used to only upload the Ubuntu Cloud Image |
| 75 | DOWNLOAD_DEFAULT_IMAGES=False |
| 76 | IMAGE_URLS+="http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img" |
| 77 | |
| 78 | # (Optional) These values helps to improve the experience deploying and using Devstack |
| 79 | GIT_BASE=https://git.openstack.org |
| 80 | FORCE_CONFIG_DRIVE="True" |
| 81 | disable_service tempest |
| 82 | |
| 83 | .. end |
| 84 | |
| 85 | .. note:: |
| 86 | |
| 87 | There is a validation that checks if the |
| 88 | *vagrant-openstack-provider* plugin is installed raising an error |
| 89 | for those cases when it isn't. |