public ApplianceVmNicTO(VmNicInventory inv) { ip = inv.getIp(); netmask = inv.getNetmask(); gateway = inv.getGateway(); mac = inv.getMac(); }
private SnatStruct makeSnatStruct(VmInstanceSpec spec, L3NetworkInventory l3) { VmNicInventory nic = null; for (VmNicInventory inv : spec.getDestNics()) { if (VmNicHelper.getL3Uuids(inv).contains(l3.getUuid())){ nic = inv; break; } } SnatStruct struct = new SnatStruct(); struct.setL3Network(l3); struct.setGuestGateway(nic.getGateway()); struct.setGuestIp(nic.getIp()); struct.setGuestMac(nic.getMac()); struct.setGuestNetmask(nic.getNetmask()); return struct; }
@Override public VirtualRouterCommands.NicInfo call(VmNicInventory arg) { VirtualRouterCommands.NicInfo info = new VirtualRouterCommands.NicInfo(); info.setIp(arg.getIp()); info.setDefaultRoute(false); info.setGateway(arg.getGateway()); info.setMac(arg.getMac()); info.setNetmask(arg.getNetmask()); info.setFirewallDefaultAction(action); return info; } });
struct.setGuestIp(nic.getIp()); struct.setGuestMac(nic.getMac()); struct.setGuestNetmask(nic.getNetmask());
info.setGateway(nicInventory.getGateway()); info.setMac(nicInventory.getMac()); info.setNetmask(nicInventory.getNetmask()); cmd.setNics(Arrays.asList(info));
info.setManagementNicIp(mgmtNic.getIp()); info.setManagementNicMac(mgmtNic.getMac()); info.setManagementNicNetmask(mgmtNic.getNetmask()); if (publicNic != null) { info.setPublicNicIp(publicNic.getIp()); info.setPublicNicNetmask(publicNic.getNetmask()); info.setPublicNicMac(publicNic.getMac()); info.setPublicNicGateway(publicNic.getGateway());
info.setGateway(nic.getGateway()); info.setMac(nic.getMac()); info.setNetmask(nic.getNetmask()); info.setFirewallDefaultAction(action);
info.setPublicIp(vr.getPublicNic().getIp()); info.setPublicNicMac(vr.getPublicNic().getMac()); info.setSnatNetmask(nic.getNetmask()); snatInfo.add(info);
info.setPublicIp(vr.getPublicNic().getIp()); info.setPublicNicMac(vr.getPublicNic().getMac()); info.setSnatNetmask(vnic.getNetmask()); snatInfo.add(info);
vipvo.setIpRangeUuid(ips.getUuid()); vipvo.setL3NetworkUuid(nic.getL3NetworkUuid()); vipvo.setNetmask(nic.getNetmask()); vipvo.setUsedIpUuid(nic.getUsedIpUuid()); vipvo.setUseFor(VirtualRouterConstant.SNAT_NETWORK_SERVICE_TYPE);
info.setGateway(nicInventory.getGateway()); info.setMac(nicInventory.getMac()); info.setNetmask(nicInventory.getNetmask());
@Override protected void scripts() { String acntUuid = Account.getAccountUuidOfResource(spec.getVmInventory().getUuid()); spec.getDestNics().forEach(nic -> { VmNicVO nvo = new VmNicVO(); nvo.setUuid(nic.getUuid()); nvo.setDeviceId(nic.getDeviceId()); nvo.setIp(nic.getIp()); nvo.setL3NetworkUuid(nic.getL3NetworkUuid()); nvo.setMac(nic.getMac()); nvo.setHypervisorType(nic.getHypervisorType()); nvo.setUsedIpUuid(nic.getUsedIpUuid()); nvo.setGateway(nic.getGateway()); nvo.setNetmask(nic.getNetmask()); nvo.setVmInstanceUuid(nic.getVmInstanceUuid()); nvo.setMetaData(nic.getMetaData()); nvo.setInternalName(nic.getInternalName()); nvo.setAccountUuid(acntUuid); nvo.setIpVersion(nic.getIpVersion()); persist(nvo); if (nic.getUsedIpUuid() != null) { SQL.New(UsedIpVO.class).eq(UsedIpVO_.uuid, nic.getUsedIpUuid()).set(UsedIpVO_.vmNicUuid, nvo.getUuid()).update(); } }); ApplianceVmVO apvm = findByUuid(spec.getVmInventory().getUuid(), ApplianceVmVO.class); apvm.setManagementNetworkUuid(mgmtNic.getL3NetworkUuid()); merge(apvm); } }.execute();