Commit Graph

378 Commits (bbf29137282769f6c96123fe92babe41ea64e625)

Author SHA1 Message Date
Steve Baker 71a1e26140 Find root stack ID with database operations
This change adds a (currently unused) database function
stack_get_root_id to find the root stack ID for any stack.

Scheduler hints are moved to using Stack.root_stack_id() in this change.
Remaining uses of Stack.root_stack() will switch to using
Stack.root_stack_id() later in the series.

Change-Id: I9914b0df5af119edea6346db0d7c62124fbb1313
Partial-Bug: #1455589
8 years ago
Jenkins 9f9ecf4f3b Merge "Use six.text_type and six.reraise" 8 years ago
Jenkins 23e10121b0 Merge "Do not filter stacks if tags is empty list" 8 years ago
Jenkins b5f080e35e Merge "Change instances of to next(x)" 8 years ago
Sergey Kraynev bf36f88fad Do not filter stacks if tags is empty list
Change-Id: I3dd55881800ef45605e4c2c77d06a2c5fe2b0ee4
Closes-Bug: #1446044
8 years ago
Sirushti Murugesan 796680c9c7 Use six.text_type and six.reraise
partial blueprint heat-python34-support

Change-Id: Idce66792a43368c78002683cf8cf1d8759729658
8 years ago
Sirushti Murugesan 8d3f96929a Change instances of to next(x)
partial blueprint heat-python34-support

Change-Id: Idf74dd430782ee3df90c6bb88432084187e0c089
8 years ago
Tetiana Lashchova ebdb3edd78 Remove downgrade functions
After commit I72421259deb9f28501b9d5ca4b9ccc43a8da7831
downgrade functions became unsupported and according to
cross project spec[1] should be removed.


Implements bp no-downward-sql-migrations

Change-Id: I2e8fda23650c24501e3ba33da2d2e16ca4bc70be
8 years ago
Jenkins ecccf66f7e Merge "Add ability to filter stacks by tag" 8 years ago
Tetiana Lashchova dd34e7fb68 Deny to migrate to lower schema version
Deny migrating to lower version and remove downgrades testing
relying on

Change-Id: I72421259deb9f28501b9d5ca4b9ccc43a8da7831
8 years ago
Jason Dunsmore 3c30bf8727 Add ability to filter stacks by tag
blueprint stack-tags

Change-Id: I4b5bc741fc271cb08ec588ae962573c59286dae5
8 years ago
Jenkins 4e03faa7f4 Merge "Persist parent_resource_name and make sure it's available" 8 years ago
Ethan Lynn 7b25a9d647 Fix sqlalchemy migration script 061 for DB2 backend
DB2 doesn't support alter column type from string to text,
need to add a new column and copy data from old column, and
later remove the old column.

Closes-Bug: #1443252
Change-Id: I7b3edf6bf7ea0efaf96398a83dad9ebe61caaa23
8 years ago
huangtianhua af6b0db444 Make sure snapshot belongs to stack for actions
Check the snapshot belongs to stack when deleting and showing
stack's snapshot, and restoring from snapshot.

Change-Id: I8ce170b40b05ae17669524d75f80e06e39986673
Closes-Bug: #1437602
8 years ago
Angus Salkeld edf86aeac2 Persist parent_resource_name and make sure it's available
We are persisting for a number of reasons:
- so we don't have to pass this through ever rpc call
- the API exposes parent_resource (currently always None as
  it is not persisted)

Closes-bug: #1438978
Change-Id: Id2db36c0234a085ec4f0ce2ab114ec483ea29d81
8 years ago
Jason Dunsmore d4361580ba Add ability to hide stacks based on tag
Add a "hidden_stack_tags" option that contains a list of tag names.
Stacks that have one or more of these tags will be hidden.

Add an option to show hidden stacks in the stack listing.

blueprint stack-tags

Change-Id: I45a5ac6d73a9a61629a56f88270e3a97fafb378a
8 years ago
Jason Dunsmore 9817ed77ef Database API and engine changes for stack tags
Allow tagging of stacks with simple string tags.

blueprint stack-tags

Change-Id: I65e1e8e87515595edae332c2ff7e0e82ded409ce
8 years ago
Kanagaraj Manickam 1dbb1ed98f Cleans nullable=True in db model column declaration
By default sqlalchemy considers the Column's nullable=True and
this patch cleans those column declaration which is having
default value for the nullable field as it is not required

Change-Id: I22b0d62238298fa49da09c53019408bc2049b893
Closes-bug: #1439959
8 years ago
Ethan Lynn 6bc753582b Set stack status to FAILED when engine is down
When stack is in status IN_PROGRESS and engine service went down,
the status of stack will forever remain in IN_PROGRESS. This patch
add a db apid to get engine_id from stacklock and try to reset the
stack status to FAILED when engine is back.

