715 Commits

Author SHA1 Message Date
Zane Bitter
8e30817a93 Account for XML output in Getting Started script
The output format of heat commands has changed from JSON to XML

Change-Id: I68b4011e31fdb14306e88506dc6ff819b041b054
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-15 17:52:01 -04:00
Zane Bitter
f5360d774d Fix directory changes in Getting Started script
Change-Id: I3b23b2c0de18d72f91d4a0254e9dbf689ac91be3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-15 17:51:54 -04:00
Zane Bitter
0670b7c3d3 Allow non-interactive installation of OpenStack
Pass the arguments to the tools/openstack script through to openstack-db so
that scripts can use e.g. --yes and --rootpw.

Also use openstack-db --drop rather than heat-db-drop to drop the databases
for OpenStack services.

Change-Id: I87811ee02d3bfd7cc2dca8b9ab20ea3cfc220e3e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-15 17:51:43 -04:00
Zane Bitter
6eb623580f Document Metadata server in Getting Started guide
Change-Id: Id0995df10f329ee3076a2c60ed5eb1548eaa315a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-15 17:49:35 -04:00
Steven Dake
5d5d8ba5dd Update openstack-common in prep for pulling in common.rpc
Change-Id: Ib3444d97967c807cb96175ce23d4b670a028e9a7
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-13 16:17:36 -07:00
Zane Bitter
fba2ed3921 Set the stack updated time through the Timestamp
Don't allow the resource class to modify the parent stack's database
representation directly.

Change-Id: Iff93d1430f4cb0695e729d0cf8f784ccb2ed7598
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-13 16:46:20 -04:00
Zane Bitter
bfd7fcf8f5 Eliminate DB access from the engine API
Access all data through the Stack and Resource objects.

Fixes #168

Change-Id: I0331a0ad67bcd11bb678e026ddc7b7c954517bc4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-13 16:46:20 -04:00
Zane Bitter
07be1d7269 Make timestamps available in Stack/Resource objects
Provide the creation time and last-updated time as attributes of Stack and
Resource objects so that external code does not need to access the database
in order to retrieve them. Use a Descriptor class so that the latest values
are always fetched from the database.

Change-Id: Ic3fa173b1dc8f2e5dc676a9152e8928ed2290913
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-13 16:46:19 -04:00
Steven Hardy
b0ec487799 heat cli : Manpage updates
The heat cli tool manpage had very little information,
this adds detail to the existing page and copies a version
of this page to cover the heat-boto version of the tool.

Change-Id: I5b64466878b719b49a9084f301b2c177ddef9a91
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-13 16:18:20 +01:00
Steven Hardy
c16b10255d heat engine : fix create_stack response format
create_stack response is broken now the StackId formatting
is done in the API, modify response format to fix.

Change-Id: I013bdb5ed992ce735905225cc4415fc0cfc5ce92
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-13 10:31:42 +01:00
Steven Hardy
0fc46d5134 heat API : Add missing StackId prefixes
Align event-list and resource-list-details with
other calls which add a AWS-style prefix to the
StackId response element

Change-Id: I0b1951068448d141e04ddca44f1d4188d3dff360
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-12 17:46:46 +01:00
Steven Hardy
5336c98651 heat engine : move StackId formatting into API
Move AWS specific StackId formatting into the API
Ref #172

Change-Id: I02f964b63c0489800300d8db92e1c800286c4bd3
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-12 17:37:37 +01:00
Steven Dake
581b0c6f6a Block on instance delete until delete operation completes
Fixes issue #160

During deletion of a stack, following would occur:
delete stack
delete instance
delete eip or security group

When the last operation occurred, the instance is still present in OpenStack
making a deletion of EIP or security groups not work properly.  Serialize
the operations in resources.

Change-Id: I6e1613f5a6f5db485dd8a5f381d7a96afb58188b
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-12 08:47:11 -07:00
Steven Hardy
a7d3879d7c heat engine : Store stack timeout in database
Store the TimeoutInMinutes common query parameter
value in the DB so it can be returned correctly
with show_stack/DescribeStacks
ref #125

Change-Id: I4ccc79b586087f61e415d5d2c24b7bd52844399a
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-12 14:03:12 +01:00
Jenkins
82138f48bd Merge "Update JEOS example in Getting Started" 2012-07-12 10:25:14 +00:00
Tomas Sedovic
4da17a9b8b Display better message on Keystone failure
Fixes #148

When there's something wrong with Keystone, Heat reported a rather cryptic
message. Now it indicates that the problem is with Keystone and passes
its response to the user.

