Configure Simplestreams for a private cloud
When Juju bootstraps a cloud, it needs two critical pieces of information:
The uuid of the image to use when starting new compute instances.
The URL from which to download the correct version of a tools tarball.
The essential information above is actually stored in two json files in simplestreams.
To learn more details ,you can refer here.
Before configuring the simplestreams, we need to do some preparations:
Upload Ubuntu 14.04LTS(Trusty) and Ubuntu 16.04LTS(Xenial) image to Openstack
Choose xxxxx-server-cloudimg-amd64-disk1.img to download.
Upload the images to openstack:
Install Apache server
sudo apt-get install apache2
Generate image json file for simplestreams:
sudo mkdir /var/www/html/stack
sudo juju metadata generate-image -a amd64 -i 843bef24-8c70-40e1-a380-972717c9e4b3 -r RegionOne -s xenial -d /var/www/html/stack -u http://172.16.1.3:5000/v2.0 -e openstack
Regarding the command-line flags used:
- -i 843bef24-8c70-40e1-a380-972717c9e4b3: specifies the ID of the Glance image that we just created before.
- -u http://172.16.1.3:5000/v2.0: specifies the Keystone URL, and should match the value from the auth-url field of our environment as specified in $HOME/.juju/environments.yaml.
- -e openstack: identifies the Juju environment described in $HOME/.juju/environments.yaml file.
- -s xenial: specifies the image series (the Ubuntu release name).
- -a amd64: specifies the CPU architecture.
- -d /var/www/html/stack: specifies the base directory where the metadata will be written to. For images, the path will be /opt/stack/images/streams/v1..
Generate tools json file for simplestreams:
juju metadata generate-tools -d /var/www/html/stack/ --stream released
Tips:
/var/www/html
is the default directory of Apache server
Download tool files:
Download and put it in the directory /var/www/html/stack/tools/released
Tips:
Download the files that match Juju and operating system version
Change the files permission
cd /var/www/html
sudo chmod -R 777 stack
Use the validation commands to ensure image and tools are available for juju to use:
juju metadata validate-images
juju metadata validate-tools
Bootstrap Juju
juju switch openstack
juju bootstrap
And then you can try to deploy services by using juju deploy
, for example:
juju deploy juju-gui