mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2673: Failed to deploy guest vm using ISO with S3 being the
storage provider.
This commit is contained in:
parent
bc91e7692d
commit
e51adc3b7d
|
|
@ -19,6 +19,7 @@ package com.cloud.template;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
|
||||
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
|
||||
|
||||
|
|
@ -108,6 +109,8 @@ public interface TemplateManager extends TemplateApiService{
|
|||
|
||||
List<DataStore> getImageStoreByTemplate(long templateId, Long zoneId);
|
||||
|
||||
TemplateInfo prepareIso(long isoId, long dcId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -2770,24 +2770,21 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
|
|||
vm.setDetails(details);
|
||||
|
||||
if (vm.getIsoId() != null) {
|
||||
TemplateInfo template = templateFactory.getTemplate(vm.getIsoId(), DataStoreRole.Image, vm.getDataCenterId());
|
||||
|
||||
if (template == null || template.getFormat() != ImageFormat.ISO) {
|
||||
throw new CloudRuntimeException(
|
||||
"Can not find ISO in vm_template table for id "
|
||||
+ vm.getIsoId());
|
||||
TemplateInfo template = this.templateMgr.prepareIso(vm.getIsoId(), vm.getDataCenterId());
|
||||
if (template == null){
|
||||
s_logger.error("Failed to prepare ISO on secondary or cache storage");
|
||||
throw new CloudRuntimeException("Failed to prepare ISO on secondary or cache storage");
|
||||
}
|
||||
|
||||
if (template.isBootable()) {
|
||||
profile.setBootLoaderType(BootloaderType.CD);
|
||||
}
|
||||
|
||||
|
||||
GuestOSVO guestOS = _guestOSDao.findById(template.getGuestOSId());
|
||||
String displayName = null;
|
||||
if (guestOS != null) {
|
||||
displayName = guestOS.getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
TemplateObjectTO iso = (TemplateObjectTO)template.getTO();
|
||||
iso.setGuestOsType(displayName);
|
||||
DiskTO disk = new DiskTO(iso, 3L, Volume.Type.ISO);
|
||||
|
|
|
|||
Loading…
Reference in New Issue