use correct secondary storage when creating template from snapshot

This commit is contained in:
anthony 2011-06-28 16:58:15 -07:00
parent 549d2e29ed
commit e186369c51
1 changed files with 2 additions and 2 deletions

View File

@ -1455,9 +1455,9 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
throw new CloudRuntimeException("Unable to find Snapshot for Id " + snapshotId);
}
zoneId = snapshot.getDataCenterId();
secondaryStorageHost = _storageMgr.getSecondaryStorageHost(zoneId);
secondaryStorageHost = _hostDao.findById(snapshot.getSecHostId());
if (secondaryStorageHost == null) {
throw new CloudRuntimeException("Can not find the secondary storage for zoneId " + zoneId);
throw new CloudRuntimeException("Secondary storage " + snapshot.getSecHostId() + " doesn't exist");
}
String secondaryStorageURL = secondaryStorageHost.getStorageUrl();