Steve Baker [Wed, 3 Jul 2013 03:21:23 +0000 (15:21 +1200)]
Define behaviour for properties with None values.
Now that Ref and Fn::GetAtt might return None values, behaviour for
properties with None values needs definition.
This change will treat a None value in the following way:
- if there is a default in the schema, that value will be used
- otherwise a default is used depending on the type ('', False, 0, [] {})
Steven Hardy [Tue, 2 Jul 2013 13:22:24 +0000 (14:22 +0100)]
add missing gettextutils imports
Several files use the "_" function, but don't import it from
gettextutils - this leads to a "NameError: name '_' is not
defined" error if you try to import/use the modules from an
interactive python shell or standalone test-code.
Steven Hardy [Tue, 2 Jul 2013 13:17:30 +0000 (14:17 +0100)]
engine : perform periodic tasks with stored stack_context
The metadata update needs to be performed with the stored stack_context,
not the admin_context, which contains no credentials to e.g authenticate
with nova
Steve Baker [Mon, 20 May 2013 22:01:16 +0000 (10:01 +1200)]
Rework associations from vpc to quantum resources.
Metadata cannot be used to store the relationships between VPC
resources and the underlying quantum resources, since this prevents
VPC or Subnet refs from being passed in as parameters.
This rework results in no state being stored in metadata. Route table
relationships are inferred from the template. An assumption is made that
the quantum router associatiated with the VPC will have the same name
as the quantum net. The easiest way of ensuring that is to creat the VPC
in a different Heat stack.
Steven Hardy [Mon, 1 Jul 2013 10:27:26 +0000 (11:27 +0100)]
tests : remove duplicate suspend tests
A previous patch erroneously introduced two copies of the same
tests, remove the stackServiceTest duplicates as they already
exist in the stackServiceSuspendResumeTest testcase.
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.
Steve Baker [Thu, 20 Jun 2013 02:17:20 +0000 (14:17 +1200)]
Expose resource dependency required_by to REST API.
Each resource can generate a list of names of resources which
require this resource as a direct (non transitive) dependency.
This information is returned in the list as well as the show REST calls
so that a diagram of the running stack can be built with a single
request.
Other uses of exposing this information is:
- template authors debugging their own template dependency issues
- integration tests validating template dependencies
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.
Robert Collins [Thu, 27 Jun 2013 10:10:51 +0000 (22:10 +1200)]
Fixup assert_has_keys.
This test helper had awkward code that didn't support users in
debugging tests, as it didn't report enough information. Additionally
some style issues were present, which I fixed up at the same time.
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 [Thu, 27 Jun 2013 01:39:30 +0000 (13:39 +1200)]
Ports depend on the subnets in the same network.
Without establishing this implicit dependency, the following
sometimes occurs:
- Ports get assigned to instances without any IP address
- Stack delete fails as ports still exist in subnets.
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.