OpenStack

Releases
https://releases.openstack.org/
https://releases.openstack.org/rocky/index.html

Reset password

. /etc/kolla/admin-openrc.sh
openstack user password set --password new-password --original-password current-admin-password

CLI
source /etc/kolla/admin-openrc.sh
openstack compute service list
https://docs.openstack.org/ocata/user-guide/cli-cheat-sheet.html
https://docs.openstack.org/queens/user/
https://docs.openstack.org/keystone/pike/admin/cli-manage-projects-users-and-roles.html
https://docs.openstack.org/python-openstackclient/pike/cli/command-list.html
# List your instances
openstack server list

# List your volumes
openstack volume list

CLI images
https://docs.openstack.org/glance/latest/admin/manage-images.html
# List the images
openstack image list

# change user password
openstack user set --password pass123 user1

# list instances / server
openstack server list
openstack console log show pko-vm1

# floating IPs
https://docs.openstack.org/ocata/user-guide/cli-manage-ip-addresses.html
openstack floating ip list
openstack floating ip create public-net

Instance
https://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance.html
# openstack flavor list
# openstack image list
# openstack network list
# openstack security group list
# openstack keypair list
openstack server create --flavor m1.small --image "Ubuntu 18.04" --nic net-id=foo-network --security-group default --key-name foo-key foo-vm1

Network CLI
https://developer.openstack.org/firstapp-libcloud/networking.html

Ansible
https://github.com/panticz/ansible/tree/master/roles/devstack

Cloud images
http://download.cirros-cloud.net/

Cloud config
https://docs.openstack.org/nova/rocky/user/config-drive.html

#
# old
#
sudo apt-get install git
git clone https://git.openstack.org/openstack-dev/devstack

cat < local.conf
[[local|localrc]]
ADMIN_PASSWORD=devstack
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
EOF

sudo devstack/tools/create-stack-user.sh
su stack

cd devstack
./stack.sh

ssh -N -L 8080:localhost:80 root@192.168.254.46

export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=stack
export OS_AUTH_URL=http://localhost:35357/v2.0

nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0

nova list
nova floating-ip-create public

Terraform
https://github.com/terraform-providers/terraform-provider-openstack/tree/master/examples/app-with-networking

Network
https://developer.openstack.org/firstapp-libcloud/networking.html
openstack network create worker_network
openstack subnet create worker_subnet --network worker_network --subnet-range 10.0.1.0/24
openstack router create project_router
openstack router set project_router --external-gateway public
openstack router add subnet project_router worker_subnet

Command line
sudo apt install -y python-magnumclient
pip install python-magnumclient

CLI quotas
https://docs.openstack.org/ocata/user-guide/cli-cheat-sheet.html
https://docs.openstack.org/nova/pike/admin/quotas.html
# show default quota
penstack quota show --default

# set quotas
openstack quota set --class --instances 20 default
openstack quota set --class --cores 20 default
openstack quota set --class --ram $((68 * 1024)) default

Magnum
# images
https://fedorapeople.org/groups/magnum/

microstack on ubuntu
sudo snap install microstack --classic --candidate

Formatec output
for FLAVOR in $(openstack flavor list -c Name -f value); do
echo ${FLAVOR}
openstack flavor show ${FLAVOR}
echo
done

cloud-init images
https://docs.openstack.org/image-guide/ubuntu-image.html

clouds.yaml
https://docs.openstack.org/python-openstackclient/pike/configuration/index.html

# ~/.config/openstack/clouds.yaml
clouds:
admin-dev:
auth:
auth_url: http://api.dev.example.com:35357/
project_name: admin
username: admin
password: bar1234
user_domain_name: Default
project_domain_name: Default
foo-stage:
auth:
auth_url: http://api.stage.example.com:35357/
project_name: fooproject
username: foo
password: foopass
user_domain_name: foodom
project_domain_name: foodom

openstack --os-cloud admin-dev server list
openstack --os-cloud foo-stage server list

Links
https://www.openstack.org/software/
http://docs.openstack.org/developer/devstack/guides/single-vm.html
http://docs.openstack.org/liberty/install-guide-ubuntu/
http://docs.openstack.org/developer/devstack/
https://www.ubuntu.com/cloud
https://trickycloud.wordpress.com/