Comment 11 for bug 962615

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 962615] Re: Unable to list volumes after building from snapshot

I think I may have tracked down the issue. The migration code adds snapshot_id to volumes as an integer

migrate_repo/versions/020_add_snapshot_id_to_volumes.py
29: snapshot_id = Column('snapshot_id', Integer())

but it is listed as a volume in models.py

models.py
347: snapshot_id = Column(String(255))

I think the following change should fix the issue:

diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 634f04d..01eae5c 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -344,7 +344,7 @@ class Volume(BASE, NovaBase):
     user_id = Column(String(255))
     project_id = Column(String(255))

- snapshot_id = Column(String(255))
+ snapshot_id = Column(Integer)

     host = Column(String(255)) # , ForeignKey('hosts.id'))
     size = Column(Integer)

Would someone give that a shot and see if it resolves the problem? If so I can propose it.