Closes-Bug: #1382320
Change-Id: Ica856bb0d56c23a4423fb9476c1986aaacf24108
8 years ago
Randall Burt 9b559905dd Ignore migrating environments for deleted stacks
Change-Id: I50b7a0f309922aa3c6ef63b9d27282e2adae4a6e
Closes-Bug: 1432795
8 years ago
Jenkins 1eae9e6019 Merge "Fixes migrate_data utils to avoid created_at filed" 8 years ago
Kanagaraj Manickam 3d86095b76 Fixes migrate_data utils to avoid created_at filed
migrate_data utils does not migrate table data if
table does not have column created_at field. It
fixes this issue.

Change-Id: Id179b295d8f0e0644420fb589baa5341d3020c7f
Closes-bug: #1439094
8 years ago
Kanagaraj Manickam 35f964cae4 Updates migrate_repo README
sqlalchemy migrate utility is being maintained by
Openstack Stackforge project, which was maintained
by google earlier. So the README is updated with
Stackforge project url.

Change-Id: I824d2ede84da8dd8a1488c0ca5e3ee0a71fb7810
Closes-bug: #1439023
8 years ago
Angus Salkeld 60fe406394 Make the status_reason field Text instead of String(255)
Change-Id: I8eaaa7bc55afff16d16bbd9d41b5522f02f83071
Closes-bug: 1434290
8 years ago
yuntongjin 4dd2a188f1 Versioned object - WatchRule and WatchData
Prototype implementation of oslo.versionedobjects.
This patch adds WatchRule and WatchData object.

Implements: blueprint versioned-objects

Co-Authored-By: ShaoHe Feng <>
Co-Authored-By: He Jie Xu <>
Co-Authored-By: Grzegorz Grasza <>

Change-Id: I29fc0fc99c0c425291246dc3889393cbcc0b82cf
8 years ago
Sergey Kraynev 2c21d660b3 Add extra columns for resource table
This patch adds following columns for resource table:
- `needed_by` (a list of Resource keys)
- `requires` (a list of Resource keys)
- `replaces` (a single Resource key, Null by default)
- `replaced_by` (a single Resource key, Null by default)
- `current_template_id` (a single RawTemplate key)

Co-Authored-by: Angus Salkeld <>
Co-Authored-By: Qiming Teng <>
Change-Id: I65e1032e84b40cb7ae3126fa6b63c914988cc970
Implements: blueprint convergence-resource-table
8 years ago
Rakesh H S 8c04ccb017 Convergence sync_point table
Introduces sync_point table to heat DB.
sync_point table will be used to store a record of the dependencies
that have been satisfied, and the cached get_resource and get_attr
data they supplied.

blueprint convergence-graph-progress
Change-Id: I29c838ee651212af0f8a0f0169e591f4780544fd
8 years ago
Jenkins ecdc6e5543 Merge "DB changes for resource locking" 8 years ago
Kanagaraj Manickam e66d257c24 Adds migration test case for version 056
Adds migration pre-setup and post-check test case
for the version 056

Change-Id: Ibe5b40eac093525d47f99910e634757cb00cd77c
Closes-bug: #1430743
8 years ago
Ethan Lynn d005f2db6c Fix db migration script 057 failure on db2
Add a if condition before drop foreign key constraint.

Closes-Bug: #1431250
Change-Id: Idc3afeb8739a608ae618c605eb730a4eb3e3da84
8 years ago
ishant c0314eded3 DB changes for resource locking
This patch adds engine_id and atomic_key column to the resource
table for locking the resource and making all operations atomic.
Also added the db api to update the resource table.

The engine which updates the db first, gets the lock on the
resource. Only updates with this engine are possible. Updates with
other engine will not go through as they will fail to find the
matching record in the db.

Change-Id: Id8c3df7a439347652d3feca7481cd72762bf30ea
Implements: blueprint convergence-resource-locking
8 years ago
Angus Salkeld eb8c81f8db Create an integer id for the resource table
Move the old uuid "id" to a new column "uuid". The migration
script is largely copied from the event_uuid_to_id script.

This is needed for

Change-Id: Idf7adc9d01425592ec174c373b1b03626c3a0a1d
Closes-bug: #1415237
8 years ago
Anant Patil bb5fec7725 Store template + environment for rollback.
In order to allow the user to roll back to a previous state, we need to
store both the old template and the old environment.

Moved the parameter column from 'stack' table to 'raw_template' table
and renamed it to environment.

Implements: blueprint convergence-parameter-storage
Co-Authored-by: Angus Salkeld <>
Co-Authored-by: Kanagaraj Manickam <>

Change-Id: Ib776f651be0beccdc05b9973f152e2ff901970df
8 years ago
Kanagaraj Manickam b44a651c74 Sqlite migrate_data() utility method
Sqlite db migration scripts are updated to use common
method migrate_data() to migrate data from old table
to new table.

Co-Authored-by: Angus Salkeld <>
Change-Id: I95d84f00cc4acae8ff9af39935e6cc316318ae71
8 years ago
Anant Patil 77643ac700 Add extra data to Stack table for Convergence.
The convergence design requires extra data to be stored with each Stack
row in order to manage concurrent updates.

