"Mapping from hypervisor : " + hypervisorType.toString() + ", version : " + hypervisorVersion + " and guest OS : " + guestOs.getDisplayName() + " already exists!"); final GuestOSHypervisorVO guestOsMapping = new GuestOSHypervisorVO(); guestOsMapping.setGuestOsId(guestOs.getId()); guestOsMapping.setGuestOsName(osNameForHypervisor); guestOsMapping.setHypervisorType(hypervisorType.toString()); guestOsMapping.setHypervisorVersion(hypervisorVersion); guestOsMapping.setIsUserDefined(true); return _guestOSHypervisorDao.persist(guestOsMapping);
protected GuestOSHypervisorDaoImpl() { guestOsSearch = createSearchBuilder(); guestOsSearch.and("guest_os_id", guestOsSearch.entity().getGuestOsId(), SearchCriteria.Op.EQ); guestOsSearch.done(); mappingSearch = createSearchBuilder(); mappingSearch.and("guest_os_id", mappingSearch.entity().getGuestOsId(), SearchCriteria.Op.EQ); mappingSearch.and("hypervisor_type", mappingSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ); mappingSearch.and("hypervisor_version", mappingSearch.entity().getHypervisorVersion(), SearchCriteria.Op.EQ); mappingSearch.done(); userDefinedMappingSearch = createSearchBuilder(); userDefinedMappingSearch.and("guest_os_id", userDefinedMappingSearch.entity().getGuestOsId(), SearchCriteria.Op.EQ); userDefinedMappingSearch.and("hypervisor_type", userDefinedMappingSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ); userDefinedMappingSearch.and("hypervisor_version", userDefinedMappingSearch.entity().getHypervisorVersion(), SearchCriteria.Op.EQ); userDefinedMappingSearch.and("is_user_defined", userDefinedMappingSearch.entity().getIsUserDefined(), SearchCriteria.Op.EQ); userDefinedMappingSearch.done(); }
@Override public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); // Determine the VM's OS description GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = null; if (host != null) { guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); } if (guestOsMapping == null || host == null) { to.setPlatformEmulator("Other"); } else { to.setPlatformEmulator(guestOsMapping.getGuestOsName()); } return to; }
@Override public HypervisorType findHypervisorTypeByGuestOsId(long guestOsId) { SearchCriteria<GuestOSHypervisorVO> sc = guestOsSearch.create(); sc.setParameters("guest_os_id", guestOsId); GuestOSHypervisorVO goh = findOneBy(sc); return HypervisorType.getType(goh.getHypervisorType()); }
@Override public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); setVmQuotaPercentage(to, vm); // Determine the VM's OS description GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = null; if (host != null) { guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); } if (guestOsMapping == null || host == null) { to.setPlatformEmulator("Other"); } else { to.setPlatformEmulator(guestOsMapping.getGuestOsName()); } return to; }
HostVO host = hostDao.findById(hostId); GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion()); ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName()); ccmd.setWait(wait); try {
revertToSnapshotCommand.setPlatformEmulator(null); } else { revertToSnapshotCommand.setPlatformEmulator(guestOsMapping.getGuestOsName());
ccmd.setPlatformEmulator(null); } else { ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName());
to.setPlatformEmulator(null); } else { to.setPlatformEmulator(guestOsMapping.getGuestOsName());