Skip to content
 
 

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Openstack Cheat Sheet

Official

Members

Platinum Members

Provide a significant portion of the funding to achieve the Foundation's mission of protecting, empowering and promoting the OpenStack community and software. Each Platinum Member's company strategy aligns with the OpenStack mission and is responsible for committing full-time resources toward the project. There are eight Platinum Members at any given time, each of which holds a seat on the Board of Directors.

Gold Members

Provide funding and pledge strategic alignment to the OpenStack mission. There can be up to twenty-four Gold Members at any given time, subject to board approval.

Automatic Deployment

  • Devstack(Oneiric powered development environment for openstack.)
  • Fuel(The leading purpose-built open source deployment and management tool for OpenStack.)
  • RDO(A communiaty of people using and deploying OpenStack on CentOS, Fedora, and Red Hat Enterprise Linux.)
  • openstack-puppet(Bring scalable and reliable IT automation to OpenStack cloud deployments using puppet.)
  • openstack-ansible(Ansible playbooks for deploying OpenStack.)
  • kolla(Deploying OpenStack using Docker.)
  • TripleO(A program aimed at installing, upgrading and operating OpenStack clouds using OpenStack's own cloud facilities as the foundations.)
  • SaltStack(Deploying Openstack using saltstack.)
  • packstack (Install utility to deploy openstack on multiple hosts.)
  • stackanetes(Demo version of OpenStack on Kubernetes.)

Vender

  • Mirantis(Mirantis is the pure play OpenStack company, providing all the software, services, training and support you need to run a production deployment of OpenStack at scale.)
  • UnitedStack(UnitedStack is one of the most important hybrid cloud service providers, and its services have been highly appreciated by customers from all kinds of fields including Internet, resource, finance and manufacture.)
  • Rackspace(OpenStack founding father. The company started OpenStack officially, along with NASA in 2010.
  • Red Hat(The leading contributor to OpenStack code among vendors for the Icehouse release)
  • Nebula(Has been shut down)
  • easystack(OpenStack cloud platform and services provider, founded in Feb.2014.)
  • UMCloud(A joint venture of Mirantis and Ucloud in China.)
  • inwinSTACK(The largest open source RD center in Taiwan, striving to do everything in open source.)

Competitors

  • AWS(Offers reliable, scalable, and inexpensive cloud computing services.)
  • CloudStack(Open source software designed to deploy and manage large networks of virtual machines, as highly scalable Infrastructure as a Service (IaaS) cloud computing platform.)
  • Vmware(The industry-leading virtualization software company.)
  • Docker(Docker containers and tooling make building and shipping applications dramatically easier and faster.)

handy scripts

Check Openstack Services

for service in `systemctl list-units | grep -P "(openstack)|(neutron)"| sed 's/●//g' | awk  '{print $1}'`; do
        if systemctl is-active $service &>/dev/null; then
                echo -e "\e[32m$service is OK!\e[0m"
        else
                echo -e "\e[31m$service fail to start!\e[0m"
        fi
done

keystore

glance

  • images registry: Download images, like Ubuntu, CentOS,Sahara Apache Spark 1.0.0,etc.

Upload image uses glance may be very slow as using http transmission. If use ceph rbd backend storage, we can speed up via rbd import command:

upload()
{
        IMAGE_PATH=$1 # get image path
        if [[ -z $IMAGE_PATH ]]; then
                echo "Usage: $0 <IMAGE>"
                exit 1
        fi
        IMAGE=$(basename $IMAGE_PATH) # get image file name
        SUFFIX=${IMAGE##*.} # get the format of the image
        POOL=${2:-openstack-00}
        NAME=${IMAGE%.*} # extract image name from path

        # if not raw format, we should convert it
        FORMAT=$(qemu-img info ubuntu-16.04.1-server-amd64.iso  | grep "file format" | awk '{print $3}')
        if [[ $FORMAT != raw ]]; then
                TEMP_PATH=/tmp/${IMAGE}.raw
                qemu-img convert -O raw $IMAGE_PATH $TEMP_PATH
        fi
        if [[ -n $TEMP_PATH ]]; then
                TARGET_PATH=$TEMP_PATH
        else
                TARGET_PATH=$IMAGE_PATH
        fi
        
        # get cluster id and image id  
        CLUSTER_ID=$(ceph -s 2>/dev/null | grep -w "cluster" | awk '{print $2}')
        IMAGE_ID=$(glance image-create | grep -w 'id' | awk '{print $4}')

        # import image use rbd
        rbd --pool=openstack-00 import $TARGET_PATH  --image=$IMAGE_ID --new-format --order 24
        rbd snap create $POOL/${IMAGE_ID}@snap
        rbd snap protect $POOL/${IMAGE_ID}@snap

        # update image metadata
        glance --os-image-api-version=1 image-update --is-public True --disk-format raw --container-format bare --name $NAME $IMAGE_ID
        glance --os-image-api-version=1 image-update --location rbd://$CLUSTER_ID/$POOL/$IMAGE_ID/snap $IMAGE_ID

        # remove temp file if exists
        if [[ -n $TEMP_PATH ]]; then
                rm $TEMP_PATH
        fi
}

nova

Tips

List all error servers:

nova list --status error --all-tenants

List all servers and their mapped host:

nova list --fields name,host

List IDs of servers:

nova list --minimal | tail -n +4 | head -n -1 | cut -d ' ' -f 2

List IDs of servers with error status:

nova list --minimal --status error --all-tenants | tail -n +4 | head -n -1 | cut -d ' ' -f 2

List all the servers whose name starts with "test":

nova list --name "^test"

Attached volumes' ID:

nova show --minimal 65e761b3-63b4-498f-9735-08e246c1e976 | grep 'os-extended-volumes:volumes_attached' | cut -d '|' -f 3 | jq '.[].id' | sed 's/"//g'

Attached volumes' ID and the mapped device name:

nova show --minimal | grep 'os-extended-volumes:volumes_attached' | cut -d '|' -f 3 | jq '.[]|.id + " " + .device_name' | sed 's/"//g'

Remove all servers (dangrous)

Only this tenant:

nova delete `nova list --fields id | grep -P '\w{8}-.*' | awk '{print $ 2}' | tr '\n' ' '`

Clean up all tenants' servers:

nova delete `nova list --all-tenants --fields id | grep -P '\w{8}-.*' | awk '{print $ 2}' | tr '\n' ' '`

cinder

List ID of error volumes:

cinder list --status error --all-tenants | tail -n +4 | head -n -1 | cut -d '|' -f 2

List all the snapshots of the volume specified by ID:

cinder snapshot-list --volume-id 2ad21c7d-dbef-49a9-ba6c-64c258101eb0 | grep -P "\w{8}-\w{4}" | cut -d ' ' -f 2

List all the snapshots of the volume specified by name:

cinder list | grep "YOUR_VOLUME_NAME" | awk '{system("cinder snapshot-list --volume-id " $2)}' | grep -P "\w{8}-\w{4}" | cut -d ' ' -f 2

Remove all the snapshots of the volume specified by name:

cinder list  | grep 'YOUR_VOLUME_NAME' | awk '{system("cinder snapshot-list | grep " $2)}' | awk '{system("cinder snapshot-delete " $2)}'

neutron

swift

trove

heat

  • heat templates: Heat demo templates, like Hello World, OpenShift-F19,etc.

murano

  • murano packages: Murano packages, like Apache HTTP Server, Docker & Kubernetes Bundle, Jenkins, Kubernetes Cluster, etc.

sahara

About image

manila

magnum

About

openstack cheat sheet

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages