Commit Graph

32 Commits (4a500125b350b46dee0d3c9f01c3cac7223d9c80)

Author SHA1 Message Date
Thomas Herve 34f6ff920e Cleanup service usage
oslo_service Service usage in the engine was slightly wrong: we
inherited from the base class without using its threadgroup, and we also
inherited from it in utility classes that were not real services. This
cleans up those.

Change-Id: I0f902afb2b4fb03c579d071f9b502e3108aa460a
7 years ago
huangtianhua 62f6045f2a Return condition functions based on the filter param
Add 'with_condition_func' filter param for API
template-function-list, if the param set to true,
the response will include the condition functions.

Change-Id: Icdfbafbb98698373648ff2d78db3c45fe2b924ee
Closes-Bug: #1625505
7 years ago
Jenkins 39f43109e0 Merge "Move merge_environment to environment_util module" 7 years ago
rabi 59b2a559ec Move merge_environment to environment_util module
This moves the merge_environment utility function
from to

Change-Id: Ia005cf47d5e655e60359f8da397a712e749ce13c
Blueprint: environment-merging
7 years ago
Oleksii Chuprykov 68944d2230 Migrate stacks from legacy to convergence engine
Run `heat-manage migrate-convergence-1 <stack_id>` to migrate
legacy stack to convergence engine.

Heat engine is used for doing migration i.e. migration can't
be done offline.

Change-Id: Ie7c2498b37937438f16d154b154b3a6ecbf9ff74
Implements-bp: convergence-migrate-stack
7 years ago
rabi 1f88c675c4 Remove tenant_safe flag from rpc and db api
We can use admin_context to have access to stacks
and software configs across projects. This removes
the tenant_safe flag from rpc and db api. This is
backward compatible with older rpc clients.

We still support use of global_tenant flag for listing
stacks and software configs. However, by default
an admin(user with admin role in admin_project)
would not need that.

Change-Id: I12303dbf30fb80290f95baba0c67cdf684f5f409
7 years ago
Steven Hardy 316b5b6381 Add stack files retrieval API
Similar to the recent addition that enables retrieval of the current
environment for a stack, this enables reading the current files map
for a running stack, which is useful if you want to introspect the
current state, and/or deploy another similar stack without necessarily
having the exact command/repo used initially.

Implements: blueprint files-show

Change-Id: I3198b6a7dc06648af24c198d39470f3b0d5d6f11
7 years ago
Steve Baker 32ade7a243 Implement event list nested-depth
The GET call to list events will support a nested_depth parameter. The
response will have an additional links url with the ref 'root_stack'
to indicate that this API supports nested_depth queries.

This has the following consequences for old/new combinations of
- new heatclient, new server - nested_depth param is set, server
  returns nested events
- new heatclient, old server - nested_depth param is set, server
  returns events with no root_stack, heatclient falls back to
  recursive event fetch
- old heatclient, new server - nested_depth param is never set,
  recursive event fetch works as before

Here are some timings for a TripleO overcloud stack with ~700 events.

Current heat and python-heatclient master:
time openstack stack event list --nested-depth 4 overcloud |wc -l
real    0m17.500s

This change, with heatclient 31278ff5f77b152b5ef7a4197e15c441c72ff163:
time openstack stack event list --nested-depth 4 overcloud  |wc -l
real    0m1.725s

The difference in event count (744 vs 608) is due to the stack events
being filtered out for stacks with zero resources - these are a source
of unnecessary noise so their removal should be considered an improvement.

Closes-Bug: #1588561

Change-Id: I27e1ffb770e00a7f929c081b2a505e2007f5d584
7 years ago
Rabi Mishra ef4cf621fb Move some functions to service_utils
This moves some utility functions to service_utils
from stack_lock.

Change-Id: Iebc39a7f7b15dd5eea4be3cd3fdaea22607dd72e
7 years ago
Peter Razumovsky 42bfc8a282 Add to resource-type-list returning description
Add to resource-type-list command ability to return
resource description.


Change-Id: Ia92699e5ca60a891e9704c468e447e1053be7609
Closes-bug: #1558049
7 years ago
Zane Bitter 9a650a5e2f RPC API: Add a template_id parameter to stack_create/update
This allows us to pre-store a template in the database before
creating/updating a stack over RPC, so that we don't need to send the
contents over RPC. This will help us safely de-duplicate files dicts in
the database, reduce the size of messages, and prevent unnecessary
copies of files (in particular) being loaded into memory.

Change-Id: Id1990d5cbac8b3954ce224af73425d4fd8db17d6
7 years ago
Jay Dobies b0ca694dd7 Add environment retrieval API
Adds a call to the REST API to retrieve the environment for a running

Implements: blueprint environment-show

Change-Id: I7e3577dfc854018245d79afdfee45a9d250d73a7
7 years ago
Thomas Herve a709637a17 Replace SD RPC polling by long RPC call
This changes the way SoftwareDeployment updates its internal status.
Instead of querying the deployment status in a loop using RPC client, it
makes a single call, which returns once the status has been updated.

Closes-Bug: #1549219
Change-Id: I484b7c8cb4a4e71817be6bea764f23b68a39b2d4
7 years ago
Ahmed Elkhouly f52d77f0d2 Resource mark unhealthy RPC and ReST API
There may exist resources that the user (or application) knows are
unhealthy where Heat has no way of determining that.

Add a PATCH handler to the Resource endpoint::


The PATCH method will accept a JSON body of the form::

    'mark_unhealthy': <bool>,
    'resource_status_reason': <string>

This patch Implements:
- RPC API to mark resources as CHECK_FAILED in both the legacy and
convergence architectures in heat-engine
- ReST front end to the RPC API call in heat-api