Change-Id: I791b5bdfa68faa1b17daa67b911253d8bf8a2bb8
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-07-12 11:55:52 +02:00
Zane Bitter
8cbd065bf0 Speed up metadata server registration
If heat-engine and heat-metadata were started at approximately the same
time, such that heat-engine was not ready to receive the registration call
from heat-metadata on the first attempt, it would take a minute before the
next retry. Instead, start with a very short timeout (2s) and increase it
if the engine does not show up.

Fixes #159

Change-Id: Ie2efcce667f1dde9ae227a4bb19a1d6a2b7cf135
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 15:18:18 -04:00
Zane Bitter
e4eaca5d58 Fix the WordPress puppet template syntax
The template was not valid JSON due to an apparent copy-and-paste error.

Change-Id: I5fb4afe6597b2f469fb5219494feb745d083bf52
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:56:13 -04:00
Zane Bitter
8108c0aefb Optimise DB lookups by ID
SQLAlchemy caches objects in the database per-session, but cannot cache
queries. A query just generates a list of object primary keys, which is
then used to fetch the corresponding objects from the cache (if possible)
or database. Therefore a query which filters by primary key is a waste of
time, since it just returns (surprise!) the key we started off with. If we
have the primary key (in this case the id field), just look up the object.

Change-Id: I7123c12372b26c0e1b91b2496921c54d9d992cd8
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:54:36 -04:00
Zane Bitter
5737782c71 Raise the correct error when a stack is not found
Change-Id: Ia96d7b96f61e48d20ab080395365e770cf5bb1a8
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:52:46 -04:00
Zane Bitter
57a71eb07d Access Resource metadata through the new attribute
Get rid of all the other code that was accessing this directly from the
database and use only the Metadata descriptor.

Change-Id: I36a7a00878d0b65f58ba282ebad78f77b37c4d07
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:49:56 -04:00
Zane Bitter
139fe4009e Add a helper class for metadata
With this patch we can now access resource metadata through the 'metadata'
attribute and have it always fetch the latest data from the database. This
reduces the chance of accidentally accessing stale data (due to the
metadata being updated in a different database session via the metadata
server) by providing a single implementation to access it through.

Change-Id: Id411ae891d3eace746d16008a7d58bb19b4f652d
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:20:42 -04:00
Zane Bitter
7e9d745ee6 Add unit tests for metadata read/write in heat-engine API
Change-Id: I2b745a00a2110c794f6228976d3ed1cb9cf59d5f
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:19:25 -04:00
Zane Bitter
f74aef83bf Avoid unneccesary template parsing
Only parse the parts of the resource template that we need.

Change-Id: I4628e699452dc390848fc15197a5e04a3095399a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:17:33 -04:00
Zane Bitter
5aac736bb6 Allow partial template parsing
Make it possible to only parse the section we need when generating the
parsed template for a resource.

Change-Id: Ib4216d8d7bfdbca81f43690b6e8c53c15c71a232
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 11:14:31 -04:00
Zane Bitter
897ccca9ed Rename resource_id to resource_name in metadata API
This more accurately reflects what the parameter is, which is just the name
of the resource within the specified stack.

Change-Id: I6bc26c0046e0493c3b98c5753c04cc5a314678d7
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 10:13:03 -04:00
Zane Bitter
bd24e183c1 Report errors from nested stacks
If creation of a nested stack fails, we need to raise an exception so that
creation of the nested stack resource (and hence the enclosing stack) also
fails.

Change-Id: Ic5eda7f8d044ed2c87fc0e785b1cd8fcf78071a4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 10:13:03 -04:00
Zane Bitter
f5811fb4e9 Speed up engine manager unit tests
Refactor the engine manager unit tests so that they all use a single stack
that is only set up once. This makes the tests run a lot faster, and also
makes them easier to write. Both should encourage increased testing.

Change-Id: I50d2ffff393d4049459c5c30e408961681c189c7
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-11 10:01:58 -04:00
Jenkins
7e56619e41 Merge "Add DB refresh/expire on specific parameters" 2012-07-11 12:31:53 +00:00
Jenkins
ccab1c36dc Merge "Allow Status(Reason) access through Stack/Resource objects" 2012-07-11 12:27:04 +00:00
Tomas Sedovic
a82114f39b Update JEOS example in Getting Started
The heat-jeos usability branch has merged into master and the command
syntax for building new images is now a bit different.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
Change-Id: Ibd4e308fe6ef4d690b0408d59d8a9539a5c81f96
2012-07-11 12:44:34 +02:00
Steven Hardy
b96c15c96f heat cli : Align resource-list-details usage with other commands
Align resource-list-details usage with the other heat commands,
and provide better usage info on failure
Fixes #156

