Search in sources :

Example 91 with VmDevice

use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.

the class LibvirtVmXmlBuilder method writeCdRom.

private void writeCdRom(List<VmDevice> devices) {
    // <disk type='file' device='cdrom' snapshot='no'>
    // <driver name='qemu' type='raw' error_policy='report' />
    // <source file='<path>' startupPolicy='optional'/>
    // <target dev='hdc' bus='ide'/>
    // <readonly/>
    // <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    // </disk>
    devices.stream().filter(d -> VmPayload.isPayload(d.getSpecParams())).forEach(device -> {
        writer.writeStartElement("disk");
        writer.writeAttributeString("type", "file");
        writer.writeAttributeString("device", "cdrom");
        writer.writeAttributeString("snapshot", "no");
        writer.writeStartElement("driver");
        writer.writeAttributeString("name", "qemu");
        writer.writeAttributeString("type", "raw");
        writer.writeAttributeString("error_policy", "report");
        writer.writeEndElement();
        writer.writeStartElement("source");
        writer.writeAttributeString("file", "PAYLOAD:");
        writer.writeAttributeString("startupPolicy", "optional");
        writer.writeEndElement();
        payloadIndex = VmDeviceCommonUtils.getCdPayloadDeviceIndex(cdInterface);
        writer.writeStartElement("target");
        String name = vmInfoBuildUtils.makeDiskName(cdInterface, payloadIndex);
        writer.writeAttributeString("dev", name);
        writer.writeAttributeString("bus", cdInterface);
        writer.writeEndElement();
        writer.writeElement("readonly");
        writeAlias(device);
        if ("scsi".equals(cdInterface)) {
            int index = VmDeviceCommonUtils.getCdPayloadDeviceIndex(cdInterface);
            writeAddress(vmInfoBuildUtils.createAddressForScsiDisk(0, index));
        }
        payloadMetadata = new Pair<>(name, new VmPayload(device));
        writer.writeEndElement();
    });
    // add a device that points to vm.getCdPath()
    String cdPath = vm.getCdPath();
    VmDevice nonPayload = devices.stream().filter(d -> !VmPayload.isPayload(d.getSpecParams())).findAny().orElse(null);
    if (nonPayload != null || (vm.isRunOnce() && !StringUtils.isEmpty(cdPath))) {
        cdRomIndex = VmDeviceCommonUtils.getCdDeviceIndex(cdInterface);
        String dev = vmInfoBuildUtils.makeDiskName(cdInterface, cdRomIndex);
        boolean isoOnBlockDomain = vmInfoBuildUtils.isBlockDomainPath(cdPath);
        if (isoOnBlockDomain) {
            diskMetadata.put(dev, vmInfoBuildUtils.createDiskUuidsMap(vm, cdPath));
        }
        writer.writeStartElement("disk");
        writer.writeAttributeString("type", isoOnBlockDomain ? "block" : "file");
        writer.writeAttributeString("device", "cdrom");
        writer.writeAttributeString("snapshot", "no");
        writer.writeStartElement("driver");
        writer.writeAttributeString("name", "qemu");
        writer.writeAttributeString("type", "raw");
        writer.writeAttributeString("error_policy", "report");
        writer.writeEndElement();
        writer.writeStartElement("source");
        writer.writeAttributeString(isoOnBlockDomain ? "dev" : "file", cdPath);
        writer.writeAttributeString("startupPolicy", "optional");
        writer.writeEndElement();
        writer.writeStartElement("target");
        writer.writeAttributeString("dev", dev);
        writer.writeAttributeString("bus", cdInterface);
        writer.writeEndElement();
        writer.writeElement("readonly");
        if (nonPayload != null) {
            writeAlias(nonPayload);
            if ("scsi".equals(cdInterface)) {
                writeAddress(vmInfoBuildUtils.createAddressForScsiDisk(0, cdRomIndex));
            } else {
                writeAddress(nonPayload);
            }
            writeBootOrder(nonPayload.getBootOrder());
        }
        writer.writeEndElement();
    }
}
Also used : Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) VmType(org.ovirt.engine.core.common.businessentities.VmType) PropagateErrors(org.ovirt.engine.core.common.businessentities.storage.PropagateErrors) VmInterfaceType(org.ovirt.engine.core.common.businessentities.network.VmInterfaceType) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) LoggerFactory(org.slf4j.LoggerFactory) GraphicsInfo(org.ovirt.engine.core.common.businessentities.GraphicsInfo) VmCpuCountHelper(org.ovirt.engine.core.common.utils.VmCpuCountHelper) XmlTextWriter(org.ovirt.engine.core.utils.ovf.xml.XmlTextWriter) HugePageUtils(org.ovirt.engine.core.common.utils.HugePageUtils) ChipsetType(org.ovirt.engine.core.common.businessentities.ChipsetType) VmDeviceCommonUtils(org.ovirt.engine.core.common.utils.VmDeviceCommonUtils) Map(java.util.Map) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) StringMapUtils(org.ovirt.engine.core.utils.StringMapUtils) VmDeviceCommonUtils.updateVmDevicesBootOrder(org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.updateVmDevicesBootOrder) VmNic(org.ovirt.engine.core.common.businessentities.network.VmNic) VdsStatistics(org.ovirt.engine.core.common.businessentities.VdsStatistics) Version(org.ovirt.engine.core.compat.Version) MemoizingSupplier(org.ovirt.engine.core.utils.MemoizingSupplier) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) Collection(java.util.Collection) VmPayload(org.ovirt.engine.core.common.businessentities.VmPayload) Set(java.util.Set) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) HostDevice(org.ovirt.engine.core.common.businessentities.HostDevice) List(java.util.List) Stream(java.util.stream.Stream) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface) Entry(java.util.Map.Entry) Optional(java.util.Optional) GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) NumaSettingFactory(org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory) FeatureSupported(org.ovirt.engine.core.common.FeatureSupported) VmDeviceId(org.ovirt.engine.core.common.businessentities.VmDeviceId) VmDeviceType(org.ovirt.engine.core.common.utils.VmDeviceType) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) Guid(org.ovirt.engine.core.compat.Guid) HashMap(java.util.HashMap) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) NetworkUtils(org.ovirt.engine.core.utils.NetworkUtils) ArrayList(java.util.ArrayList) VmDeviceGeneralType(org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType) VmPropertiesUtils(org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils) HashSet(java.util.HashSet) ArchStrategyFactory(org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory) VdsProperties(org.ovirt.engine.core.vdsbroker.vdsbroker.VdsProperties) HugePage(org.ovirt.engine.core.common.businessentities.HugePage) Network(org.ovirt.engine.core.common.businessentities.network.Network) VolumeFormat(org.ovirt.engine.core.common.businessentities.storage.VolumeFormat) Pair(org.ovirt.engine.core.common.utils.Pair) Config(org.ovirt.engine.core.common.config.Config) Logger(org.slf4j.Logger) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) VmHostDevice(org.ovirt.engine.core.common.businessentities.VmHostDevice) VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) VM(org.ovirt.engine.core.common.businessentities.VM) NumaTuneMode(org.ovirt.engine.core.common.businessentities.NumaTuneMode) GetControllerIndices(org.ovirt.engine.core.vdsbroker.architecture.GetControllerIndices) IoTuneUtils.ioTuneListFrom(org.ovirt.engine.core.vdsbroker.vdsbroker.IoTuneUtils.ioTuneListFrom) Comparator(java.util.Comparator) Collections(java.util.Collections) StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) VmPayload(org.ovirt.engine.core.common.businessentities.VmPayload)

