mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
In the 4.1.0-4.2.0 db upgrade path, it creates new tables to store secondary (nfs) storage in image_store table and volumes in volume_store_ref table. In the upgrade path, it first tries to migrate NFS storage pool where it excludes storage pools which have been removed, but it migrates all the volumes without checking if their storage pools have been removed. This causes fk constraint failure as the volume/row being inserted refers to a storage pool which does not exist in the image_store table. The fix migrates all the nfs storage pools to image_store including removed storage pools and in doing so migrates with the 'removed' field. This fixes db upgrade for old pre-4.0 and 4.0/4.1 CloudStack clouds. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>