Comment 7 for bug 1233861

Revision history for this message
In , Dan (dan-redhat-bugs) wrote :

Description of problem:
When upgrading from RHOS 2.1 to 3.0 (I'm using RDO) the cinder db migrate fails to add a new table.

Version-Release number of selected component (if applicable):
upgrade from 2.1 to 3.0

How reproducible:
evertime

Steps to Reproduce:
1. start with a working copy of 2.1
2. stop cinder services
3. yum update
4. update config files so you're using the new config files with the existing ips and users and passwords etc.
5. start services and do an cinder-manage db migrate.

Actual results:
OperationalError: (OperationalError) (1005, "Can't create table 'cinder.volume_glance_metadata' (errno: 150)") '\nCREATE TABLE volume_glance_metadata (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tdeleted_at DATETIME, \n\tdeleted BOOL, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tvolume_id VARCHAR(36), \n\tsnapshot_id VARCHAR(36), \n\t`key` VARCHAR(255), \n\tvalue TEXT, \n\tPRIMARY KEY (id), \n\tCHECK (deleted IN (0, 1)), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id), \n\tFOREIGN KEY(snapshot_id) REFERENCES snapshots (id)\n)ENGINE=InnoDB\n\n' ()
notice: /Stage[main]/Cinder::Api/Exec[cinder-manage db_sync]/returns: 2013-05-08 06:09:54 CRITICAL [cinder] (OperationalError) (1005, "Can't create table 'cinder.volume_glance_metadata' (errno: 150)") '\nCREATE TABLE volume_glance_metadata (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tdeleted_at DATETIME, \n\tdeleted BOOL, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tvolume_id VARCHAR(36), \n\tsnapshot_id VARCHAR(36), \n\t`key` VARCHAR(255), \n\tvalue TEXT, \n\tPRIMARY KEY (id), \n\tCHECK (deleted IN (0, 1)), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id), \n\tFOREIGN KEY(snapshot_id) REFERENCES snapshots (id)\n)ENGINE=InnoDB\n\n' ()

Expected results:
new table created

Additional info:
http://stackoverflow.com/questions/1457305/mysql-creating-tables-with-foreign-keys-giving-errno-150
suggests the relationships are a good starting point for a solution