mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-3733: fixed migrateVm - no need to cast vm to user vm to retrieve the iso information. Extract iso information from VirtualMachineProfile object passed to the method.
Conflicts: server/src/com/cloud/storage/VolumeManagerImpl.java
This commit is contained in:
parent
5c45645932
commit
3962f117ac
|
|
@ -31,10 +31,6 @@ import java.util.concurrent.ExecutionException;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
|
||||
import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
|
||||
|
|
@ -73,7 +69,9 @@ import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
|
|||
import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
|
||||
import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.storage.CreateVolumeOVAAnswer;
|
||||
|
|
@ -2320,13 +2318,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
|
|||
vm.addDisk(disk);
|
||||
}
|
||||
|
||||
if (vm.getType() == VirtualMachine.Type.User) {
|
||||
UserVmVO userVM = (UserVmVO) vm.getVirtualMachine();
|
||||
if (userVM.getIsoId() != null) {
|
||||
DataTO dataTO = tmplFactory.getTemplate(userVM.getIsoId(), DataStoreRole.Image, userVM.getDataCenterId()).getTO();
|
||||
DiskTO iso = new DiskTO(dataTO, 3L, null, Volume.Type.ISO);
|
||||
vm.addDisk(iso);
|
||||
}
|
||||
if (vm.getType() == VirtualMachine.Type.User && vm.getTemplate().getFormat() == ImageFormat.ISO) {
|
||||
DataTO dataTO = tmplFactory.getTemplate(vm.getTemplate().getId(), DataStoreRole.Image, vm.getVirtualMachine().getDataCenterId()).getTO();
|
||||
DiskTO iso = new DiskTO(dataTO, 3L, null, Volume.Type.ISO);
|
||||
vm.addDisk(iso);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue