When using DB2, Heat event record can not be inserted into table "Event", the root cause is that the ID column is supposed to be auto increasement but it is not. This column was set to auto increasement in 035_event_uuid_to_id.py with the statement:
event_table.c.tmp_id.alter(sqlalchemy.Integer, autoincrement=True)
For DB2, setting "ID" colume "autoincrement=True" can't make sense after above "tmp_id=>id" transformation,
so should work around it.
reproduce steps:
Using DB2 as heat database backend.
[root@control-node ~]# heat create wordpress1 --template-file=heat-templates/cfn/F17/getting_started.template --parameters="KeyName=root_key"
Will found it will try to insert null value to column 'id' in table 'event'.
Reviewed: https:/ /review. openstack. org/92073 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=a4336ae1ae3 cdade866da06a3e b435d02c7b12f2
Committed: https:/
Submitter: Jenkins
Branch: master
commit a4336ae1ae3cdad e866da06a3eb435 d02c7b12f2
Author: Chen Xiao <email address hidden>
Date: Mon Jun 16 18:36:08 2014 +0800
Fix DB2 column 'id' autoincrement issue
After installing heat against DB2, we can't insert data in table table.c. tmp_id. alter( Integer, autoincrement= True)" can't make sense after
event, the reason is that "event_
sqlalchemy.
above "tmp_id=>id" transformation, Now need work around it.
Change-Id: I50025fc5db87d4 58e660d42c773d7 99fc36f1b27
Closes-Bug: #1316041