public static List<String> getIpAddresses(VmNicInventory nic) { List<String> ret = new ArrayList<>(); for (UsedIpInventory ip : nic.getUsedIps()) { ret.add(ip.getIp()); } return ret; }
struct.setIp(ip.getIp()); struct.setDnsDomain(l3.getDnsDomain()); struct.setL3Network(l3);
if (struct.getGuestIp() != null) { to.nicIp = struct.getGuestIp().getIp(); to.nicNetmask = struct.getGuestIp().getNetmask(); to.nicGateway = struct.getGuestIp().getGateway();
@Override public void vmIpChanged(VmInstanceInventory vm, VmNicInventory nic, UsedIpInventory oldIp, UsedIpInventory newIp) { SimpleQuery<EipVO> q = dbf.createQuery(EipVO.class); q.add(EipVO_.vmNicUuid, Op.EQ, nic.getUuid()); q.add(EipVO_.guestIp, Op.EQ, oldIp.getIp()); EipVO eip = q.find(); if (eip == null) { return; } eip.setGuestIp(newIp.getIp()); dbf.update(eip); logger.debug(String.format("update the EIP[uuid:%s, name:%s]'s guest IP from %s to %s for the nic[uuid:%s]", eip.getUuid(), eip.getName(), oldIp.getIp(), newIp.getIp(), nic.getUuid())); }
UsedIpInventory ip = acquireIp(nicSpec.getL3NetworkUuid(), inv.getMac(), strategy); inv.setGateway(ip.getGateway()); inv.setIp(ip.getIp()); inv.setNetmask(ip.getNetmask()); inv.setUsedIpUuid(ip.getUuid());
private String getEipL3Network(VmNicInventory nic, EipInventory eip){ String L3NetworkUuid = nic.getL3NetworkUuid(); if (eip.getGuestIp() != null) { for (UsedIpInventory ip : nic.getUsedIps()) { if (ip.getIp().equals(eip.getGuestIp())) { L3NetworkUuid = ip.getL3NetworkUuid(); break; } } } return L3NetworkUuid; }
dhcpServerIp = ip.getIp(); dhcpServerIpUuid = ip.getUuid();
if (ip.getIp().equals(vo.getGuestIp())) { guestIp = ip;