Skip to content

Commit 1bcbd98

Browse files
committed
pass down iso, not matter is bootable or not
1 parent bc62817 commit 1bcbd98

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎server/src/com/cloud/vm/UserVmManagerImpl.java‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile<UserVmVO> pro
21452145
if (vo.getIsoId() != null) {
21462146
template = _templateDao.findById(vo.getIsoId());
21472147
}
2148-
if (template != null && template.getFormat() == ImageFormat.ISO && template.isBootable()) {
2148+
if (template != null && template.getFormat() == ImageFormat.ISO) {
21492149
String isoPath = null;
21502150
Pair<String, String> isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vo.getDataCenterId());
21512151
if (isoPathPair == null) {
@@ -2154,10 +2154,15 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile<UserVmVO> pro
21542154
} else {
21552155
isoPath = isoPathPair.first();
21562156
}
2157-
profile.setBootLoaderType(BootloaderType.CD);
2157+
if (template.isBootable())
2158+
profile.setBootLoaderType(BootloaderType.CD);
21582159
GuestOSVO guestOS = _guestOSDao.findById(template.getGuestOSId());
2160+
String displayName = null;
2161+
if (guestOS != null) {
2162+
displayName = guestOS.getDisplayName();
2163+
}
21592164
VolumeTO iso = new VolumeTO(profile.getId(), Volume.VolumeType.ISO, StorageResourceType.STORAGE_POOL, StoragePoolType.ISO, null, template.getName(), null, isoPath,
2160-
0, null, guestOS.getDisplayName());
2165+
0, null, displayName);
21612166

21622167
iso.setDeviceId(3);
21632168
profile.addDisk(iso);

0 commit comments

Comments
 (0)