provider/openstack: Update Development Documentation (#12265)
This commit removes the bundled devstack script and updates the documentation to point to the latest build scripts used for testing. It also mentions that development should be possible on any OpenStack environment.
This commit is contained in:
parent
0b18d4cb67
commit
9d3606c1b2
|
@ -1,166 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y git make mercurial
|
||||
|
||||
sudo wget -O /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
|
||||
sudo chmod +x /usr/local/bin/gimme
|
||||
gimme 1.6 >> .bashrc
|
||||
|
||||
mkdir ~/go
|
||||
eval "$(/usr/local/bin/gimme 1.6)"
|
||||
echo 'export GOPATH=$HOME/go' >> .bashrc
|
||||
export GOPATH=$HOME/go
|
||||
|
||||
export PATH=$PATH:$HOME/terraform:$HOME/go/bin
|
||||
echo 'export PATH=$PATH:$HOME/terraform:$HOME/go/bin' >> .bashrc
|
||||
source .bashrc
|
||||
|
||||
go get github.com/hashicorp/terraform
|
||||
|
||||
git clone https://git.openstack.org/openstack-dev/devstack -b stable/mitaka
|
||||
cd devstack
|
||||
cat >local.conf <<EOF
|
||||
[[local|localrc]]
|
||||
# OpenStack version
|
||||
OPENSTACK_VERSION="mitaka"
|
||||
|
||||
# devstack password
|
||||
DEVSTACK_PASSWORD="password"
|
||||
|
||||
# Configure passwords and the Swift Hash
|
||||
MYSQL_PASSWORD=\$DEVSTACK_PASSWORD
|
||||
RABBIT_PASSWORD=\$DEVSTACK_PASSWORD
|
||||
SERVICE_TOKEN=\$DEVSTACK_PASSWORD
|
||||
ADMIN_PASSWORD=\$DEVSTACK_PASSWORD
|
||||
SERVICE_PASSWORD=\$DEVSTACK_PASSWORD
|
||||
SWIFT_HASH=\$DEVSTACK_PASSWORD
|
||||
|
||||
# Configure the stable OpenStack branches used by DevStack
|
||||
# For stable branches see
|
||||
# http://git.openstack.org/cgit/openstack-dev/devstack/refs/
|
||||
CINDER_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
CEILOMETER_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
GLANCE_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
HEAT_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
HORIZON_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
KEYSTONE_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
NEUTRON_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
NOVA_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
SWIFT_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
ZAQAR_BRANCH=stable/\$OPENSTACK_VERSION
|
||||
|
||||
# Enable Swift
|
||||
enable_service s-proxy
|
||||
enable_service s-object
|
||||
enable_service s-container
|
||||
enable_service s-account
|
||||
|
||||
# Disable Nova Network and enable Neutron
|
||||
disable_service n-net
|
||||
enable_service q-svc
|
||||
enable_service q-agt
|
||||
enable_service q-dhcp
|
||||
enable_service q-l3
|
||||
enable_service q-meta
|
||||
enable_service q-flavors
|
||||
|
||||
# Disable Neutron metering
|
||||
disable_service q-metering
|
||||
|
||||
# Enable LBaaS V1
|
||||
#enable_service q-lbaas
|
||||
|
||||
# Enable FWaaS
|
||||
enable_service q-fwaas
|
||||
|
||||
# Enable LBaaS v2
|
||||
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas stable/\$OPENSTACK_VERSION
|
||||
enable_plugin octavia https://git.openstack.org/openstack/octavia stable/\$OPENSTACK_VERSION
|
||||
enable_service q-lbaasv2
|
||||
enable_service octavia
|
||||
enable_service o-cw
|
||||
enable_service o-hk
|
||||
enable_service o-hm
|
||||
enable_service o-api
|
||||
|
||||
# Enable Trove
|
||||
enable_plugin trove git://git.openstack.org/openstack/trove.git stable/\$OPENSTACK_VERSION
|
||||
enable_service trove,tr-api,tr-tmgr,tr-cond
|
||||
|
||||
# Disable Temptest
|
||||
disable_service tempest
|
||||
|
||||
# Disable Horizon
|
||||
disable_service horizon
|
||||
|
||||
# Disable Keystone v2
|
||||
#ENABLE_IDENTITY_V2=False
|
||||
|
||||
# Enable SSL/tls
|
||||
#enable_service tls-proxy
|
||||
#USE_SSL=True
|
||||
|
||||
# Enable Ceilometer
|
||||
#enable_service ceilometer-acompute
|
||||
#enable_service ceilometer-acentral
|
||||
#enable_service ceilometer-anotification
|
||||
#enable_service ceilometer-collector
|
||||
#enable_service ceilometer-alarm-evaluator
|
||||
#enable_service ceilometer-alarm-notifier
|
||||
#enable_service ceilometer-api
|
||||
|
||||
# Enable Zaqar
|
||||
#enable_plugin zaqar https://github.com/openstack/zaqar
|
||||
#enable_service zaqar-server
|
||||
|
||||
# Automatically download and register a VM image that Heat can launch
|
||||
# For more information on Heat and DevStack see
|
||||
# http://docs.openstack.org/developer/heat/getting_started/on_devstack.html
|
||||
#IMAGE_URLS+=",http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2"
|
||||
#IMAGE_URLS+=",https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img"
|
||||
|
||||
# Logging
|
||||
LOGDAYS=1
|
||||
LOGFILE=/opt/stack/logs/stack.sh.log
|
||||
LOGDIR=/opt/stack/logs
|
||||
EOF
|
||||
./stack.sh
|
||||
|
||||
# Patch openrc
|
||||
#cat >> openrc <<EOF
|
||||
#
|
||||
# Currently, in order to use openstackclient with Identity API v3,
|
||||
# we need to set the domain which the user and project belong to.
|
||||
#if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then
|
||||
# export OS_USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-"default"}
|
||||
# export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"}
|
||||
#fi
|
||||
#EOF
|
||||
|
||||
# Prep the testing environment by creating the required testing resources and environment variables
|
||||
source openrc admin
|
||||
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
|
||||
glance image-create --name CirrOS --disk-format qcow2 --container-format bare < cirros-0.3.4-x86_64-disk.img
|
||||
nova flavor-create m1.tform 99 512 5 1 --ephemeral 10
|
||||
_NETWORK_ID=$(nova net-list | grep private | awk -F\| '{print $2}' | tr -d ' ')
|
||||
_EXTGW_ID=$(nova net-list | grep public | awk -F\| '{print $2}' | tr -d ' ')
|
||||
_IMAGE_ID=$(nova image-list | grep CirrOS | awk -F\| '{print $2}' | tr -d ' ' | head -1)
|
||||
echo export OS_IMAGE_NAME="cirros-0.3.4-x86_64-uec" >> openrc
|
||||
echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc
|
||||
echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc
|
||||
echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc
|
||||
echo export OS_POOL_NAME="public" >> openrc
|
||||
echo export OS_FLAVOR_ID=99 >> openrc
|
||||
source openrc demo
|
||||
|
||||
# Replace the below lines with the repo/branch you want to test
|
||||
#git remote add jtopjian https://github.com/jtopjian/terraform
|
||||
#git fetch jtopjian
|
||||
#git checkout --track jtopjian/openstack-secgroup-safe-delete
|
||||
#make testacc TEST=./builtin/providers/openstack TESTARGS='-run=AccBlockStorageV1'
|
||||
#make testacc TEST=./builtin/providers/openstack TESTARGS='-run=AccCompute'
|
||||
#make testacc TEST=./builtin/providers/openstack
|
|
@ -172,14 +172,16 @@ variables must also be set:
|
|||
|
||||
* `OS_EXTGW_ID` - The UUID of the external gateway.
|
||||
|
||||
To make development easier, the `builtin/providers/openstack/devstack/deploy.sh`
|
||||
script will assist in installing and configuring a standardized
|
||||
[DevStack](http://docs.openstack.org/developer/devstack/) environment along with
|
||||
Golang, Terraform, and all development dependencies. It will also set the required
|
||||
environment variables in the `devstack/openrc` file.
|
||||
You should be able to use any OpenStack environment to develop on as long as the
|
||||
above environment variables are set.
|
||||
|
||||
Do not run the `deploy.sh` script on your workstation or any type of production
|
||||
server. Instead, run the script within a disposable virtual machine.
|
||||
[Here's](https://github.com/berendt/terraform-configurations) an example of a
|
||||
Terraform configuration that will create an OpenStack instance and then install and
|
||||
configure DevStack inside.
|
||||
Most of Terraform's OpenStack support is done in a standardized Packstack
|
||||
all-in-one environment. You can find the scripts to build this environment
|
||||
[here](https://github.com/jtopjian/terraform-devstack/tree/master/packstack-standard).
|
||||
The included `main.tf` file will need to be modified for your specific
|
||||
environment. Once it's up and running, you will have access to a standard,
|
||||
up-to-date OpenStack environment with the latest OpenStack services.
|
||||
|
||||
If you require access to deprecated services, such as Keystone v2 and
|
||||
LBaaS v1, you can use the "legacy" environment
|
||||
[here](https://github.com/jtopjian/terraform-devstack/tree/master/packstack-legacy).
|
||||
|
|
Loading…
Reference in New Issue