Colleen Murphy 6bff9dfb79 Use the unified openstack client
We encourage using the unified openstack client rather than individual
service CLI tools, since it is very close to feature parity and has a
more consistent interface. Recommending the individual CLI tools is also
confusing because some services, like keystone, don't have their own
CLIs any more.

Change-Id: I35656ba6add4e403d79d2cbe2a2122cc0b09ea0d
2018-10-24 23:28:17 +02:00

3.2 KiB

Demo environment

image

DevStack

  • A bunch of scripts to build a full OpenStack environment
  • Used as
    • Demo environment
    • Part of the OpenStack project's functional testing
  • Single and multi node setup
  • Installs services from source
    • from git master by default
    • from stable branches by configuration, e.g. stable/newton
  • Documentation: https://docs.openstack.org/developer/devstack/

DevStack Clone and Setup

  • Clone DevStack to your vm
git clone https://git.openstack.org/openstack-dev/devstack
  • Make any local configurations changes (set passwords, IP addresses, etc.)
cd ./devstack
cp ./samples/local.conf .
nano ./local.conf

Note

  • Students can use a different editor instead of nano with their own preferences (e.g. vi, emacs, or whatever they want).
  • Run DevStack
./stack.sh

Note

  • DevStack should already be installed in the VM image you downloaded. These instructions are provided for future reference in the case that students need to start from scratch.

http://localhost/

  • After DevStack is run Horizon is accessible via localhost

image

Running services in DevStack

  • screen command was used to access the virtual terminals running the installed services
    • screen use is now deprecated
    • To use screen explicitly set USE_SCREEN=True option in local.conf
  • More details: Developing with Devstack

image

Note

  • Screen is going away in Queens : http://lists.openstack.org/pipermail/openstack-dev/2017-May/116301.html
  • Useful screen commands:
    • List sessions: screen -ls
    • Connect: screen -R <session name>
    • Start a new session: screen -C devstack/stack-screenrc
    • Move between services: <ctrl>-a n , <ctrl>-a p
    • Kill and restart a service: <ctrl>-c , <up arrow> to retrieve command
    • Disconnect: <ctrl>-a d

DevStack services with Systemd

  • systemd is the replacement for screen
  • Services in DevStack are running as systemd units named devstack@$servicename.service
  • Interact with services using commands like sudo systemctl <start|stop|restart> devstack@$servicename.service
  • Follow logs with journalctl -f --unit devstack@$servicename.service
  • More details: Using Systemd in DevStack

Exercise

  • Ensure you have the DevStack repository cloned to the VM where you would like to use it
  • Use systemctl status devstack@* to ensure devstack is running on your VM. If it is not started, start it with systemctl start devstack@*
  • Use the journalctl command to view output from your favorite service
  • Ensure you can use the openstack command to interact with the services running on your VM