From 73c1ac6a97ef1a7d215fc6342b85a7d6460394c6 Mon Sep 17 00:00:00 2001 From: Robert Starmer Date: Tue, 12 Jun 2012 05:34:59 +0000 Subject: [PATCH 1/3] updated nova_test.sh to include floating IP and security_groups, and controller.pp to support a change in the horizon module (more horizon services) --- files/nova_test.sh | 30 ++++++++++++++++++------------ manifests/controller.pp | 24 ++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/files/nova_test.sh b/files/nova_test.sh index 77deb5b..2cb0237 100755 --- a/files/nova_test.sh +++ b/files/nova_test.sh @@ -5,26 +5,32 @@ source /root/openrc # get an image to test with -#wget http://uec-images.ubuntu.com/releases/11.10/release/ubuntu-11.10-server-cloudimg-amd64-disk1.img - +#wget http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img # import that image into glance -#glance add name="Ubuntu 11.10 cloudimg amd64" is_public=true container_format=ovf disk_format=qcow2 < ubuntu-11.10-server-cloudimg-amd64-disk1.img - -#IMAGE_ID=`glance index | grep 'Ubuntu 11.10 cloudimg amd64' | head -1 | awk -F' ' '{print $1}'` +#glance add name="precise-amd64" is_public=true container_format=ovf disk_format=qcow2 < precise-server-cloudimg-amd64-disk1.img +#IMAGE_ID=`glance index | grep 'precise-amd64' | head -1 | awk -F' ' '{print $1}'` wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img - glance add name='cirros image' is_public=true container_format=bare disk_format=qcow2 < cirros-0.3.0-x86_64-disk.img - IMAGE_ID=`glance index | grep 'cirros image' | head -1 | awk -F' ' '{print $1}'` # create a pub key ssh-keygen -f /tmp/id_rsa -t rsa -N '' -nova keypair-add --pub_key /tmp/id_rsa.pub key1 +nova keypair-add --pub_key /tmp/id_rsa.pub key_cirros -nova boot --flavor 1 --image ${IMAGE_ID} --key_name key1 dans_vm +nova secgroup-create cirros_test 'Cirros test security group' +nova secgroup-add-rule cirros_test tcp 22 22 0.0.0.0/0 +nova secgroup-add-rule cirros_test tcp 80 80 0.0.0.0/0 +nova secgroup-add-rule cirros_test icmp -1 -1 0.0.0.0/0 -nova show dans_vm +floating_ip=`nova floating-ip-create | grep None | awk '{print $2}'` + +nova boot --flavor 1 --security_groups cirros_test --image ${IMAGE_ID} --key_name key_cirros cirros_vm +sleep 5 +nova show cirros_vm +# wait for the server to boot +sleep 20 +nova add-floating-ip precise_vm $floating_ip +sleep 10 +ssh ubuntu@$floating_ip -i /tmp/id_rsa -# create ec2 credentials -keystone ec2-credentials-create diff --git a/manifests/controller.pp b/manifests/controller.pp index 0903f88..8dcadf0 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -30,6 +30,11 @@ # network settings. Optioal. Defaults to {} # [verbose] Rahter to log services at verbose. # [export_resources] Rather to export resources. +# Horizon related config - assumes puppetlabs-horizon code +# [cache_server_ip] local memcached instance ip +# [cache_server_port] local memcached instance port +# [swift] (bool) is swift installed +# [quantum] (bool) is quqntum installed # class openstack::controller( # my address @@ -65,7 +70,14 @@ class openstack::controller( $network_config = {}, # I do not think that this needs a bridge? $verbose = false, - $export_resources = true + $export_resources = true, + $cache_server_ip = '127.0.0.1', + $cache_server_port = '11211', + $swift = false, + $quantum = false, + $app_mon = undef, + $comp_mon = undef, + $stor_mon = undef, ) { $glance_api_servers = "${internal_address}:9292" @@ -261,7 +273,15 @@ class openstack::controller( listen_ip => '127.0.0.1', } - class { 'horizon': } + class { 'horizon': + cache_server_ip => $cache_server_ip, + cache_server_port => $cache_server_port, + swift => $swift, + quantum => $quantum, + app_mon => $app_mon, + comp_mon => $comp_mon, + stor_mon => $stor_mon, + } ######## End Horizon ##### From e6c36084809a08f584efe15916e0c1494a62390b Mon Sep 17 00:00:00 2001 From: Robert Starmer Date: Tue, 12 Jun 2012 07:40:09 +0000 Subject: [PATCH 2/3] updates based on pull request --- manifests/controller.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/controller.pp b/manifests/controller.pp index 8dcadf0..cb1e9b3 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -35,6 +35,10 @@ # [cache_server_port] local memcached instance port # [swift] (bool) is swift installed # [quantum] (bool) is quqntum installed +# The next is an array of arrays, that can be used to add call-out links to the dashboard for other apps. +# There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose. +# Each app is defined in two parts, the display name, and the URI +# [horizon_app_links] array as in '[ ["Nagios","http://nagios_addr:port/path"],["Ganglia","http://ganglia_addr"] ]' # class openstack::controller( # my address @@ -75,9 +79,7 @@ class openstack::controller( $cache_server_port = '11211', $swift = false, $quantum = false, - $app_mon = undef, - $comp_mon = undef, - $stor_mon = undef, + $horizon_app_links = false, ) { $glance_api_servers = "${internal_address}:9292" @@ -278,9 +280,7 @@ class openstack::controller( cache_server_port => $cache_server_port, swift => $swift, quantum => $quantum, - app_mon => $app_mon, - comp_mon => $comp_mon, - stor_mon => $stor_mon, + horizon_app_links => $horizon_app_links, } From fba5fdf45ef7e13370ce4e5a3b085fca3c6862ec Mon Sep 17 00:00:00 2001 From: Robert Starmer Date: Tue, 12 Jun 2012 22:25:26 +0000 Subject: [PATCH 3/3] reversed nova_test.sh updates, fixed misspelling in controller.pp; added parameters needed to enable additional horizon services --- files/nova_test.sh | 36 +++++++++++++++--------------------- manifests/controller.pp | 2 +- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/files/nova_test.sh b/files/nova_test.sh index 2cb0237..2e764b4 100755 --- a/files/nova_test.sh +++ b/files/nova_test.sh @@ -5,32 +5,26 @@ source /root/openrc # get an image to test with -#wget http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img -# import that image into glance -#glance add name="precise-amd64" is_public=true container_format=ovf disk_format=qcow2 < precise-server-cloudimg-amd64-disk1.img -#IMAGE_ID=`glance index | grep 'precise-amd64' | head -1 | awk -F' ' '{print $1}'` +#wget http://uec-images.ubuntu.com/releases/11.10/release/ubuntu-11.10-server-cloudimg-amd64-disk1.img + +# import that image into glance +#glance add name="Ubuntu 11.10 cloudimg amd64" is_public=true container_format=ovf disk_format=qcow2 < ubuntu-11.10-server-cloudimg-amd64-disk1.img + +#IMAGE_ID=`glance index | grep 'Ubuntu 11.10 cloudimg amd64' | head -1 | awk -F' ' '{print $1}'` + +wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-i386-disk.img + +glance add name='cirros image' is_public=true container_format=bare disk_format=qcow2 < cirros-0.3.0-i386-disk.img -wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img -glance add name='cirros image' is_public=true container_format=bare disk_format=qcow2 < cirros-0.3.0-x86_64-disk.img IMAGE_ID=`glance index | grep 'cirros image' | head -1 | awk -F' ' '{print $1}'` # create a pub key ssh-keygen -f /tmp/id_rsa -t rsa -N '' -nova keypair-add --pub_key /tmp/id_rsa.pub key_cirros +nova keypair-add --pub_key /tmp/id_rsa.pub key1 -nova secgroup-create cirros_test 'Cirros test security group' -nova secgroup-add-rule cirros_test tcp 22 22 0.0.0.0/0 -nova secgroup-add-rule cirros_test tcp 80 80 0.0.0.0/0 -nova secgroup-add-rule cirros_test icmp -1 -1 0.0.0.0/0 +nova boot --flavor 1 --image ${IMAGE_ID} --key_name key1 dans_vm -floating_ip=`nova floating-ip-create | grep None | awk '{print $2}'` - -nova boot --flavor 1 --security_groups cirros_test --image ${IMAGE_ID} --key_name key_cirros cirros_vm -sleep 5 -nova show cirros_vm -# wait for the server to boot -sleep 20 -nova add-floating-ip precise_vm $floating_ip -sleep 10 -ssh ubuntu@$floating_ip -i /tmp/id_rsa +nova show dans_vm +# create ec2 credentials +keystone ec2-credentials-create diff --git a/manifests/controller.pp b/manifests/controller.pp index cb1e9b3..9c7d733 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -34,7 +34,7 @@ # [cache_server_ip] local memcached instance ip # [cache_server_port] local memcached instance port # [swift] (bool) is swift installed -# [quantum] (bool) is quqntum installed +# [quantum] (bool) is quantum installed # The next is an array of arrays, that can be used to add call-out links to the dashboard for other apps. # There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose. # Each app is defined in two parts, the display name, and the URI