diff --git a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java index fb7ad38b655..715337762d6 100755 --- a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java @@ -193,6 +193,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade { //Clean up any vnets that have no live networks/nics pstmt4 = conn.prepareStatement("SELECT v.id, v.vnet, v.reservation_id FROM `cloud`.`op_dc_vnet_alloc` v LEFT JOIN networks n ON CONCAT('vlan://' , v.vnet) = n.broadcast_uri WHERE v.taken IS NOT NULL AND v.data_center_id = ? AND n.broadcast_uri IS NULL AND n.removed IS NULL"); + pstmt4.setLong(1, zoneId); rsVNet = pstmt4.executeQuery(); while(rsVNet.next()){ Long vnet_id = rsVNet.getLong(1); diff --git a/server/src/com/cloud/upgrade/dao/Upgrade303to304.java b/server/src/com/cloud/upgrade/dao/Upgrade303to304.java index 187a4d4ebf8..08c4697eae2 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade303to304.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade303to304.java @@ -173,6 +173,7 @@ public class Upgrade303to304 extends Upgrade30xBase implements DbUpgrade { //Clean up any vnets that have no live networks/nics pstmt4 = conn.prepareStatement("SELECT v.id, v.vnet, v.reservation_id FROM `cloud`.`op_dc_vnet_alloc` v LEFT JOIN networks n ON CONCAT('vlan://' , v.vnet) = n.broadcast_uri WHERE v.taken IS NOT NULL AND v.data_center_id = ? AND n.broadcast_uri IS NULL AND n.removed IS NULL"); + pstmt4.setLong(1, zoneId); rsVNet = pstmt4.executeQuery(); while(rsVNet.next()){ Long vnet_id = rsVNet.getLong(1);