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
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
Check the snapshot belongs to stack when deleting and showing
stack's snapshot, and restoring from snapshot.
Change-Id: I8ce170b40b05ae17669524d75f80e06e39986673
Closes-Bug: #1437602
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
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
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
explicitly
Change-Id: I22b0d62238298fa49da09c53019408bc2049b893
Closes-bug: #1439959
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
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
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
Prototype implementation of oslo.versionedobjects.
This patch adds WatchRule and WatchData object.
Implements: blueprint versioned-objects
Co-Authored-By: ShaoHe Feng <shaohe.feng@intel.com>
Co-Authored-By: He Jie Xu <hejie.xu@intel.com>
Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>
Change-Id: I29fc0fc99c0c425291246dc3889393cbcc0b82cf
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 <asalkeld@mirantis.com>
Co-Authored-By: Qiming Teng <tengqim@cn.ibm.com>
Change-Id: I65e1032e84b40cb7ae3126fa6b63c914988cc970
Implements: blueprint convergence-resource-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
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
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 https://review.openstack.org/#/c/156693/
Change-Id: Idf7adc9d01425592ec174c373b1b03626c3a0a1d
Closes-bug: #1415237
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 <asalkeld@mirantis.com>
Co-Authored-by: Kanagaraj Manickam <kanagaraj.manickam@hp.com>
Change-Id: Ib776f651be0beccdc05b9973f152e2ff901970df
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 <asalkeld@mirantis.com>
Change-Id: I95d84f00cc4acae8ff9af39935e6cc316318ae71
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
again.
Implements: blueprint convergence-stack-data
Change-Id: I5f7482b94d76d937f03772596873c46bd536ac4f
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 <visnusaran.murugan@hp.com>
Change-Id: I229907dc2cab618ca5c76a72956ce8c5f49a2127
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
This change adds indexes to the name and tenant columns of the stack
table, to improve query performance.
Change-Id: I0c675bda1b27814c4a7e9fce6c78af48266b5258
Closes-Bug: #1421885
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
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
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
"DocImpact"
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
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