Example 92 with VmDevice

use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.

the class LibvirtVmXmlBuilder method overrideDevicesForRunOnce.

private List<VmDevice> overrideDevicesForRunOnce(List<VmDevice> devices) {
    if (!vm.isRunOnce()) {
        return devices;
    }
    // video device handling
    DisplayType displayType = vm.getDefaultDisplayType();
    if (displayType != null) {
        // remove existing video device
        devices = devices.stream().filter(dev -> dev.getType() != VmDeviceGeneralType.VIDEO).collect(Collectors.toList());
        // add new video device
        if (displayType != DisplayType.none) {
            devices.add(vmInfoBuildUtils.createVideoDeviceByDisplayType(displayType, vm.getId()));
        }
    }
    // graphics device handling
    if (displayType == DisplayType.none || (vm.getGraphicsInfos() != null && !vm.getGraphicsInfos().isEmpty())) {
        // remove existing graphics devices
        devices = devices.stream().filter(dev -> dev.getType() != VmDeviceGeneralType.GRAPHICS).collect(Collectors.toList());
        if (displayType != DisplayType.none) {
            // add new graphics devices
            Map<GraphicsType, GraphicsInfo> infos = vm.getGraphicsInfos();
            Map<String, Object> specParamsFromVm = new HashMap<>();
            vmInfoBuildUtils.addVmGraphicsOptions(infos, specParamsFromVm, vm);
            devices.addAll(vmInfoBuildUtils.createGraphicsDevices(infos, specParamsFromVm, vm.getId()));
        }
    }
    // the user may specify floppy path while there is no device in the database
    if (!StringUtils.isEmpty(vm.getFloppyPath()) && devices.stream().noneMatch(dev -> dev.getDevice().equals(VmDeviceType.FLOPPY.getName()))) {
        devices.add(vmInfoBuildUtils.createFloppyDevice(vm));
    }
    return devices;
}
Also used : GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) VmType(org.ovirt.engine.core.common.businessentities.VmType) PropagateErrors(org.ovirt.engine.core.common.businessentities.storage.PropagateErrors) VmInterfaceType(org.ovirt.engine.core.common.businessentities.network.VmInterfaceType) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) LoggerFactory(org.slf4j.LoggerFactory) GraphicsInfo(org.ovirt.engine.core.common.businessentities.GraphicsInfo) VmCpuCountHelper(org.ovirt.engine.core.common.utils.VmCpuCountHelper) XmlTextWriter(org.ovirt.engine.core.utils.ovf.xml.XmlTextWriter) HugePageUtils(org.ovirt.engine.core.common.utils.HugePageUtils) ChipsetType(org.ovirt.engine.core.common.businessentities.ChipsetType) VmDeviceCommonUtils(org.ovirt.engine.core.common.utils.VmDeviceCommonUtils) Map(java.util.Map) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) StringMapUtils(org.ovirt.engine.core.utils.StringMapUtils) VmDeviceCommonUtils.updateVmDevicesBootOrder(org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.updateVmDevicesBootOrder) VmNic(org.ovirt.engine.core.common.businessentities.network.VmNic) VdsStatistics(org.ovirt.engine.core.common.businessentities.VdsStatistics) Version(org.ovirt.engine.core.compat.Version) MemoizingSupplier(org.ovirt.engine.core.utils.MemoizingSupplier) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) Collection(java.util.Collection) VmPayload(org.ovirt.engine.core.common.businessentities.VmPayload) Set(java.util.Set) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) HostDevice(org.ovirt.engine.core.common.businessentities.HostDevice) List(java.util.List) Stream(java.util.stream.Stream) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface) Entry(java.util.Map.Entry) Optional(java.util.Optional) GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) NumaSettingFactory(org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory) FeatureSupported(org.ovirt.engine.core.common.FeatureSupported) VmDeviceId(org.ovirt.engine.core.common.businessentities.VmDeviceId) VmDeviceType(org.ovirt.engine.core.common.utils.VmDeviceType) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) Guid(org.ovirt.engine.core.compat.Guid) HashMap(java.util.HashMap) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) NetworkUtils(org.ovirt.engine.core.utils.NetworkUtils) ArrayList(java.util.ArrayList) VmDeviceGeneralType(org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType) VmPropertiesUtils(org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils) HashSet(java.util.HashSet) ArchStrategyFactory(org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory) VdsProperties(org.ovirt.engine.core.vdsbroker.vdsbroker.VdsProperties) HugePage(org.ovirt.engine.core.common.businessentities.HugePage) Network(org.ovirt.engine.core.common.businessentities.network.Network) VolumeFormat(org.ovirt.engine.core.common.businessentities.storage.VolumeFormat) Pair(org.ovirt.engine.core.common.utils.Pair) Config(org.ovirt.engine.core.common.config.Config) Logger(org.slf4j.Logger) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) VmHostDevice(org.ovirt.engine.core.common.businessentities.VmHostDevice) VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) VM(org.ovirt.engine.core.common.businessentities.VM) NumaTuneMode(org.ovirt.engine.core.common.businessentities.NumaTuneMode) GetControllerIndices(org.ovirt.engine.core.vdsbroker.architecture.GetControllerIndices) IoTuneUtils.ioTuneListFrom(org.ovirt.engine.core.vdsbroker.vdsbroker.IoTuneUtils.ioTuneListFrom) Comparator(java.util.Comparator) Collections(java.util.Collections) StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) HashMap(java.util.HashMap) GraphicsInfo(org.ovirt.engine.core.common.businessentities.GraphicsInfo)

