If you messed up the database during the upgrade from Kilo to Liberty following the workaround of bug 1511466 (comments #3 and #9) you can use this python script to fix your database:
import MySQLdb
conn = MySQLdb.connect(host = '127.0.0.1', user = 'nova', passwd = 'my-secret-pw', db = 'nova')
cursor = conn.cursor()
cursor.execute("select instance_uuid from instance_extra;")
instance_extra_t = cursor.fetchall()
cursor.execute("select uuid from instances;")
instances_t = cursor.fetchall()
todelete_list = []
for extra in instance_extra_t:
if extra not in instances_t: todelete_list.append(extra)
for uuid in todelete_list:
cmd = "delete from instance_extra where instance_uuid='%s';" % uuid
result = cursor.execute(cmd)
conn.commit()
If you messed up the database during the upgrade from Kilo to Liberty following the workaround of bug 1511466 (comments #3 and #9) you can use this python script to fix your database:
import MySQLdb connect( host = '127.0.0.1', user = 'nova', passwd = 'my-secret-pw', db = 'nova')
conn = MySQLdb.
cursor = conn.cursor()
cursor. execute( "select instance_uuid from instance_extra;") execute( "select uuid from instances;")
instance_extra_t = cursor.fetchall()
cursor.
instances_t = cursor.fetchall()
todelete_list = []
for extra in instance_extra_t:
todelete_ list.append( extra)
if extra not in instances_t:
for uuid in todelete_list: uuid='% s';" % uuid
cmd = "delete from instance_extra where instance_
result = cursor.execute(cmd)
conn.commit()