@Override public NicTO completeNicInformation(L2NetworkInventory l2Network, VmNicInventory nic) { L2VlanNetworkVO vo = dbf.findByUuid(l2Network.getUuid(), L2VlanNetworkVO.class); NicTO to = new NicTO(); to.setMac(nic.getMac()); to.setUuid(nic.getUuid()); to.setBridgeName(makeBridgeName(l2Network.getPhysicalInterface(), vo.getVlan())); to.setDeviceId(nic.getDeviceId()); to.setNicInternalName(nic.getInternalName()); to.setMetaData(String.valueOf(vo.getVlan())); return to; }
@AsyncThread private void doAttachNic(HttpEntity<String> entity) { AttachNicCommand cmd = JSONObjectUtil.toObject(entity.getBody(), AttachNicCommand.class); AttachNicResponse rsp = new AttachNicResponse(); if (!config.attachNicSuccess) { rsp.setSuccess(false); rsp.setError("fail on purpose"); } else { config.attachNicCommands.add(cmd); config.attachedNics.put(cmd.getNic().getNicInternalName(), cmd.getNic()); } replyer.reply(entity, rsp); }
@Transactional(readOnly = true) private NicTO completeNicInfo(VmNicInventory nic) { /* all l3 networks of the nic has same l2 network */ L2NetworkInventory l2inv = getL2NetworkTypeFromL3NetworkUuid(nic.getL3NetworkUuid()); KVMCompleteNicInformationExtensionPoint extp = factory.getCompleteNicInfoExtension(L2NetworkType.valueOf(l2inv.getType())); NicTO to = extp.completeNicInformation(l2inv, nic); if (to.getUseVirtio() == null) { SimpleQuery<VmInstanceVO> q = dbf.createQuery(VmInstanceVO.class); q.select(VmInstanceVO_.platform); q.add(VmInstanceVO_.uuid, Op.EQ, nic.getVmInstanceUuid()); String platform = q.findValue(); to.setUseVirtio(ImagePlatform.valueOf(platform).isParaVirtualization()); to.setIps(getCleanTrafficIp(nic)); } return to; }
@Override public NicTO completeNicInformation(L2NetworkInventory l2Network, VmNicInventory nic) { NicTO to = new NicTO(); to.setMac(nic.getMac()); to.setUuid(nic.getUuid()); to.setBridgeName(makeBridgeName(l2Network.getPhysicalInterface())); to.setDeviceId(nic.getDeviceId()); to.setNicInternalName(nic.getInternalName()); return to; } }
@Override public KVMAgentCommands.NicTO completeNicInformation(L2NetworkInventory l2Network, VmNicInventory nic) { VxlanNetworkPoolVO vo = dbf.findByUuid(l2Network.getUuid(), VxlanNetworkPoolVO.class); KVMAgentCommands.NicTO to = new KVMAgentCommands.NicTO(); to.setMac(nic.getMac()); to.setUuid(nic.getUuid()); to.setDeviceId(nic.getDeviceId()); to.setNicInternalName(nic.getInternalName()); return to; }
@Override public KVMAgentCommands.NicTO completeNicInformation(L2NetworkInventory l2Network, VmNicInventory nic) { VxlanNetworkVO vo = dbf.findByUuid(l2Network.getUuid(), VxlanNetworkVO.class); KVMAgentCommands.NicTO to = new KVMAgentCommands.NicTO(); to.setMac(nic.getMac()); to.setUuid(nic.getUuid()); to.setBridgeName(makeBridgeName(vo.getVni())); to.setDeviceId(nic.getDeviceId()); to.setNicInternalName(nic.getInternalName()); to.setMetaData(String.valueOf(vo.getVni())); return to; }