diff --git a/api/src/com/cloud/agent/api/to/VolumeTO.java b/api/src/com/cloud/agent/api/to/VolumeTO.java index fabd2ac362b..808ba759650 100644 --- a/api/src/com/cloud/agent/api/to/VolumeTO.java +++ b/api/src/com/cloud/agent/api/to/VolumeTO.java @@ -63,11 +63,16 @@ public class VolumeTO { this.storagePoolUuid = pool.getUuid(); this.mountPoint = volume.getFolder(); this.chainInfo = volume.getChainInfo(); + this.deviceId = volume.getDeviceId().intValue(); } public int getDeviceId() { return deviceId; } + + public void setDeviceId(int id) { + this.deviceId = id; + } public Storage.StorageResourceType getResourceType() { return resourceType; diff --git a/api/src/com/cloud/api/commands/DeployVMCmd.java b/api/src/com/cloud/api/commands/DeployVMCmd.java index ce08f2709f7..b298b821118 100644 --- a/api/src/com/cloud/api/commands/DeployVMCmd.java +++ b/api/src/com/cloud/api/commands/DeployVMCmd.java @@ -34,6 +34,7 @@ import com.cloud.event.EventTypes; import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.ResourceUnavailableException; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.user.Account; import com.cloud.user.UserContext; import com.cloud.uservm.UserVm; @@ -121,8 +122,8 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { return group; } - public String getHypervisor() { - return hypervisor; + public HypervisorType getHypervisor() { + return HypervisorType.getType(hypervisor); } public List getNetworkGroupList() { diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java index d65b7b6be16..bb91f9120a4 100644 --- a/api/src/com/cloud/vm/VirtualMachineProfile.java +++ b/api/src/com/cloud/vm/VirtualMachineProfile.java @@ -23,6 +23,7 @@ import com.cloud.agent.api.to.VolumeTO; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.offering.ServiceOffering; import com.cloud.template.VirtualMachineTemplate; +import com.cloud.template.VirtualMachineTemplate.BootloaderType; import com.cloud.user.Account; @@ -106,4 +107,7 @@ public interface VirtualMachineProfile { VirtualMachine.Type getType(); void setParameter(String name, Object value); + + void setBootLoaderType(BootloaderType bootLoader); + BootloaderType getBootLoaderType(); } diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 5339db63d2f..d1f97e9cad5 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -692,7 +692,11 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR protected VDI mount(Connection conn, String vmName, VolumeTO volume) throws XmlRpcException, XenAPIException { if (volume.getType() == VolumeType.ISO) { + String isopath = volume.getPath(); + if (isopath == null) { + return null; + } int index = isopath.lastIndexOf("/"); String mountpoint = isopath.substring(0, index); @@ -724,7 +728,11 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR VBD.Record vbdr = new VBD.Record(); vbdr.VM = vm; - vbdr.VDI = vdi; + if (vdi != null) + vbdr.VDI = vdi; + else { + vbdr.empty = true; + } if (type == VolumeType.ROOT) { vbdr.bootable = true; } diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index d6442af2b11..c940074d43d 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -463,7 +463,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS } } } else { - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, null, null); + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, null, null, null); DeployDestination dest = null; DataCenterDeployment plan = new DataCenterDeployment(dc.getId(), pod.getId(), sp.getClusterId(), null); ExcludeList avoids = new ExcludeList(); diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index af1f7cd716b..21b3cbca09c 100644 --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -576,7 +576,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx ConsoleProxyVO proxy = _consoleProxyDao.findById(proxyVmId); Account systemAcct = _accountMgr.getSystemAccount(); User systemUser = _accountMgr.getSystemUser(); - return _itMgr.start(proxy, null, systemUser, systemAcct); + return _itMgr.start(proxy, null, systemUser, systemAcct, null); } @Override @@ -1113,7 +1113,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx } ConsoleProxyVO proxy = new ConsoleProxyVO(id, _serviceOffering.getId(), name, _template.getId(), _template.getGuestOSId(), dataCenterId, systemAcct.getDomainId(), systemAcct.getId(), 0); try { - proxy = _itMgr.allocate(proxy, _template, _serviceOffering, networks, plan, systemAcct); + proxy = _itMgr.allocate(proxy, _template, _serviceOffering, networks, plan, null, systemAcct); } catch (InsufficientCapacityException e) { s_logger.warn("InsufficientCapacity", e); throw new CloudRuntimeException("Insufficient capacity exception", e); diff --git a/server/src/com/cloud/hypervisor/XenServerGuru.java b/server/src/com/cloud/hypervisor/XenServerGuru.java index 1df3fb6e561..0702c4f9b42 100644 --- a/server/src/com/cloud/hypervisor/XenServerGuru.java +++ b/server/src/com/cloud/hypervisor/XenServerGuru.java @@ -45,13 +45,10 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru @Override public VirtualMachineTO implement(VirtualMachineProfile vm) { - VirtualMachineTemplate template = vm.getTemplate(); - BootloaderType bt = BootloaderType.PyGrub; - if (template.getFormat() == Storage.ImageFormat.ISO || template.isRequiresHvm()) { - bt = BootloaderType.HVM; + if (vm.getBootLoaderType() != null) { + bt = vm.getBootLoaderType(); } - VirtualMachineTO to = toVirtualMachineTO(vm); to.setBootloader(bt); diff --git a/server/src/com/cloud/network/router/DomainRouterManagerImpl.java b/server/src/com/cloud/network/router/DomainRouterManagerImpl.java index a6091480de7..bee773e50e6 100644 --- a/server/src/com/cloud/network/router/DomainRouterManagerImpl.java +++ b/server/src/com/cloud/network/router/DomainRouterManagerImpl.java @@ -2116,10 +2116,10 @@ public class DomainRouterManagerImpl implements DomainRouterManager, DomainRoute networks.add(new Pair(controlConfig, null)); router = new DomainRouterVO(id, _offering.getId(), VirtualMachineName.getRouterName(id, _instance), _template.getId(), _template.getGuestOSId(), owner.getDomainId(), owner.getId(), guestConfig.getId(), _offering.getOfferHA()); - router = _itMgr.allocate(router, _template, _offering, networks, plan, owner); + router = _itMgr.allocate(router, _template, _offering, networks, plan, null, owner); } - return _itMgr.start(router, null, _accountService.getSystemUser(), _accountService.getSystemAccount()); + return _itMgr.start(router, null, _accountService.getSystemUser(), _accountService.getSystemAccount(), null); } @@ -2159,10 +2159,10 @@ public class DomainRouterManagerImpl implements DomainRouterManager, DomainRoute router = new DomainRouterVO(id, _offering.getId(), VirtualMachineName.getRouterName(id, _instance), _template.getId(), _template.getGuestOSId(), owner.getDomainId(), owner.getId(), guestConfig.getId(), _offering.getOfferHA()); router.setRole(Role.DHCP_USERDATA); - router = _itMgr.allocate(router, _template, _offering, networks, plan, owner); + router = _itMgr.allocate(router, _template, _offering, networks, plan, null, owner); } - return _itMgr.start(router, null, _accountService.getSystemUser(), _accountService.getSystemAccount()); + return _itMgr.start(router, null, _accountService.getSystemUser(), _accountService.getSystemAccount(), null); } @Override @@ -2343,7 +2343,7 @@ public class DomainRouterManagerImpl implements DomainRouterManager, DomainRoute } public DomainRouterVO start(DomainRouterVO router, User user, Account caller) throws StorageUnavailableException, InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { - return _itMgr.start(router, null, user, caller); + return _itMgr.start(router, null, user, caller, null); } @Override diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index a991c0eab1c..8bc3993f405 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2783,6 +2783,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag } throw new StorageUnavailableException("Unable to create " + newVol, newVol); } + created.first().setDeviceId(newVol.getDeviceId().intValue()); newVol.setStatus(AsyncInstanceCreateStatus.Created); newVol.setFolder(created.second().getPath()); newVol.setPath(created.first().getPath()); diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java index 439aeb9b78f..033ac5d399c 100644 --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java @@ -281,7 +281,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V SecondaryStorageVmVO secStorageVm = _secStorageVmDao.findById(secStorageVmId); Account systemAcct = _accountMgr.getSystemAccount(); User systemUser = _accountMgr.getSystemUser(); - return _itMgr.start(secStorageVm, null, systemUser, systemAcct); + return _itMgr.start(secStorageVm, null, systemUser, systemAcct, null); } @Override @DB @@ -772,7 +772,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V SecondaryStorageVmVO secStorageVm = new SecondaryStorageVmVO(id, _serviceOffering.getId(), name, _template.getId(), _template.getGuestOSId(), dataCenterId, systemAcct.getDomainId(), systemAcct.getId()); try { - secStorageVm = _itMgr.allocate(secStorageVm, _template, _serviceOffering, networks, plan, systemAcct); + secStorageVm = _itMgr.allocate(secStorageVm, _template, _serviceOffering, networks, plan, null, systemAcct); } catch (InsufficientCapacityException e) { s_logger.warn("InsufficientCapacity", e); throw new CloudRuntimeException("Insufficient capacity exception", e); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index d120346527a..4998cba8419 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -60,6 +60,7 @@ import com.cloud.agent.api.StartCommand; import com.cloud.agent.api.StopCommand; import com.cloud.agent.api.VmStatsEntry; import com.cloud.agent.api.storage.CreatePrivateTemplateAnswer; +import com.cloud.agent.api.to.VolumeTO; import com.cloud.agent.manager.Commands; import com.cloud.alert.AlertManager; import com.cloud.api.ApiDBUtils; @@ -154,6 +155,8 @@ import com.cloud.storage.GuestOSVO; import com.cloud.storage.SnapshotVO; import com.cloud.storage.Storage; import com.cloud.storage.Storage.ImageFormat; +import com.cloud.storage.Storage.StoragePoolType; +import com.cloud.storage.Storage.StorageResourceType; import com.cloud.storage.Storage.TemplateType; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePoolVO; @@ -3756,7 +3759,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager template.getId(), template.getGuestOSId(), offering.getOfferHA(), domainId, owner.getId(), offering.getId(), userData); try{ - if (_itMgr.allocate(vm, template, offering, rootDiskOffering, dataDiskOfferings, networks, null, plan, owner) == null) { + if (_itMgr.allocate(vm, template, offering, rootDiskOffering, dataDiskOfferings, networks, null, plan, cmd.getHypervisor(), owner) == null) { return null; } }finally{ @@ -3792,19 +3795,42 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager AccountVO owner = _accountDao.findById(vm.getAccountId()); - vm = _itMgr.start(vm, null, caller, owner); + vm = _itMgr.start(vm, null, caller, owner, cmd.getHypervisor()); vm.setPassword(password); return vm; } @Override public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { - UserVmVO vo = profile.getVirtualMachine(); - VirtualMachineTemplate template = profile.getTemplate(); - if (template.getFormat() == ImageFormat.ISO && template.isBootable()) { - - } - return true; + UserVmVO vo = profile.getVirtualMachine(); + VirtualMachineTemplate template = profile.getTemplate(); + if (vo.getIsoId() != null) { + template = _templateDao.findById(vo.getIsoId()); + } + if (template != null && template.getFormat() == ImageFormat.ISO && template.isBootable()) { + String isoPath = null; + Pair isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vo.getDataCenterId()); + if (isoPathPair == null) { + s_logger.warn("Couldn't get absolute iso path"); + return false; + } else { + isoPath = isoPathPair.first(); + } + profile.setBootLoaderType(BootloaderType.CD); + VolumeTO iso = new VolumeTO(profile.getId(), Volume.VolumeType.ISO, StorageResourceType.STORAGE_POOL, StoragePoolType.ISO, null, template.getName(), null, isoPath, + 0, null); + iso.setDeviceId(3); + profile.addDisk(iso); + vo.setIsoId(template.getId()); + } else { + /*create a iso placeholder*/ + VolumeTO iso = new VolumeTO(profile.getId(), Volume.VolumeType.ISO, StorageResourceType.STORAGE_POOL, StoragePoolType.ISO, null, template.getName(), null, null, + 0, null); + iso.setDeviceId(3); + profile.addDisk(iso); + } + + return true; } @Override @@ -3904,8 +3930,9 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager userId = accountAndUserValidation(vmId, account, userId, vm); UserVO user = _userDao.findById(userId); - - return _itMgr.start(vm, null, user, account); + VolumeVO disk = _volsDao.findByInstance(vmId).get(0); + HypervisorType hyperType = _volsDao.getHypervisorType(disk.getId()); + return _itMgr.start(vm, null, user, account, hyperType); } @Override diff --git a/server/src/com/cloud/vm/VirtualMachineManager.java b/server/src/com/cloud/vm/VirtualMachineManager.java index 0ee38597a8e..925d58fa843 100644 --- a/server/src/com/cloud/vm/VirtualMachineManager.java +++ b/server/src/com/cloud/vm/VirtualMachineManager.java @@ -25,6 +25,7 @@ import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.OperationTimedoutException; import com.cloud.exception.ResourceUnavailableException; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.NetworkVO; import com.cloud.service.ServiceOfferingVO; import com.cloud.storage.DiskOfferingVO; @@ -48,6 +49,7 @@ public interface VirtualMachineManager extends Manager { List> networks, Map params, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException, ResourceUnavailableException; T allocate(T vm, @@ -57,6 +59,7 @@ public interface VirtualMachineManager extends Manager { Pair dataDiskOffering, List> networks, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException, ResourceUnavailableException; T allocate(T vm, @@ -64,9 +67,10 @@ public interface VirtualMachineManager extends Manager { ServiceOfferingVO serviceOffering, List> networkProfiles, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException, ResourceUnavailableException; - T start(T vm, Map params, User caller, Account account) throws InsufficientCapacityException, ResourceUnavailableException; + T start(T vm, Map params, User caller, Account account, HypervisorType hyperType) throws InsufficientCapacityException, ResourceUnavailableException; boolean stop(T vm, User caller, Account account) throws ResourceUnavailableException; @@ -77,7 +81,7 @@ public interface VirtualMachineManager extends Manager { boolean stateTransitTo(VMInstanceVO vm, Event e, Long id); - T advanceStart(T vm, Map params, User caller, Account account) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException; + T advanceStart(T vm, Map params, User caller, Account account, HypervisorType hyperType) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException; boolean advanceStop(T vm, User caller, Account account) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException; diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index f1723c831e3..48a5ad8ce1e 100644 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -146,12 +146,13 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster List> networks, Map params, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException { if (s_logger.isDebugEnabled()) { s_logger.debug("Allocating entries for VM: " + vm); } - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, serviceOffering, owner, params); + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, serviceOffering, owner, params, hyperType); vm.setDataCenterId(plan.getDataCenterId()); if (plan.getPodId() != null) { @@ -209,12 +210,13 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster Pair dataDiskOffering, List> networks, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException { List> diskOfferings = new ArrayList>(1); if (dataDiskOffering != null) { diskOfferings.add(dataDiskOffering); } - return allocate(vm, template, serviceOffering, new Pair(serviceOffering, rootSize), diskOfferings, networks, null, plan, owner); + return allocate(vm, template, serviceOffering, new Pair(serviceOffering, rootSize), diskOfferings, networks, null, plan, hyperType, owner); } @Override @@ -223,8 +225,9 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster ServiceOfferingVO serviceOffering, List> networks, DeploymentPlan plan, + HypervisorType hyperType, Account owner) throws InsufficientCapacityException { - return allocate(vm, template, serviceOffering, new Pair(serviceOffering, null), null, networks, null, plan, owner); + return allocate(vm, template, serviceOffering, new Pair(serviceOffering, null), null, networks, null, plan, hyperType, owner); } @SuppressWarnings("unchecked") @@ -321,16 +324,16 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster } @Override - public T start(T vm, Map params, User caller, Account account) throws InsufficientCapacityException, ResourceUnavailableException { + public T start(T vm, Map params, User caller, Account account, HypervisorType hyperType) throws InsufficientCapacityException, ResourceUnavailableException { try { - return advanceStart(vm, params, caller, account); + return advanceStart(vm, params, caller, account, hyperType); } catch (ConcurrentOperationException e) { throw new CloudRuntimeException("Unable to start a VM due to concurrent operation", e); } } @Override - public T advanceStart(T vm, Map params, User caller, Account account) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { + public T advanceStart(T vm, Map params, User caller, Account account, HypervisorType hyperType) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { State state = vm.getState(); if (state == State.Starting || state == State.Running) { s_logger.debug("VM is already started: " + vm); @@ -358,7 +361,12 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vm.getPodId(), null, null); - HypervisorGuru hvGuru = _hvGurus.get(template.getHypervisorType()); + HypervisorGuru hvGuru; + if (hyperType != null && !hyperType.equals(HypervisorType.None)) { + hvGuru = _hvGurus.get(hyperType); + } else { + hvGuru = _hvGurus.get(template.getHypervisorType()); + } @SuppressWarnings("unchecked") VirtualMachineGuru vmGuru = (VirtualMachineGuru)_vmGurus.get(vm.getType()); @@ -378,7 +386,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster stateTransitTo(vm, Event.OperationRetry, dest.getHost().getId()); } - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, null, params); + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, null, params, hyperType); for (DeploymentPlanner planner : _planners) { dest = planner.plan(vmProfile, plan, avoids); diff --git a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java index bd65aa022b5..96d847ecaed 100644 --- a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java @@ -51,8 +51,9 @@ public class VirtualMachineProfileImpl implements Virtua BootloaderType _bootloader; VirtualMachine.Type _type; + HypervisorType _hyperType; - public VirtualMachineProfileImpl(T vm, VMTemplateVO template, ServiceOfferingVO offering, Account owner, Map params) { + public VirtualMachineProfileImpl(T vm, VMTemplateVO template, ServiceOfferingVO offering, Account owner, Map params, HypervisorType hyperType) { _vm = vm; _template = template; _offering = offering; @@ -62,10 +63,11 @@ public class VirtualMachineProfileImpl implements Virtua _params = new HashMap(); } _type = vm.getType(); + _hyperType = hyperType; } public VirtualMachineProfileImpl(T vm) { - this(vm, null, null, null, null); + this(vm, null, null, null, null, null); } public VirtualMachineProfileImpl(VirtualMachine.Type type) { @@ -95,6 +97,11 @@ public class VirtualMachineProfileImpl implements Virtua _params.put(name, value); } + @Override + public void setBootLoaderType(BootloaderType bootLoader) { + this._bootloader = bootLoader; + } + @Override public VirtualMachineTemplate getTemplate() { if (_template == null) { @@ -105,6 +112,9 @@ public class VirtualMachineProfileImpl implements Virtua @Override public HypervisorType getHypervisorType() { + if (_hyperType != null && !_hyperType.equals(HypervisorType.None)) { + return _hyperType; + } getTemplate(); return _template.getHypervisorType(); } @@ -215,4 +225,9 @@ public class VirtualMachineProfileImpl implements Virtua public String getInstanceName() { return _vm.getInstanceName(); } + + @Override + public BootloaderType getBootLoaderType() { + return this._bootloader; + } }