OpenStack: Install OpenStack CLI client

release notes for openstack client tools

# installed
pip list | grep python-openstackclient
python-openstackclient  3.16.2
 
# available (for rocky release)
https://docs.openstack.org/releasenotes/python-openstackclient/rocky.html
https://github.com/openstack/python-magnumclient/releases
 
# install rocky client versions
pip install -U \
  gnocchiclient \
  "pankoclient<0.6.0" \
  "python-barbicanclient<4.8.0" \
  "python-cinderclient<4.0.1" \
  "python-cloudkittyclient" \
  "python-glanceclient<2.14.0" \
  "python-heatclient<1.17.0" \
  "python-keystoneclient<3.18.0" \
  "python-magnumclient<2.11.0" \
  "python-mistralclient<3.8.0" \
  "python-neutronclient<6.10.0" \
  "python-novaclient<11.1.0" \
  "python-octaviaclient<1.7.0" \
  "python-openstackclient<3.18.0" \
  "python-swiftclient<3.7.0"
 
# install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec "$SHELL"
 
# install python 3.5.x version into pyenv (DO NOT USE VERSIONS > 3.5.x)
apt install build-essential libbz2-dev libreadline-dev libssl-dev zlib1g-dev libsqlite3-dev wget curl libncurses5-dev libncursesw5-dev xz-utils libffi-dev liblzma-dev
pyenv install 3.5.6
echo '3.5.6' > ~/.python-version  # python 3.5.6 will be used ONLY if your pwd is ~/
 
# install all openstack clients
cd ~/
pip install -U pip
pip install -U python-openstackclient python-keystoneclient python-cinderclient python-novaclient \
python-neutronclient python-glanceclient python-octaviaclient python-swiftclient python-heatclient \
python-magnumclient python-barbicanclient python-mistralclient \
pankoclient gnocchiclient
 
# Extend BASH completion
openstack complete | sudo tee /etc/bash_completion.d/openstack
source /etc/bash_completion
 
# test
# source foo-stage-openrc.sh
# openstack image list
 
 
# ubuntu default packages
sudo apt install -y python-openstackclient python-keystoneclient python-cinderclient python-novaclient python-neutronclient python-glanceclient python-octaviaclient python-swiftclient python-heatclient python-magnumclient python-barbicanclient python-mistralclient python3-pankoclient python3-gnocchiclient
 
<strong>Install</strong>
https://docs.openstack.org/mitaka/user-guide/common/cli_install_openstack_command_line_clients.html
 
<strong>Debug</strong>
openstack hypervisor list 
openstack hypervisor stats show 
openstack compute service list
openstack volume service list
openstack network agent list
openstack extension show
 
# get server data
openstack server list --project ${CUSTOMER_PROJECT_ID}
openstack server show <CUSTOMER_SERVER_ID>
openstack console log show <CUSTOMER_SERVER_ID>
 
# get security group
openstack security group list --project ${CUSTOMER_PROJECT_ID}
openstack security group show <CUSTOMER_SECURITY_GROUP_ID>

Links
https://github.com/pyenv/pyenv