Example 93 with VmDevice

use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.

the class VmManager method estimateOverhead.

private int estimateOverhead(VmStatic vmStatic) {
    // Prepare VM object using the available bits and pieces
    VM compose = new VM(vmStatic, new VmDynamic(), new VmStatistics(), clusterArchitecture, clusterCompatibilityVersion);
    // Load device list, TODO ignores unmanaged devices for now
    Map<Guid, VmDevice> devices = vmDeviceDao.getVmDeviceByVmId(vmId).stream().filter(VmDevice::isManaged).collect(Collectors.toMap(d -> d.getId().getDeviceId(), Function.identity()));
    vmStatic.setManagedDeviceMap(devices);
    return vmOverheadCalculator.getTotalRequiredMemoryInMb(compose);
}
Also used : VmStatisticsDao(org.ovirt.engine.core.dao.VmStatisticsDao) ClusterDao(org.ovirt.engine.core.dao.ClusterDao) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) Guid(org.ovirt.engine.core.compat.Guid) VmDynamicDao(org.ovirt.engine.core.dao.VmDynamicDao) VmNetworkStatistics(org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics) Function(java.util.function.Function) VmStaticDao(org.ovirt.engine.core.dao.VmStaticDao) Inject(javax.inject.Inject) OriginType(org.ovirt.engine.core.common.businessentities.OriginType) VmNetworkStatisticsDao(org.ovirt.engine.core.dao.network.VmNetworkStatisticsDao) Map(java.util.Map) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) VmDeviceDao(org.ovirt.engine.core.dao.VmDeviceDao) VmStatistics(org.ovirt.engine.core.common.businessentities.VmStatistics) Version(org.ovirt.engine.core.compat.Version) VmStatic(org.ovirt.engine.core.common.businessentities.VmStatic) ReentrantLock(java.util.concurrent.locks.ReentrantLock) VmOverheadCalculator(org.ovirt.engine.core.common.scheduling.VmOverheadCalculator) Collectors(java.util.stream.Collectors) VM(org.ovirt.engine.core.common.businessentities.VM) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) VdsmVm(org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm) PostConstruct(javax.annotation.PostConstruct) VmDynamic(org.ovirt.engine.core.common.businessentities.VmDynamic) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) VmDynamic(org.ovirt.engine.core.common.businessentities.VmDynamic) VmStatistics(org.ovirt.engine.core.common.businessentities.VmStatistics) VM(org.ovirt.engine.core.common.businessentities.VM) Guid(org.ovirt.engine.core.compat.Guid)

