Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kiall committed Mar 2, 2012
2 parents 3f26a97 + 3028570 commit 07603e0
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 43 deletions.
15 changes: 11 additions & 4 deletions README.md
Expand Up @@ -2,20 +2,27 @@


These scripts install+setup OpenStack (an all in one server, or all bar compute + compute nodes). These scripts install+setup OpenStack (an all in one server, or all bar compute + compute nodes).


**This only suports VLAN networking where each server has 2x network cards** # Assumptions:
It could be changed for others, but out of the box, thats what it does.


NOTE: These scripts do NOT secure your setup. Every service connects to MySQL as root, The default RabbitMQ account is used etc. Is is **your** job to handle that kind of stuff after you have a quick and dirty, but working install done. 1. You want to use the VLAN network manager. (NOTE: The requires VLAN capable switches!)
2. You want to use multi-node networking (NOTE: This is *very* different to simply having multiple compute nodes. Read up on it.)
3. You want to use 2 network cards in every server (1 for public traffic, 1 for nova's internal traffic)
4. You are installing on 100% clean Ubuntu 11.10 servers (i.e. you have *never* attempted to install OpenStack on these servers since the last time they were wiped)


If these assumptions are not valid for your setup, these scripts will not work and have not been tested. They could be changed for others, but out of the box, that is simply what they do.

NOTE: These scripts do NOT secure your setup. eg the default RabbitMQ "guest" account is used etc. Is is **your** job to handle that kind of stuff after you have a quick and dirty, but working install done.


# All in one server (You can add more later...) # All in one server (You can add more later...)


Instructions:

1. Install ubuntu 11.10 1. Install ubuntu 11.10
2. Setup /etc/network/interfaces (See sample below) 2. Setup /etc/network/interfaces (See sample below)
3. Login as root 3. Login as root
4. Install git (apt-get install git) 4. Install git (apt-get install git)
5. Clone scripts (git clone https://github.com/managedit/openstack-setup.git) 5. Clone scripts (git clone https://github.com/managedit/openstack-setup.git)
6. Edit "settings" to suit.. (or create settings.local with overrides) 6. Edit "settings" to suit.. (or better yet, create settings.local and copy the settings you want to change in there.)
7. Run: ./all-in-one.sh 7. Run: ./all-in-one.sh
8. ... 8. ...
9. Profit! 9. Profit!
Expand Down
11 changes: 0 additions & 11 deletions glance-api.conf.tmpl
Expand Up @@ -131,21 +131,10 @@ image_cache_stall_timeout = 86400
# Turn on/off delayed delete # Turn on/off delayed delete
delayed_delete = False delayed_delete = False


# Delayed delete time in seconds
scrub_time = 43200

# Directory that the scrubber will use to remind itself of what to delete
# Make sure this is also set in glance-scrubber.conf
scrubber_datadir = /var/lib/glance/scrubber

[pipeline:glance-api] [pipeline:glance-api]
#pipeline = versionnegotiation context apiv1app
# NOTE: use the following pipeline for keystone
pipeline = versionnegotiation authtoken context apiv1app pipeline = versionnegotiation authtoken context apiv1app


# To enable Image Cache Management API replace pipeline with below: # To enable Image Cache Management API replace pipeline with below:
# pipeline = versionnegotiation context imagecache apiv1app
# NOTE: use the following pipeline for keystone auth (with caching)
# pipeline = versionnegotiation authtoken context imagecache apiv1app # pipeline = versionnegotiation authtoken context imagecache apiv1app


[pipeline:versions] [pipeline:versions]
Expand Down
4 changes: 1 addition & 3 deletions glance-registry.conf.tmpl
Expand Up @@ -3,7 +3,7 @@
verbose = True verbose = True


# Show debugging output in logs (sets DEBUG log level output) # Show debugging output in logs (sets DEBUG log level output)
debug = True debug = False


# Address to bind the registry server # Address to bind the registry server
bind_host = 0.0.0.0 bind_host = 0.0.0.0
Expand Down Expand Up @@ -44,8 +44,6 @@ api_limit_max = 1000
limit_param_default = 25 limit_param_default = 25


[pipeline:glance-registry] [pipeline:glance-registry]
#pipeline = context registryapp
# NOTE: use the following pipeline for keystone
pipeline = authtoken keystone_shim context registryapp pipeline = authtoken keystone_shim context registryapp


[app:registryapp] [app:registryapp]
Expand Down
3 changes: 1 addition & 2 deletions glance-test.sh
Expand Up @@ -2,5 +2,4 @@


# Import Settings # Import Settings
. settings . settings
glance -A $SERVICE_TOKEN show 2 glance -A $SERVICE_TOKEN index || echo "Failed"
(glance -A $SERVICE_TOKEN index && echo "Success" ) || echo "Failed"
4 changes: 4 additions & 0 deletions glance-upload-lucid.sh
Expand Up @@ -3,6 +3,10 @@
# Import Settings # Import Settings
. settings . settings


echo "Use glance-upload-loader.sh followed by glance-upload-lucid-loader.sh instead"

exit 1

if [ ! -f "lucid-server-cloudimg-amd64.tar.gz" ] ; then if [ ! -f "lucid-server-cloudimg-amd64.tar.gz" ] ; then
echo "Downloading image" echo "Downloading image"
wget http://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-amd64.tar.gz wget http://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-amd64.tar.gz
Expand Down
14 changes: 7 additions & 7 deletions glance.sh
Expand Up @@ -16,21 +16,21 @@ sed -e "s,%MYSQL_HOST%,$MYSQL_HOST,g" -i glance-registry.conf
sed -e "s,%MYSQL_GLANCE_PASS%,$MYSQL_GLANCE_PASS,g" -i glance-registry.conf sed -e "s,%MYSQL_GLANCE_PASS%,$MYSQL_GLANCE_PASS,g" -i glance-registry.conf
sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" glance-api.conf.tmpl > glance-api.conf sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" glance-api.conf.tmpl > glance-api.conf


service glance-api stop
service glance-registry stop

sleep 2

cp glance-registry.conf glance-api.conf /etc/glance/ cp glance-registry.conf glance-api.conf /etc/glance/


chown glance:glance /etc/glance/glance-registry.conf chown glance:glance /etc/glance/glance-registry.conf
chown glance:glance /etc/glance/glance-api.conf chown glance:glance /etc/glance/glance-api.conf


service glance-api restart
sleep 2
service glance-registry restart
sleep 2

glance-manage db_sync glance-manage db_sync


service glance-api restart service glance-api start
sleep 2 sleep 2
service glance-registry restart service glance-registry start
sleep 2 sleep 2


./glance-upload-ttylinux.sh ./glance-upload-ttylinux.sh
Expand Down
2 changes: 1 addition & 1 deletion keystone_data.sh.tmpl
Expand Up @@ -23,7 +23,7 @@ keystone-manage service add keystone identity "Keystone Identity Service"


#endpointTemplates #endpointTemplates
keystone-manage endpointTemplates add %REGION% nova http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% 1 1 keystone-manage endpointTemplates add %REGION% nova http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% 1 1
keystone-manage endpointTemplates add %REGION% glance http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% 1 1 keystone-manage endpointTemplates add %REGION% glance http://%HOST_IP%:9292/v1 http://%HOST_IP%:9292/v1 http://%HOST_IP%:9292/v1 1 1
keystone-manage endpointTemplates add %REGION% keystone http://%HOST_IP%:5000/v2.0 http://%HOST_IP%:35357/v2.0 http://%HOST_IP%:5000/v2.0 1 1 keystone-manage endpointTemplates add %REGION% keystone http://%HOST_IP%:5000/v2.0 http://%HOST_IP%:35357/v2.0 http://%HOST_IP%:5000/v2.0 1 1
# keystone-manage endpointTemplates add %REGION% swift http://%HOST_IP%:8080/v1/AUTH_%tenant_id% http://%HOST_IP%:8080/ http://%HOST_IP%:8080/v1/AUTH_%tenant_id% 1 1 # keystone-manage endpointTemplates add %REGION% swift http://%HOST_IP%:8080/v1/AUTH_%tenant_id% http://%HOST_IP%:8080/ http://%HOST_IP%:8080/v1/AUTH_%tenant_id% 1 1


Expand Down
10 changes: 2 additions & 8 deletions nova-compute.sh
Expand Up @@ -3,7 +3,7 @@
# Settings # Settings
. settings . settings


apt-get install -y nova-api nova-compute nova-network python-keystone python-mysqldb mysql-client curl dnsmasq bridge-utils apt-get install -y nova-api nova-compute nova-network python-keystone python-mysqldb mysql-client curl


# Nova Setup # Nova Setup
sed -e "s,999888777666,$SERVICE_TOKEN,g" api-paste-keystone.ini.tmpl > api-paste-keystone.ini sed -e "s,999888777666,$SERVICE_TOKEN,g" api-paste-keystone.ini.tmpl > api-paste-keystone.ini
Expand All @@ -18,13 +18,7 @@ sed -e "s,%MYSQL_NOVA_PASS%,$MYSQL_NOVA_PASS,g" -i nova.conf
sed -e "s,%FIXED_RANGE_MASK%,$FIXED_RANGE_MASK,g" -i nova.conf sed -e "s,%FIXED_RANGE_MASK%,$FIXED_RANGE_MASK,g" -i nova.conf
sed -e "s,%FIXED_RANGE_NET%,$FIXED_RANGE_NET,g" -i nova.conf sed -e "s,%FIXED_RANGE_NET%,$FIXED_RANGE_NET,g" -i nova.conf
sed -e "s,%FIXED_RANGE%,$FIXED_RANGE,g" -i nova.conf sed -e "s,%FIXED_RANGE%,$FIXED_RANGE,g" -i nova.conf

sed -e "s,%LIBVIRT_TYPE%,$LIBVIRT_TYPE,g" -i nova.conf
# Fix dnsmasq
sed -e "s,ENABLED=1,ENABLED=0,g" -i /etc/default/dnsmasq

killall dnsmasq
sleep 1
killall -9 dnsmasq


cp nova.conf api-paste-keystone.ini /etc/nova/ cp nova.conf api-paste-keystone.ini /etc/nova/
chown nova:nova /etc/nova/nova.conf /etc/nova/api-paste-keystone.ini chown nova:nova /etc/nova/nova.conf /etc/nova/api-paste-keystone.ini
Expand Down
1 change: 1 addition & 0 deletions nova-controller.sh
Expand Up @@ -22,6 +22,7 @@ sed -e "s,%MYSQL_NOVA_PASS%,$MYSQL_NOVA_PASS,g" -i nova.conf
sed -e "s,%FIXED_RANGE_MASK%,$FIXED_RANGE_MASK,g" -i nova.conf sed -e "s,%FIXED_RANGE_MASK%,$FIXED_RANGE_MASK,g" -i nova.conf
sed -e "s,%FIXED_RANGE_NET%,$FIXED_RANGE_NET,g" -i nova.conf sed -e "s,%FIXED_RANGE_NET%,$FIXED_RANGE_NET,g" -i nova.conf
sed -e "s,%FIXED_RANGE%,$FIXED_RANGE,g" -i nova.conf sed -e "s,%FIXED_RANGE%,$FIXED_RANGE,g" -i nova.conf
sed -e "s,%LIBVIRT_TYPE%,$LIBVIRT_TYPE,g" -i nova.conf


cp nova.conf api-paste-keystone.ini /etc/nova/ cp nova.conf api-paste-keystone.ini /etc/nova/


Expand Down
4 changes: 2 additions & 2 deletions nova.conf.tmpl
Expand Up @@ -4,7 +4,6 @@
--state_path=/var/lib/nova --state_path=/var/lib/nova
--lock_path=/var/lock/nova --lock_path=/var/lock/nova
--force_dhcp_release=True --force_dhcp_release=True
--use_deprecated_auth
--verbose --verbose
--sql_connection=mysql://nova:%MYSQL_NOVA_PASS%@%MYSQL_HOST%/nova --sql_connection=mysql://nova:%MYSQL_NOVA_PASS%@%MYSQL_HOST%/nova
--public_interface=%PUBLIC_INTERFACE% --public_interface=%PUBLIC_INTERFACE%
Expand All @@ -19,7 +18,6 @@
--vncproxy_url=http://%HOST_IP%:6080 --vncproxy_url=http://%HOST_IP%:6080
--ajax_console_proxy_url=http://%HOST_IP%:8000 --ajax_console_proxy_url=http://%HOST_IP%:8000
--glance_api_servers=%HOST_IP%:9292 --glance_api_servers=%HOST_IP%:9292
--ec2_dmz_host=%HOST_IP%
--s3_dmz=%HOST_IP% --s3_dmz=%HOST_IP%
--ec2_host=%HOST_IP% --ec2_host=%HOST_IP%
--s3_host=%HOST_IP% --s3_host=%HOST_IP%
Expand All @@ -30,3 +28,5 @@
--fixed_range=%FIXED_RANGE% --fixed_range=%FIXED_RANGE%
--keystone_ec2_url=http://%HOST_IP%:5000/v2.0/ec2tokens --keystone_ec2_url=http://%HOST_IP%:5000/v2.0/ec2tokens
--multi_host=True --multi_host=True
--send_arp_for_ha=True
--libvirt_type=%LIBVIRT_TYPE%
6 changes: 3 additions & 3 deletions openrc.tmpl
Expand Up @@ -2,9 +2,9 @@ NOVA_API_HOST=%HOST_IP%
GLANCE_API_HOST=%HOST_IP% GLANCE_API_HOST=%HOST_IP%
KEYSTONE_API_HOST=%HOST_IP% KEYSTONE_API_HOST=%HOST_IP%


KEYSTONE_TENANT="admin" KEYSTONE_TENANT="%TENANT%"
KEYSTONE_USERNAME="admin" KEYSTONE_USERNAME="%USERNAME%"
KEYSTONE_PASSWORD="password" KEYSTONE_PASSWORD="%PASSWORD%"


NOVA_REGION="%REGION%" NOVA_REGION="%REGION%"


Expand Down
17 changes: 15 additions & 2 deletions settings
Expand Up @@ -3,10 +3,13 @@
# from there, allowing you to `git pull` without conflicts! # # from there, allowing you to `git pull` without conflicts! #
##################################################################### #####################################################################


# General Settings
LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm} # Currently supports kvm or qemu

# MySQL Server Settings # MySQL Server Settings
MYSQL_HOST="127.0.0.1" MYSQL_HOST="127.0.0.1"
MYSQL_ROOT_PASS="letmein" MYSQL_ROOT_PASS="letmein"
MYSQL_NOVA_PSSS="letmeinN" MYSQL_NOVA_PASS="letmeinN"
MYSQL_GLANCE_PASS="letmeinG" MYSQL_GLANCE_PASS="letmeinG"
MYSQL_KEYSTONE_PASS="letmeinK" MYSQL_KEYSTONE_PASS="letmeinK"
MYSQL_HORIZON_PASS="letmeinH" MYSQL_HORIZON_PASS="letmeinH"
Expand All @@ -26,7 +29,7 @@ FIXED_RANGE_NET="172.16.0.0"
FIXED_RANGE_BITS="12" FIXED_RANGE_BITS="12"
FIXED_RANGE_MASK="255.240.0.0" FIXED_RANGE_MASK="255.240.0.0"
FIXED_RANGE_NETWORK_SIZE="256" FIXED_RANGE_NETWORK_SIZE="256"
FIXED_RANGE_NETWROK_COUNT="16" FIXED_RANGE_NETWORK_COUNT="16"


# Misc # Misc
REGION="nova" # Region name - "nova" is the default, and probably the most reliable withoit extra setup! REGION="nova" # Region name - "nova" is the default, and probably the most reliable withoit extra setup!
Expand All @@ -37,6 +40,16 @@ then
. settings.local . settings.local
fi fi


# Check for kvm (hardware based virtualization). If unable to initialize
# kvm, we drop back to the slower emulation mode (qemu). Note: many systems
# come with hardware virtualization disabled in BIOS.
if [[ "$LIBVIRT_TYPE" == "kvm" ]]; then
modprobe kvm || true
if [ ! -e /dev/kvm ]; then
LIBVIRT_TYPE=qemu
fi
fi

# Dont change anything below here! # Dont change anything below here!
FIXED_RANGE="${FIXED_RANGE_NET}/${FIXED_RANGE_BITS}" FIXED_RANGE="${FIXED_RANGE_NET}/${FIXED_RANGE_BITS}"
export NOVA_PROJECT_ID="admin" # Tenant export NOVA_PROJECT_ID="admin" # Tenant
Expand Down

0 comments on commit 07603e0

Please sign in to comment.