Details
Description
In a pre-upgrade setup if clusters that belong to one single VMware Datacenter are spread across 3 different CloudStack zones, upgrade to 4.2 will fail.
As part of the new mapping model for CloudStack zone and Vmware datacenter https://issues.apache.org/jira/browse/CLOUDSTACK-1963, during CS upgrade to 4.2 we populate each of the VMware datacenter into either cloud.vmware_datacenter or cloud.legacy_zones table. But our upgrade script doesn't handle a VMware Datacenter that is managed by two different CloudStack zones and hence the it will fail with the following error -
2014-06-19 03:19:27,565 ERROR [c.c.u.d.Upgrade410to420] (main:null) Unable to discover legacy zones.Duplicate entry 'xxx' for key 'guid' 2014-06-19 03:19:27,568 ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) Unable to upgrade the database com.cloud.utils.exception.CloudRuntimeException: Unable to discover legacy zones.Duplicate entry 'xxx' for key 'guid' at com.cloud.upgrade.dao.Upgrade410to420.persistLegacyZones(Upgrade410to420.java:979) at com.cloud.upgrade.dao.Upgrade410to420.performDataMigration(Upgrade410to420.java:80) at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:292) at com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:414)