Example 94 with VmDevice

use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.

the class VmInfoBuildUtils method createGraphicsDevices.

public List<VmDevice> createGraphicsDevices(Map<GraphicsType, GraphicsInfo> graphicsInfos, Map<String, Object> extraSpecParams, Guid vmId) {
    final Comparator<GraphicsType> spiceLastComparator = ComparatorUtils.sortLast(GraphicsType.SPICE);
    final List<Entry<GraphicsType, GraphicsInfo>> sortedGraphicsInfos = graphicsInfos.entrySet().stream().sorted(Comparator.comparing(Entry::getKey, spiceLastComparator)).collect(Collectors.toList());
    List<VmDevice> result = new ArrayList<>();
    for (Entry<GraphicsType, GraphicsInfo> graphicsInfo : sortedGraphicsInfos) {
        VmDevice device = new VmDevice();
        device.setId(new VmDeviceId(Guid.newGuid(), vmId));
        device.setType(VmDeviceGeneralType.GRAPHICS);
        device.setDevice(graphicsInfo.getKey().name().toLowerCase());
        device.setPlugged(true);
        device.setAddress("");
        if (extraSpecParams != null) {
            device.setSpecParams(extraSpecParams);
        }
        result.add(device);
    }
    return result;
}
Also used : GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) Entry(java.util.Map.Entry) ArrayList(java.util.ArrayList) GraphicsInfo(org.ovirt.engine.core.common.businessentities.GraphicsInfo) VmDeviceId(org.ovirt.engine.core.common.businessentities.VmDeviceId)