Change-Id: Ifa48b179723a2100fff548467db9e162bc669d13
Partially-implements: blueprint mark-unhealthy
7 years ago
Jenkins f76d04bf0e Merge "Hook into environment merging on server" 7 years ago
Jenkins 471a34b2ba Merge "Stack resource search" 7 years ago
Kanagaraj Manickam 6c4709696b Stack resource search
heat resource-list -f <filters>

imlements blueprint heat-stack-resource-search


Change-Id: Iaae88f3b32bc2ba7b41a4078ef3aa8ffc07079b7
7 years ago
Jay Dobies d454caf00a Hook into environment merging on server
If environment_files is specified, look in the files dict for each
specified environment file and merge into the stack's environment. This
is the same workflow that previously occurred client-side.

Change-Id: Ibe46fd35de7988920c101a83259c06c8f8a3ed0b
Implements: blueprint multi-environments
7 years ago
Jenkins 14f3bb75a3 Merge "Set DB max_overflow to match thread pool size" 7 years ago
Kanagaraj Manickam 29e5d96d50 Adds ignore_errors for template_validate in engine
It enhance the validate_template to ignore the given
set of errors while the template is validated.

implements blueprint heat-template-validate-improvements

Change-Id: Id6d85664ae576b6a5d18dbbe84ddf0122fbfaa40
7 years ago
Jay Dobies c2d8a15b24 Add environment_files to REST and RPC APIs
Adds an optional list of environment files that can be specified instead
of resolving multiple environments client-side. This change covers both
the REST API changes and the internal RPC API changes.

Implements: blueprint multi-environments
Change-Id: I45fb9d4480f6ab4e5fe30cb2e3b62a03777484c7
7 years ago
Thomas Herve b3a56659ee Provide software deployment id on create
There is currently a race condition where software deployment populates
its metadata when being created, before the parent resource receives an
ID. This creates a window where the metadata is available but the
resource can't be signalled. This fixes it by providing the creation ID.

Change-Id: If58679138db95cf1da7ab5a4906217da446a391f
Closes-Bug: #1532445
7 years ago
Anant Patil d7c2de60cb Set DB max_overflow to match thread pool size
Set max_overflow config option of database to match the number of
workers that can be spawned simultaneously. The maximum number of RPC
workers that can be spawned is determined by executor_thread_pool_size
config option.

This ensures there won't be lack of DB sessions when many worker
threads/eventlets are spawned when the engine is under load.

The DB connections that are part of overflow bucket are closed
automatically when they are not in use, so heat doesn't run out of
'lsof' limit.

Closes-Bug: #1491185
Change-Id: I4fcfe50b53b4d476f7483bb860667c42d0c54a19
7 years ago
Oleksii Chuprykov c8818c864f Add resolve_outputs parameter to stacks API
Add resolve_outputs parameter to stack_show. It allows user
to get stack data without resolving outputs. It is needed because
of 2 reasons:
1) We have output_show an output_list already in our API
2) Such resolving can consume a huge amount of time, but user may
want to resolve only several or none outputs.

@APIImpact, @DOCImpact

Change-Id: I03104efc535a7bd4326cbec56c01cd887db38ab6
8 years ago
Jenkins 63cebcb0ea Merge "Add APIs implementation for output functions" 8 years ago
dixiaoli 906d35c775 datetime.datetime.utcnow() should be replaced
timeutils.utcnow() should be used instead of
or datetime.datetime.utcnow()
This patch unifies it.
Closes-Bug: #1514748

Change-Id: Icb73746905612661cbda03e679fbfddd80bb6cc2
8 years ago
Peter Razumovsky 2e76bb0716 Add APIs implementation for output functions

Add new APIs for showing and listing stack outputs.
It can be used by heat client and separately for
getting stack outputs.

implements bp api-call-output

Change-Id: Ia24b24f59e2c592801e4e670ba5510f642ecf45c
8 years ago
Steven Hardy 506919fcf6 Allow nested validation for template-validate
Adds an optional flag that causes template-validate to recursively
validate nested stacks and expose a schema of the parameters for
all stacks in the tree.  This uses a similar method to stack preview
in that it builds the tree in memory so we can then walk it and
extract the parameter data we need.

Change-Id: I7e3d752124997a0a7b8ff53e774ed8034dd2f81d
Co-Authored-By: Jay Dobies <>
Implements-blueprint: nested-validation
8 years ago
Steven Hardy 99670fb1cc Wire in files to template validate
heatclient already supplies the files map, as for create/update
but the API and RPC interfaces ignore it.  So wire in the optional
files map, which will enable moving to validation logic which
more closely aligns with the create/update code.

Change-Id: I32a4b8d8c02829398f4792fcb06783ce9233b645
Co-Authored-By: Jay Dobies <>
Partial-Bug: 1467573
8 years ago
Kanagaraj Manickam fdd163b289 Updates resource type filtering with name, version
Adds name and version parameters to the resource type

implements blueprint heat-resource-type-search


Change-Id: I7500d5c56ce252bf8c0a9ae7a188a8cb25e643ce
8 years ago
Ryan Brown 6513d3944c Add a preview endpoint for stack updates
Allow users to see what resources will be changed during a stack-update.

Docs change here

Client change here

BP: update-dry-run

Co-Authored-By: Jason Dunsmore <>
Change-Id: If58bdcccfef6f5d36c0367c5267f95014232015e
8 years ago
tengqm e8a777fd1a Split engine service test cases (8)
This patch splits the stack watch related unit tests into a separate
module. Some mox calls are replaced with mock calls where approriate.

It also moves the existing modules related to engine service tests
into a separate subdirectory. This is to make room for other unit
tests that are coming in.

Change-Id: I7ea61c22e017785c480d78d6c07132164ed0b889
8 years ago