In the update query for updating the stack, session synchronization
is set to False to avoid error causing due to status_reason column
inherited in Stack table from the StateAware table. Updates to
status_reason column is handled via @property and this causes problems
due to the fact that the UPDATE...WHERE updates it in DB but fails to
correctly evaluate the sqlalchemy object directly. The evaluation fails
with "KeyError" on status_reason column. By setting synchronization off
and by expiring the session, we enforce status_reason to be read from DB

Implements: blueprint convergence-stack-data

Change-Id: I5f7482b94d76d937f03772596873c46bd536ac4f
8 years ago
Angus Salkeld ac536c6114 Convert all non-test imports of json to jsonutils
As requested in:

Change-Id: Icea97aa44d2a3461fdfa2324292fd3b2c2f000e1
8 years ago
Anant Patil dcefecbfc9 Utility for database migration.
The DB migration often needs to clone a table into a new one as
databases like sqlite do not support most of the ALTER commands for
in-place modification of table schema. This utility has method to clone
a table to new one so that a new table can be created and data migrated
to it for handling migration. This is fairly generic, therefore new file
is added.

New generic functions can be added here when needed.

Co-Authored-By: Visnusaran Murugan <>

Change-Id: I229907dc2cab618ca5c76a72956ce8c5f49a2127
8 years ago
Jason Dunsmore b4cd30cb35 Add stack_tag table and remove stack.tags column
Storing the stack tags in their own table is necessary to allow stack
filtering at the database level.  The stack.tags database column was
unused, so it can be removed without a script to migrate data.

blueprint stack-tags

Change-Id: I5a7e3a30f87b5cc5a60d43ed9efde4ec5bfba9f2
8 years ago
Jenkins 1a459d4097 Merge "Make import of oslo libraries namespaceless" 8 years ago
Miguel Grinberg 132797aef5 Add name and tenant indexes to stack table
This change adds indexes to the name and tenant columns of the stack
table, to improve query performance.

Change-Id: I0c675bda1b27814c4a7e9fce6c78af48266b5258
Closes-Bug: #1421885
8 years ago
Jens Rosenboom a99fe6a760 Make import of oslo libraries namespaceless

Closes-Bug: 1423174
Change-Id: I48680ce6e7ce91005c147ab4388203946171d433
8 years ago
Jenkins 202943e42e Merge "Manage deployment updated_at values" 8 years ago
Peter Razumovsky 6ec2759324 Add a config option to enable Convergence
This patch adds column 'convergence' to stack table
and configuration option 'convergence_engine'. If
'convergence_engine' equals True, new stacks are created,
updated and backuped with convergence column equals
True and old stacks are updated and backuped with
convergence column equals False. Otherwise convergence
column equals False.

blueprint convergence-config-option

Change-Id: I34d6fa3a0e387140914f5060c06be890640a970f
8 years ago
Steve Baker 66bc4953c3 Manage deployment updated_at values
This adds an updated_at argument for RPC calls to
update_software_deployment, which will be useful for
Partial-Blueprint: software-config-trigger

Change-Id: I2c00a68e13c7d96b3d63ccbd34c27986a6bccfc9
8 years ago
Kanagaraj Manickam 65134b8d99 heat-manage service list
Adds required REST API, Db model and engine service
changes for reporting the heat engine service status.

Change-Id: I3ef29c1efd2015d62eec1033ed3a8c9f42e7a6e2
Implements: blueprint heat-manage-service-list
8 years ago
Steven Hardy 1a3adcdcb1 Store auth_url and region_name when trusts are enabled
We don't currently store auth_url, which causes problems when creating
autoscaling groups containing servers configured for software config,
because we use context.auth_url to populate the auth_url in the server
metadata, which is needed by the deployments for signalling.

Also adding region_name, as this seems likely to be needed for correct
operation in a multi-region environment.

Closes-Bug: #1415901
Change-Id: I550d03ea1b6985ba0777bf5ca52c79a8e8e60f5a
8 years ago
Visnusaran Murugan d69408e18a RowProxy replaced with update query to set db attributes
Read-only RowProxy used to alter template data. Error
not caught for lack of _pre_upgrade and _check validation.
Using an update query to alter attributes and also
adding validation scripts for 037, 041 and 043 database
migration scripts.

Change-Id: Ie3f122ed155ebb6aaa5007918cd9e121371749e4
Closes-Bug: #1396313
8 years ago
Jenkins 30f7afb4e0 Merge "Enable H904 style checking rule" 8 years ago
Jenkins f690f8d599 Merge "Add "tags" column to stack table" 8 years ago
Jason Dunsmore 378660d4c4 Add "tags" column to stack table
blueprint stack-tags

Change-Id: Id21cf34fc729aed1e7dc6c10ef3afef1a7d45e73
8 years ago