From 1bcbd983f19ea84217e6a0ec6252a617ea2c0280 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Thu, 20 Jan 2011 04:12:44 -0500 Subject: [PATCH] pass down iso, not matter is bootable or not --- server/src/com/cloud/vm/UserVmManagerImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index ad3909c28ab..752d19107f0 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2145,7 +2145,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager if (vo.getIsoId() != null) { template = _templateDao.findById(vo.getIsoId()); } - if (template != null && template.getFormat() == ImageFormat.ISO && template.isBootable()) { + if (template != null && template.getFormat() == ImageFormat.ISO) { String isoPath = null; Pair isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vo.getDataCenterId()); if (isoPathPair == null) { @@ -2154,10 +2154,15 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager } else { isoPath = isoPathPair.first(); } - profile.setBootLoaderType(BootloaderType.CD); + if (template.isBootable()) + profile.setBootLoaderType(BootloaderType.CD); GuestOSVO guestOS = _guestOSDao.findById(template.getGuestOSId()); + String displayName = null; + if (guestOS != null) { + displayName = guestOS.getDisplayName(); + } VolumeTO iso = new VolumeTO(profile.getId(), Volume.VolumeType.ISO, StorageResourceType.STORAGE_POOL, StoragePoolType.ISO, null, template.getName(), null, isoPath, - 0, null, guestOS.getDisplayName()); + 0, null, displayName); iso.setDeviceId(3); profile.addDisk(iso);