Change-Id: Id80b377151eca64e5f7dbfb436f5a5da5213c8b3
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-10 15:17:02 +01:00
Steven Hardy
dd94f3eba2 heat API: bugfix to XMLResponseSerializer
JSON wrapped in XML responses needs to be serialized
with json.dumps not str() or quotes get mangled and
json.loads fails to parse the result

Change-Id: I65c6ddf0be383e71bf8d05e7293b514269a27213
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-09 18:33:30 +01:00
Steven Hardy
3b7e0ae4c6 heat engine: raise appropriate error on bad stack name
Raise an AttributeError when called with a bad stack name,
this then maps to the appropriate HeatInvalidParameterValueError

Change-Id: Ic11142e95166ade380c2ad8741ed7063684214fb
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-09 18:33:30 +01:00
Zane Bitter
3100a898b5 Add DB refresh/expire on specific parameters
Previously we could only refresh or expire the entire object.

Change-Id: I2207349d6ffff435538a577943316cd13e7f1355
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-06 17:25:41 +02:00
Zane Bitter
84841e53fd Allow Status(Reason) access through Stack/Resource objects
It would be better not to have to go looking in the database for this
information, so cache it in the Stack/Resource objects themselves.

Change-Id: Id96fbd229898fecc8917a61f19480f70fc2135d9
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-06 17:04:35 +02:00
Zane Bitter
179bd1154f Rename test_resources to test_instance
Since that's what it's actually testing.

Change-Id: I03556778587e4b1b3a38bf755137eef08455e8f3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-06 17:03:39 +02:00
Steven Hardy
00cb384e8e heat API : Return auth errors in AWS format
Update EC2 authentication code to return HeatAPIException
subclasses, so the API error response on auth failure is
aligned with AWS responses.
ref #125

Change-Id: Iafa33e7aed4d77f2255b4d879192b9d15a2395aa
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-06 14:41:58 +01:00
Steven Hardy
637875f729 heat : heat-boto remove boto.cfg reading
Remove code directly reading boto.cfg, looks like the problem
with boto not reading the config file internally is fixed upstream

Signed-off-by: Steven Hardy <shardy@redhat.com>

Change-Id: I57e1d89d0fa83793d51d5cf6266c200d7abc7d57
2012-07-06 14:41:58 +01:00
Zane Bitter
8bf7353982 Separate out formatting for Engine API from manager
Change-Id: Ib5fc28bc6a3a2f1f3c0d291954e928d4fb036bbb
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-06 15:20:16 +02:00
Zane Bitter
eb2790cc99 Add new assertions about event unit tests
Change-Id: I5a7d4690fe752c053a08ecfdb4f0467026fdd245
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-07-06 15:15:26 +02:00
Angus Salkeld
4d79e24097 Add basic autoscaling.
This is mainly for ppetit so he can create multiple
resources with one stack.

Use like this:
heat create lots -f ./templates/ppetit.template --parameters="KeyName=${USER}_key;NumInstances=2"

Change-Id: Ie609a1843c855953d65183a8f2d8ed49254a265f
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-06 08:50:53 +00:00
Angus Salkeld
a0da17b39f Add NovaSchedulerHints and correct the implementation of Tags
Change-Id: Iaa7ea182414a8fc48a78f5aa6c2c3e1baddb4034
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-06 18:20:27 +10:00
Steven Hardy
fd83855600 heat tools : openstack script don't create duplicate pv's
Don't create duplicate loopback mounts if nova-volumes VG
already exists

Change-Id: I1c580f2915cd92709fbbf4033f77ec3c64e4952e
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-05 18:08:40 +01:00
Steven Hardy
ed71fe2908 heat tools : openstack script add restart option
Add option to restart openstack

Change-Id: I7578ff4cecae5351d5749272424d71b56071239d
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-05 18:08:40 +01:00
Steven Hardy
55d5713f19 heat tools : whitespace cleanup in tools/openstack
Convert mixed tabs/spaces to all spaces

Change-Id: I3c75ead59afad8a7edf24d8fc6c1c0484dbcd3eb
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-05 18:08:40 +01:00
Steven Hardy
80994c1f39 heat tests : Add missing headers to tests
Most of the tests lacked the apache licence boilerplate

Change-Id: I34ed0066a6f6751fc872f5286acfc7550319bc8f
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-05 18:08:40 +01:00
Steven Hardy
eb11660090 heat API : cleanup docstrings
Fix some API docstring formatting & content

Change-Id: Iad1646bb91ae501110ee20a5820ffc5c168bcc45
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-05 18:08:40 +01:00
Jenkins
5f812b65b7 Merge "Add more unit tests for the engine API" 2012-07-05 16:53:06 +00:00
Jenkins
767c41850f Merge "Pass Tags into scheduler_hints" 2012-07-05 14:18:35 +00:00