Steven Hardy [Fri, 28 Jun 2013 10:15:40 +0000 (11:15 +0100)]
api : Add actions resume support
Add support for resume action using a similar interface to that provided
by nova for the admin actions extension. So a body of {'resume': None}
will suspend the stack, see http://api.openstack.org/api-ref.html
Liang Chen [Sat, 29 Jun 2013 13:45:43 +0000 (21:45 +0800)]
destroy failed instances created by auto scaling
The ResourceFailure exception was silently eaten when raise_on_error
set to False. This patch handles the ResourceFailure exception locally
when raise_on_error set to False - called from ScalingPolicy alarm
(i.e. runtime adjustment). So users will not be charged for orphaned
instances. But they can still see what happened through event list.
Steven Hardy [Fri, 28 Jun 2013 15:43:41 +0000 (16:43 +0100)]
engine : simplify resource state check
Simplify the test to check the resource is in a COMPLETE state
(other than DELETE_COMPLETE), so we don't have to update this for
every new action state which gets added
The default behavior in _do_action is to declare COMPLETE if the
check_$action_complete is not implemented, so these default
functions returning True are not needed.
Patrick Woods [Thu, 27 Jun 2013 19:44:54 +0000 (14:44 -0500)]
Fixup handle_create backup restore.
The handle_create did not retrieve the volume_id
correctly and the check_create_complete
needs to handle the restoring-backup status.
Also modify and add support for restoring-backup
status test cases for success and error.
The additional FakeVolumeFromBackup will force
the inital status to be checked by the method
check_create_complete in volume.py.
Liang Chen [Fri, 28 Jun 2013 14:27:59 +0000 (22:27 +0800)]
add GET /{tenant_id}/stacks/detail to Heat API
Enables the building of a useful dashboard interface for Heat stacks
without looping through stacks returned from "/{tenant_id}/stacks/"
to fetch the detailed data.
Steven Hardy [Thu, 27 Jun 2013 15:20:56 +0000 (16:20 +0100)]
autoscaling : Fix issue when scaling to zero instances
As noted in https://review.openstack.org/#/c/34564, we lack
coverage of the scenario when MinSize is 0 and we scale down
to zero instances then try to do a delete. We do the wrong
thing here, by creating a GroupedInstance object with name '',
and this would also result in an incorrect update to the
LoadBalancer. Fix is to reset the resource_id to None.
Steve Baker [Tue, 21 May 2013 01:21:11 +0000 (13:21 +1200)]
Add dependency between RouterGateway and RouterInterface
When a template has a RouterGateway and a RouterInterface with the
same router_id, there is an implicit dependency on delete where
the gateway must be deleted before the interface.
This is implemented by overiding add_dependencies in RouterGateway
and looking in the stack for RouterInterface resource to depend on.
Steven Hardy [Fri, 10 May 2013 17:29:04 +0000 (18:29 +0100)]
api : Add ReST actions POST method
Initial support for an actions subpath, which will be the access-point
for non-lifecycle operations on stacks, e.g suspend/resume
This adds support for a POST method for /actions subpath, so that requests for
specific actions may be made, using a similar interface to that provided by
nova for the admin actions extension. So a body of {'suspend': None}
will suspend the stack, see http://api.openstack.org/api-ref.html
Steven Hardy [Wed, 26 Jun 2013 11:27:05 +0000 (12:27 +0100)]
engine : stack_resource change state_description to status_reason
The internal API changed this name recently, but this got missed
due to lack of test coverage for this exception. Turns out adding
that test coverage is really hard due to all the coroutine magic,
so we'll have to fix that at some later time.
If nova returns an error looking up images during stack validation, we
return a StackValidationFailed, but we should probably catch
this and return ServerError instead, since this is really an internal
error not a validation failure.
Thomas Spatzier [Mon, 17 Jun 2013 11:50:52 +0000 (13:50 +0200)]
Changes for HOT hello world template processing
This patch contains the base enabling code required for processing a most
simple HOT template ("hot hello world"), so that the template can be
parsed and a stack with a single instance can be deployed.
Steven Hardy [Tue, 25 Jun 2013 08:49:34 +0000 (09:49 +0100)]
OS::Quantum::Subnet resource, add enable_dhcp
Add enable_dhcp to the properties schema, since quantumclient
code indicates this is allowed in the body (not only expected
in the response as currently indicated by the docs)
Steve Baker [Mon, 24 Jun 2013 03:21:43 +0000 (15:21 +1200)]
Store created nova client in OpenStackClients.
All created clients are stored in the instance of OpenStackClients
which is associated with a stack - this prevents clients from
being repeatedly created throughout the request.
Commit f3fc5c5 introduced a regression which stopped storing the
nova client. This change addresses that regression.
Steve Baker [Thu, 20 Jun 2013 22:18:37 +0000 (10:18 +1200)]
Do not refresh timestamp from database on read.
Doing a database refresh on timestamp read is causing errors
such as:
heat.openstack.common.rpc.amqp InvalidRequestError:
Could not refresh instance '<Stack at 0x2c95a90>'
This has only been seen using postgres, possibly because the problem is
being masked on mysql due to the driver's lack of concurrency.
The database refresh seems to be unnecessary, as there appears to be
no logic which depends on timestamps being accurate (nor is there
any timestamp comparison logic at all)
Andrew Plunk [Thu, 20 Jun 2013 15:02:37 +0000 (10:02 -0500)]
Unrestricted username length causing error.
When we tried to create a username in keystone with
a length > 64 characters, an error was being raised.
Only use the first 64 characters of the dynamically
generated name in this case.
Steven Hardy [Wed, 19 Jun 2013 13:27:00 +0000 (14:27 +0100)]
Fix BaseException.message DeprecationWarning
https://review.openstack.org/#/c/32154/ introduces a deprecated
TypeError.message reference, which won't work in python3 and
causes a DeprecationWarning to be output on >= python 2.6
Randall Burt [Thu, 13 Jun 2013 17:58:29 +0000 (12:58 -0500)]
Implement attribute schema for resources
Similar to properties, adds attribute_schema and attributes members to
Resources in order to facilitate document generation and template
provider stubs for resources.