├── README.md ├── local.sh └── localrc /README.md: -------------------------------------------------------------------------------- 1 | # ceph-devstack 2 | 3 | DevStack files to quickly deploy a DevStack configured with Ceph. 4 | Simply copy these 2 files in your DevStack directory and run `./stack.sh`. 5 | -------------------------------------------------------------------------------- /local.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Keep track of the devstack directory 4 | TOP_DIR=$(cd $(dirname "$0") && pwd) 5 | 6 | # Import common functions 7 | source $TOP_DIR/functions 8 | 9 | # Use openrc + stackrc + localrc for settings 10 | source $TOP_DIR/stackrc 11 | 12 | # Destination path for installation ``DEST`` 13 | DEST=${DEST:-/opt/stack} 14 | 15 | if is_service_enabled nova; then 16 | 17 | # Import ssh keys 18 | # --------------- 19 | 20 | # Get OpenStack admin auth 21 | source $TOP_DIR/openrc admin admin 22 | 23 | rm -f admin.pem 24 | nova keypair-add admin > admin.pem 25 | chmod 400 admin.pem 26 | 27 | # Create A Flavor 28 | # --------------- 29 | 30 | # Name of new flavor 31 | MI_NANO=m1.nano 32 | MI_MICRO=m1.micro 33 | 34 | # Create nano flavor if not present 35 | if [[ -z $(nova flavor-list | grep $MI_NANO) ]]; then 36 | nova flavor-create $MI_NANO 6 64 0 1 37 | fi 38 | 39 | # Create micro flavor if not present 40 | if [[ -z $(nova flavor-list | grep $MI_MICRO) ]]; then 41 | nova flavor-create $MI_MICRO 7 128 0 1 42 | fi 43 | 44 | # Create security group rules 45 | # ---------- 46 | 47 | # Add tcp/22 and icmp to default security group 48 | nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 49 | nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 50 | fi 51 | 52 | if is_service_enabled ceph; then 53 | 54 | # Download images, convert to RAW and upload them 55 | # ---------- 56 | 57 | wget http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img 58 | sudo qemu-img convert -f qcow2 -O raw cirros-0.3.3-x86_64-disk.img cirros-0.3.3-x86_64-disk.raw 59 | glance image-create --name CirrOS-0.3.3 --disk-format raw --container-format bare --file cirros-0.3.3-x86_64-disk.raw --progress 60 | 61 | wget https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img 62 | sudo qemu-img convert -f qcow2 -O raw trusty-server-cloudimg-amd64-disk1.img trusty-server-cloudimg-amd64-disk1.raw 63 | glance image-create --name Ubuntu-14.04 --disk-format raw --container-format bare --file trusty-server-cloudimg-amd64-disk1.raw --progress 64 | fi 65 | -------------------------------------------------------------------------------- /localrc: -------------------------------------------------------------------------------- 1 | ######## 2 | # MISC # 3 | ######## 4 | DATABASE_PASSWORD=password 5 | ADMIN_PASSWORD=password 6 | SERVICE_PASSWORD=password 7 | SERVICE_TOKEN=password 8 | RABBIT_PASSWORD=password 9 | 10 | # Reclone each time 11 | #RECLONE=yes 12 | 13 | # Enable Logging 14 | LOGFILE=/opt/stack/logs/stack.sh.log 15 | VERBOSE=True 16 | LOG_COLOR=True 17 | SCREEN_LOGDIR=/opt/stack/logs 18 | 19 | 20 | ################# 21 | # PRE-REQUISITE # 22 | ################# 23 | ENABLED_SERVICES=rabbit,mysql,key 24 | 25 | 26 | ######## 27 | # CEPH # 28 | ######## 29 | enable_plugin ceph https://github.com/openstack/devstack-plugin-ceph 30 | 31 | # DevStack will create a loop-back disk formatted as XFS to store the 32 | # Ceph data. 33 | CEPH_LOOPBACK_DISK_SIZE=10G 34 | 35 | # Ceph cluster fsid 36 | CEPH_FSID=$(uuidgen) 37 | 38 | # Glance pool, pgs and user 39 | GLANCE_CEPH_USER=glance 40 | GLANCE_CEPH_POOL=images 41 | GLANCE_CEPH_POOL_PG=8 42 | GLANCE_CEPH_POOL_PGP=8 43 | 44 | # Nova pool and pgs 45 | NOVA_CEPH_POOL=vms 46 | NOVA_CEPH_POOL_PG=8 47 | NOVA_CEPH_POOL_PGP=8 48 | 49 | # Cinder pool, pgs and user 50 | CINDER_CEPH_POOL=volumes 51 | CINDER_CEPH_POOL_PG=8 52 | CINDER_CEPH_POOL_PGP=8 53 | CINDER_CEPH_USER=cinder 54 | CINDER_CEPH_UUID=$(uuidgen) 55 | 56 | # Cinder backup pool, pgs and user 57 | CINDER_BAK_CEPH_POOL=backup 58 | CINDER_BAK_CEPH_POOL_PG=8 59 | CINDER_BAKCEPH_POOL_PGP=8 60 | CINDER_BAK_CEPH_USER=cinder-bak 61 | 62 | # How many replicas are to be configured for your Ceph cluster 63 | CEPH_REPLICAS=${CEPH_REPLICAS:-1} 64 | 65 | # Connect DevStack to an existing Ceph cluster 66 | REMOTE_CEPH=False 67 | REMOTE_CEPH_ADMIN_KEY_PATH=/etc/ceph/ceph.client.admin.keyring 68 | 69 | 70 | ########################## 71 | # GLANCE - IMAGE SERVICE # 72 | ########################## 73 | ENABLED_SERVICES+=,g-api,g-reg 74 | 75 | 76 | ################################# 77 | # CINDER - BLOCK DEVICE SERVICE # 78 | ################################# 79 | ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak 80 | CINDER_DRIVER=ceph 81 | CINDER_ENABLED_BACKENDS=ceph 82 | 83 | 84 | ########################## 85 | # NOVA - COMPUTE SERVICE # 86 | ########################## 87 | ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-cond,n-sch,n-net 88 | DEFAULT_INSTANCE_TYPE=m1.micro 89 | --------------------------------------------------------------------------------