moveVolume is broken due to not setup hypervisortype in dskch

fixed
This commit is contained in:
anthony 2010-12-28 19:45:27 -08:00
parent a1855ebb27
commit f865e8b061
3 changed files with 4 additions and 3 deletions

View File

@ -181,7 +181,7 @@ public interface StorageManager extends Manager {
* @param destPoolClusterId * @param destPoolClusterId
* @return VolumeVO * @return VolumeVO
*/ */
VolumeVO moveVolume(VolumeVO volume, long destPoolDcId, Long destPoolPodId, Long destPoolClusterId); VolumeVO moveVolume(VolumeVO volume, long destPoolDcId, Long destPoolPodId, Long destPoolClusterId, HypervisorType dataDiskHyperType);
/** /**
* Create a volume based on the given criteria * Create a volume based on the given criteria

View File

@ -1553,10 +1553,11 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
} }
@Override @Override
public VolumeVO moveVolume(VolumeVO volume, long destPoolDcId, Long destPoolPodId, Long destPoolClusterId) { public VolumeVO moveVolume(VolumeVO volume, long destPoolDcId, Long destPoolPodId, Long destPoolClusterId, HypervisorType dataDiskHyperType) {
// Find a destination storage pool with the specified criteria // Find a destination storage pool with the specified criteria
DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId()); DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
DiskProfile dskCh = new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSizeInBytes(), diskOffering.getTagsArray(), diskOffering.getUseLocalStorage(), diskOffering.isRecreatable(), null); DiskProfile dskCh = new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSizeInBytes(), diskOffering.getTagsArray(), diskOffering.getUseLocalStorage(), diskOffering.isRecreatable(), null);
dskCh.setHyperType(dataDiskHyperType);
DataCenterVO destPoolDataCenter = _dcDao.findById(destPoolDcId); DataCenterVO destPoolDataCenter = _dcDao.findById(destPoolDcId);
HostPodVO destPoolPod = _podDao.findById(destPoolPodId); HostPodVO destPoolPod = _podDao.findById(destPoolPodId);
StoragePoolVO destPool = findStoragePool(dskCh, destPoolDataCenter, destPoolPod, destPoolClusterId, null, null, null, new HashSet<StoragePool>()); StoragePoolVO destPool = findStoragePool(dskCh, destPoolDataCenter, destPoolPod, destPoolClusterId, null, null, null, new HashSet<StoragePool>());

View File

@ -552,7 +552,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
if (moveVolumeNeeded) { if (moveVolumeNeeded) {
// Move the volume to a storage pool in the VM's zone, pod, or cluster // Move the volume to a storage pool in the VM's zone, pod, or cluster
volume = _storageMgr.moveVolume(volume, vmRootVolumePool.getDataCenterId(), vmRootVolumePool.getPodId(), vmRootVolumePool.getClusterId()); volume = _storageMgr.moveVolume(volume, vmRootVolumePool.getDataCenterId(), vmRootVolumePool.getPodId(), vmRootVolumePool.getClusterId(), dataDiskHyperType);
} }
AsyncJobExecutor asyncExecutor = BaseAsyncJobExecutor.getCurrentExecutor(); AsyncJobExecutor asyncExecutor = BaseAsyncJobExecutor.getCurrentExecutor();