ImageVO imvo = dbf.findByUuid(vmInventory.getImageUuid(), ImageVO.class); if (imvo.getMediaType() == ImageMediaType.ISO) { CdRomSpec cdRomSpec = new CdRomSpec();
protected void selectBootOrder(VmInstanceSpec spec) { if (spec.getCurrentVmOperation() == null) { throw new CloudRuntimeException("selectBootOrder must be called after VmOperation is set"); } List<CdRomSpec> cdRomSpecs = spec.getCdRomSpecs().stream() .filter(cdRom -> cdRom.getImageUuid() != null) .collect(Collectors.toList()); if (spec.getCurrentVmOperation() == VmOperation.NewCreate && !cdRomSpecs.isEmpty()) { ImageVO imageVO = dbf.findByUuid(spec.getVmInventory().getImageUuid(), ImageVO.class); assert imageVO != null; if(imageVO.getMediaType() == ImageMediaType.ISO) { spec.setBootOrders(list(VmBootDevice.CdRom.toString())); } else { spec.setBootOrders(list(VmBootDevice.HardDisk.toString())); } } else { String order = VmSystemTags.BOOT_ORDER.getTokenByResourceUuid(self.getUuid(), VmSystemTags.BOOT_ORDER_TOKEN); if (order == null) { spec.setBootOrders(list(VmBootDevice.HardDisk.toString())); } else { spec.setBootOrders(list(order.split(","))); // set vm to boot from cdrom once only if (VmSystemTags.CDROM_BOOT_ONCE.hasTag(self.getUuid(), VmInstanceVO.class)) { VmSystemTags.BOOT_ORDER.deleteInherentTag(self.getUuid()); VmSystemTags.CDROM_BOOT_ONCE.deleteInherentTag(self.getUuid()); } } } }
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
vol.setPrimaryStorageUuid(uuid()); vol.setVmInstanceUuid(vm.getUuid()); vol.setRootImageUuid(vm.getImageUuid()); vm.setAllVolumes(asList(vol));
public VmInstanceInventory(VmInstanceInventory origin) { VmInstanceInventory inv; try { inv = (VmInstanceInventory) origin.clone(); } catch (CloneNotSupportedException e) { throw new CloudRuntimeException(e); } this.setClusterUuid(inv.getClusterUuid()); this.setCreateDate(inv.getCreateDate()); this.setDescription(inv.getDescription()); this.setHostUuid(inv.getHostUuid()); this.setHypervisorType(inv.getHypervisorType()); this.setImageUuid(inv.getImageUuid()); this.setInstanceOfferingUuid(inv.getInstanceOfferingUuid()); this.setLastHostUuid(inv.getLastHostUuid()); this.setLastOpDate(inv.getLastOpDate()); this.setName(inv.getName()); this.setRootVolumeUuid(inv.getRootVolumeUuid()); this.setState(inv.getState()); this.setType(inv.getType()); this.setUuid(inv.getUuid()); this.setZoneUuid(inv.getZoneUuid()); this.setAllVolumes(inv.getAllVolumes()); this.setVmNics(inv.getVmNics()); this.setInternalId(inv.getInternalId()); this.setCpuNum(inv.getCpuNum()); this.setCpuSpeed(inv.getCpuSpeed()); this.setMemorySize(inv.getMemorySize()); this.setAllocatorStrategy(inv.getAllocatorStrategy()); }