Example 95 with VmDevice

use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.

the class VmInfoBuildUtils method getVmDeviceUnitMapForScsiDisks.

protected Map<Integer, Map<VmDevice, Integer>> getVmDeviceUnitMapForScsiDisks(VM vm, DiskInterface scsiInterface, boolean reserveFirstTwoLuns, boolean reserveForScsiCd) {
    List<Disk> disks = getSortedDisks(vm);
    Map<Integer, Map<VmDevice, Integer>> vmDeviceUnitMap = new HashMap<>();
    LinkedList<VmDevice> vmDeviceList = new LinkedList<>();
    for (Disk disk : disks) {
        DiskVmElement dve = disk.getDiskVmElementForVm(vm.getId());
        if (dve.getDiskInterface() == scsiInterface) {
            VmDevice vmDevice = getVmDeviceByDiskId(disk.getId(), vm.getId());
            Map<String, String> address = StringMapUtils.string2Map(vmDevice.getAddress());
            String unitStr = address.get(VdsProperties.Unit);
            String controllerStr = address.get(VdsProperties.Controller);
            // Otherwise, adding to 'vmDeviceList' for setting the unit property later.
            if (StringUtils.isNotEmpty(unitStr) && StringUtils.isNotEmpty(controllerStr)) {
                Integer controllerInt = Integer.valueOf(controllerStr);
                boolean controllerOutOfRange = controllerInt >= vm.getNumOfIoThreads() + getDefaultVirtioScsiIndex(vm);
                boolean ioThreadsEnabled = vm.getNumOfIoThreads() > 0 && FeatureSupported.virtioScsiIoThread(vm.getCompatibilityVersion());
                if ((ioThreadsEnabled && !controllerOutOfRange) || (controllerInt == getDefaultVirtioScsiIndex(vm))) {
                    if (!vmDeviceUnitMap.containsKey(controllerInt)) {
                        vmDeviceUnitMap.put(controllerInt, new HashMap<>());
                    }
                    vmDeviceUnitMap.get(controllerInt).put(vmDevice, Integer.valueOf(unitStr));
                } else {
                    // controller id not correct, generate the address again later
                    vmDevice.setAddress(null);
                    vmDeviceList.add(vmDevice);
                }
            } else {
                vmDeviceList.add(vmDevice);
            }
        }
    }
    // Find available unit (disk's index in VirtIO-SCSI controller) for disks with empty address\
    IntStream.range(0, vmDeviceList.size()).forEach(index -> {
        VmDevice vmDevice = vmDeviceList.get(index);
        // TODO: consider changing this so that it will search for the next available and
        // less used controller instead of always starting from index.
        int controller = getControllerForScsiDisk(vmDevice, vm, index);
        if (!vmDeviceUnitMap.containsKey(controller)) {
            vmDeviceUnitMap.put(controller, new HashMap<>());
        }
        int unit = getAvailableUnitForScsiDisk(vmDeviceUnitMap.get(controller), reserveFirstTwoLuns, reserveForScsiCd && controller == 0);
        vmDeviceUnitMap.get(controller).put(vmDevice, unit);
    });
    return vmDeviceUnitMap;
}
Also used : HashMap(java.util.HashMap) LinkedList(java.util.LinkedList) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)170 HashMap (java.util.HashMap)59 Guid (org.ovirt.engine.core.compat.Guid)53 VmDeviceId (org.ovirt.engine.core.common.businessentities.VmDeviceId)48 ArrayList (java.util.ArrayList)34 Map (java.util.Map)33 VM (org.ovirt.engine.core.common.businessentities.VM)29 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)28 List (java.util.List)26 GraphicsType (org.ovirt.engine.core.common.businessentities.GraphicsType)21 VmDeviceGeneralType (org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType)21 VmDeviceType (org.ovirt.engine.core.common.utils.VmDeviceType)20 Collections (java.util.Collections)19 Test (org.junit.Test)19 Collectors (java.util.stream.Collectors)18 Arrays (java.util.Arrays)17 Optional (java.util.Optional)17 StringUtils (org.apache.commons.lang.StringUtils)17 HostDevice (org.ovirt.engine.core.common.businessentities.HostDevice)17 Inject (javax.inject.Inject)16