tuskar/tuskar — pull request #75 by marios (2013-07-25 17:15:33+00:00)
Title: Heat template flavors aggregates etc

This will generate the HEAT template including all the nova commands for:

* create host aggregate for each resource class
* tag the host aggregate with the metadata (class=m1)
* add all nodes in each rack of the resource class to that host aggregate
* create each flavor, and add metadata (class=m1)

This is explained in more detail in https://www.pivotaltracker.com/story/show/53809435

To see the HEAT template do:

GET http://0.0.0.0:6385/v1/data_centers/template
(DO NOT specify Accept header)

Second commit removes the calls out to nova for creating flavors, as this is done in the HEAT template now.

Ready for testing against HEAT (POST /data_centers)

marios

fwiw - relevant part of generated template looks like:

UserData:
Fn::Base64:
|
#!/bin/bash -v
/opt/aws/bin/cfn-init
#0. SOURCE CREDENTIALS FOR NOVA COMMANDS
source /root/stackrc
#1. CREAT HOST AGGREGATE for each resource class
AGGREGATE_ID=$(nova aggregate-create "compute-rc-hosts" | tail -n +4 | head -n 1 | tr -s ' ' | cut -d '|' -f2)
#2. SET HOST AGGREGATE METADATA
nova aggregate-set-metadata $AGGREGATE_ID class="compute-rc"
#3. CREATE EACH FLAVOR
nova flavor-show "compute-rc.m1.xlarge" &> /dev/null
if [ $? == 1 ]; then

nova flavor-create --ephemeral=0 --swap=0 "compute-rc.m1.xlarge" "auto" 15 1680 4
fi
#4. SET FLAVOR METADATA
nova flavor-key "compute-rc.m1.xlarge" set class="compute-rc"
#5. ADD NODES TO HOST AGGREGATE
nova aggregate-add-host $AGGREGATE_ID 16cfc99b-77ac-4206-a51a-b50420a7bde3
nova aggregate-add-host $AGGREGATE_ID af1fc886-6166-468c-995f-9f0e234709e9
nova aggregate-add-host $AGGREGATE_ID 57c8c306-6f40-4ec6-9d4a-6a76ddb2cc93
nova aggregate-add-host $AGGREGATE_ID 45c9f447-fd93-4f6c-a2ac-af811b2abda2
nova aggregate-add-host $AGGREGATE_ID a1624c55-6fb4-4a34-a864-4bf06ca4016d
nova aggregate-add-host $AGGREGATE_ID bc6ed43e-243a-46ec-b1f8-78f78580439d
Type: AWS::EC2::Instance