CLOUDSTACK-9842: Unable to map root volume usage to VM

removed code which nullifies  vm_instance_id
Also modified QueryManagerImpl to ignore volume which does not have uuid. This is to avoid duplicate volume listing.

(cherry picked from commit 3cced927c4)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Sudhansu 2015-12-18 09:57:08 +05:30 committed by Rohit Yadav
parent 1535afe158
commit 4bacb64994
2 changed files with 1 additions and 1 deletions

View File

@ -645,7 +645,6 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
String uuid = srcVol.getUuid();
Long instanceId = srcVol.getInstanceId();
srcVol.setUuid(null);
srcVol.setInstanceId(null);
destVol.setUuid(uuid);
destVol.setInstanceId(instanceId);
update(srcVolId, srcVol);

View File

@ -1769,6 +1769,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("idIN", sb.entity().getId(), SearchCriteria.Op.IN);
sb.and("volumeType", sb.entity().getVolumeType(), SearchCriteria.Op.LIKE);
sb.and("uuid", sb.entity().getUuid(), SearchCriteria.Op.NNULL);
sb.and("instanceId", sb.entity().getVmId(), SearchCriteria.Op.EQ);
sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);
sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ);