should not duplicate vm instance id, during the volume migration

Conflicts:
	engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
This commit is contained in:
Edison Su 2014-10-30 21:27:51 -07:00
parent ffdb38c496
commit 885bba926c
2 changed files with 4 additions and 0 deletions

View File

@ -594,8 +594,11 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
VolumeVO srcVol = findById(srcVolId);
VolumeVO destVol = findById(destVolId);
String uuid = srcVol.getUuid();
Long instanceId = srcVol.getInstanceId();
srcVol.setUuid(null);
srcVol.setInstanceId(null);
destVol.setUuid(uuid);
destVol.setInstanceId(instanceId);
update(srcVolId, srcVol);
update(destVolId, destVol);
} catch (Exception e) {

View File

@ -830,6 +830,7 @@ public class VolumeServiceImpl implements VolumeService {
}
VolumeVO newVol = new VolumeVO(volume);
newVol.setInstanceId(null);
newVol.setPoolId(pool.getId());
newVol.setFolder(folder);
newVol.setPodId(pool.getPodId());