Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Send GoalStateV2 from DPM, NCM and ACA #704

Merged
merged 60 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
04cbb1e
Update router manager api
DavidLiu506 Jun 29, 2021
4c100e5
Update code
DavidLiu506 Jun 29, 2021
e38bcf9
Update code
DavidLiu506 Jun 30, 2021
067a988
Update router manager
DavidLiu506 Jul 1, 2021
dd5dafd
Update router manager
DavidLiu506 Jul 1, 2021
aa76562
Merge router manager service api code
DavidLiu506 Jul 2, 2021
8ae37db
Fix getVpcRouteTables
DavidLiu506 Jul 2, 2021
f0462ae
Fix getVpcRouteTable
DavidLiu506 Jul 2, 2021
976883f
Update RouterController
DavidLiu506 Jul 6, 2021
ef7a2d2
Update code
DavidLiu506 Jul 6, 2021
670dcc6
Update code
DavidLiu506 Jun 29, 2021
59a65f0
Update code
DavidLiu506 Jun 30, 2021
1178f61
pull alcor code
DavidLiu506 Jul 9, 2021
5a98d10
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Jul 21, 2021
e4e0792
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Aug 13, 2021
ae15be0
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Aug 15, 2021
9c88b19
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Aug 21, 2021
9be2bb9
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Sep 13, 2021
733872a
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Oct 19, 2021
b3154ae
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Oct 21, 2021
e2bed17
Merge branch 'master' of https://github.com/DavidLiu506/alcor
DavidLiu506 Oct 21, 2021
7c5013e
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Oct 23, 2021
ac7acf8
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Oct 28, 2021
bcc0716
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Nov 3, 2021
5b7e69f
DPM send goal state to NCM instead of ACA
DavidLiu506 Nov 12, 2021
6b1fd3d
Update code
DavidLiu506 Nov 12, 2021
43af049
Update code
DavidLiu506 Nov 15, 2021
db5f112
Update code
DavidLiu506 Nov 16, 2021
8722772
Update code
DavidLiu506 Nov 16, 2021
dda2678
Update code
DavidLiu506 Nov 16, 2021
6bf77ac
Update code
DavidLiu506 Nov 16, 2021
410e50c
Update code
DavidLiu506 Nov 17, 2021
ca741c7
Update code
DavidLiu506 Nov 17, 2021
7352b24
Update code
DavidLiu506 Nov 18, 2021
2df153c
Update code
DavidLiu506 Nov 18, 2021
40a3693
Update code
DavidLiu506 Nov 19, 2021
2d6f74d
Update code
DavidLiu506 Nov 19, 2021
e76fb18
Update code
DavidLiu506 Nov 19, 2021
e0a2fbb
Update code
DavidLiu506 Nov 19, 2021
8ae12cf
Update code
DavidLiu506 Nov 19, 2021
0ebf1f0
Update code
DavidLiu506 Nov 20, 2021
fa34330
Update code
DavidLiu506 Nov 20, 2021
72a4b1e
Update code
DavidLiu506 Nov 20, 2021
7c4a8b7
Update code
DavidLiu506 Nov 20, 2021
a2b2397
Update code
DavidLiu506 Nov 23, 2021
76e08f2
Update code
DavidLiu506 Nov 23, 2021
c5c1f0d
Update code
DavidLiu506 Nov 23, 2021
d3c5e0c
Update code
DavidLiu506 Nov 23, 2021
55885e1
Update code
DavidLiu506 Nov 23, 2021
a8a7673
Update code
DavidLiu506 Nov 23, 2021
736bf1f
Update code
DavidLiu506 Nov 23, 2021
b80033d
Update code
DavidLiu506 Nov 23, 2021
7103bb3
Update code
DavidLiu506 Nov 23, 2021
a4462fe
Update code
DavidLiu506 Nov 23, 2021
94417f0
Update code
DavidLiu506 Nov 23, 2021
0f5949f
Update code
DavidLiu506 Nov 23, 2021
a0d40af
Update code
DavidLiu506 Nov 24, 2021
3f08872
Update code
DavidLiu506 Nov 24, 2021
140456b
Update code
DavidLiu506 Nov 24, 2021
722e197
Update code
DavidLiu506 Nov 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kubernetes/services/dpm_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data:
zetaGateway.enabled=false
zetaGateway.node.mac=e0:97:96:02:45:53
microservices.node.service.url=http://nodemanager-service.default.svc.cluster.local:9007/nodes
microservices.netwconfigmanager.service.url=netwconfigmanager-service
microservices.zeta.management.url=http://10.213.43.90
microservices.gateway.service.url=http://gatewaymanager-service.default.svc.cluster.local:9015
zetaGateway.check.timeout = 30
Expand Down Expand Up @@ -71,6 +72,8 @@ spec:
replicas: 5
template:
metadata:
annotations:
linkerd.io/inject: enabled
labels:
app: dataplanemanager
spec:
Expand Down
13 changes: 8 additions & 5 deletions kubernetes/services/network_config_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
replicas: 1
template:
metadata:
annotations:
linkerd.io/inject: enabled
labels:
app: netwconfigmanager
spec:
Expand All @@ -69,7 +71,8 @@ spec:
imagePullPolicy: IfNotPresent
command: ["java", "-jar", "/app/AlcorNetworkConfigManager-0.1.0.jar", "--spring.config.location=/etc/ncm/application.properties"]
ports:
- containerPort: 8080
- containerPort: 50001
protocol: TCP
Comment on lines +74 to +75
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidLiu506 Why we need to change 8080 to 50001 here? Is this for grpc connection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is for grpc connection.

volumeMounts:
- name: ncm-volume
mountPath: /etc/ncm
Expand All @@ -84,10 +87,10 @@ metadata:
labels:
name: netwconfigmanager-service
spec:
type: NodePort
type: ClusterIP
ports:
- port: 9014
targetPort: 8080
nodePort: 30014
- port: 50001
protocol: TCP
targetPort: 50001
Comment on lines +92 to +94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidLiu506 Do we need to include port spec for restful here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can add restful configure after restful api fix.

Comment on lines +92 to +94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this change block port 9014 for REST APIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for grpc configure, we can add another service for restful.

selector:
app: netwconfigmanager
2 changes: 1 addition & 1 deletion schema/proto3/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum ResourceType {
SUBNET = 1;
PORT = 2;
NEIGHBOR = 3;
SECURITYGROUP = 4;
SECURITYGROUP =4;
xieus marked this conversation as resolved.
Show resolved Hide resolved
DHCP = 5;
ROUTER = 6;
GATEWAY = 7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import com.futurewei.alcor.dataplane.config.Config;
import com.futurewei.alcor.dataplane.entity.MulticastGoalStateV2;
import com.futurewei.alcor.dataplane.entity.UnicastGoalStateV2;
import com.futurewei.alcor.schema.GoalStateProvisionerGrpc;
import com.futurewei.alcor.schema.Goalstate;
import com.futurewei.alcor.schema.Goalstateprovisioner;
import com.futurewei.alcor.schema.*;
import io.grpc.ConnectivityState;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
Expand All @@ -37,6 +35,8 @@

import java.util.*;
import java.util.concurrent.*;
import java.util.logging.Level;
import java.util.stream.Collectors;

@Service("grpcDataPlaneClient")
@ConditionalOnProperty(prefix = "protobuf.goal-state-message", name = "version", havingValue = "102")
Expand All @@ -56,21 +56,27 @@ public class DataPlaneClientImplV2 implements DataPlaneClient<UnicastGoalStateV2
// when a channel is set up, send this amount of default GoalStates for warmup.
private int numberOfWarmupsPerChannel;

private String netwconfigmanagerHost;

// prints out UUID and time, when sending a GoalState to any of the monitorHosts
private ArrayList<String> monitorHosts;

private ConcurrentHashMap<String, ArrayList<GrpcChannelStub>> hostIpGrpcChannelStubMap;

@Override
public List<String> sendGoalStates(List<UnicastGoalStateV2> unicastGoalStates) throws Exception {
Goalstate.GoalStateV2.Builder goalStateBuilder = Goalstate.GoalStateV2.newBuilder();
final CountDownLatch finishLatch = new CountDownLatch(1);
List<String> results = new ArrayList<>();
for (UnicastGoalStateV2 unicastGoalState : unicastGoalStates) {
String resp = doSendGoalState(unicastGoalState);
if (resp != null) {
results.add(resp);
}
goalStateBuilder = getGoalState(goalStateBuilder, unicastGoalState);
}
doSendGoalState(goalStateBuilder.build(), finishLatch, results);

if (!finishLatch.await(1, TimeUnit.MINUTES)) {
LOG.warn("Send goal states can not finish within 1 minutes");
return Arrays.asList("Send goal states can not finish within 1 minutes");
}
Comment on lines +76 to +79
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidLiu506 Do we know which goalstate or which ncm cannot sent to? If we do, can we put the id or uri in the log and return results?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, can we put 1 mins as a variable in application.properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NCM managed by linked, there only one goal state v2 send to NCM.

Copy link
Contributor Author

@DavidLiu506 DavidLiu506 Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with James, NCM already have ACA response information. DPM don't need to know it.

return results;
}

Expand All @@ -92,6 +98,10 @@ public DataPlaneClientImplV2(Config globalConfig, ArrayList<String> monitorHosts
numberOfWarmupsPerChannel = 0;
}

if (netwconfigmanagerHost == null || netwconfigmanagerHost.isEmpty()) {
netwconfigmanagerHost = globalConfig.netwconfigmanagerHost;
}

this.monitorHosts = monitorHosts;
LOG.info("Printing out all monitorHosts");
for(String host : this.monitorHosts){
Expand All @@ -100,7 +110,7 @@ public DataPlaneClientImplV2(Config globalConfig, ArrayList<String> monitorHosts
LOG.info("Done printing out all monitorHosts");
this.numberOfGrpcChannelPerHost = globalConfig.numberOfGrpcChannelPerHost;
this.numberOfWarmupsPerChannel = globalConfig.numberOfWarmupsPerChannel;
this.hostAgentPort = 50001;
this.hostAgentPort = 9016;
xieus marked this conversation as resolved.
Show resolved Hide resolved

this.executor = new ThreadPoolExecutor(100,
200,
Expand Down Expand Up @@ -173,7 +183,8 @@ private ArrayList<GrpcChannelStub> createGrpcChannelStubArrayList(String hostIp)
ArrayList<GrpcChannelStub> arr = new ArrayList<>();
for (int i = 0; i < numberOfGrpcChannelPerHost; i++) {
GrpcChannelStub channelStub = createGrpcChannelStub(hostIp);
warmUpChannelStub(channelStub, hostIp);
// Using Linkerd load balance
//warmUpChannelStub(channelStub, hostIp);
xieus marked this conversation as resolved.
Show resolved Hide resolved
arr.add(channelStub);
}
long end = System.currentTimeMillis();
Expand Down Expand Up @@ -220,11 +231,9 @@ public void onCompleted() {
return;
}

private String doSendGoalState(UnicastGoalStateV2 unicastGoalState) {
String hostIp = unicastGoalState.getHostIp();
LOG.info("Setting up a channel to ACA on: " + hostIp);
private String doSendGoalState(Goalstate.GoalStateV2 goalStateV2, CountDownLatch finishLatch, List<String> replies) {
String hostIp = netwconfigmanagerHost;
long start = System.currentTimeMillis();

GrpcChannelStub channelStub = getOrCreateGrpcChannel(hostIp);
long chan_established = System.currentTimeMillis();
LOG.info("[doSendGoalState] Established channel, elapsed Time in milli seconds: " + (chan_established - start));
Expand All @@ -239,6 +248,12 @@ private String doSendGoalState(UnicastGoalStateV2 unicastGoalState) {
public void onNext(Goalstateprovisioner.GoalStateOperationReply reply) {
LOG.info("Receive response from ACA@" + hostIp + " | " + reply.toString());
result.put(hostIp, reply.getOperationStatusesList());
if (reply.getOperationStatusesList().stream().filter(item -> item.getOperationStatus().equals(Common.OperationStatus.FAILURE)).collect(Collectors.toList()).size() > 0) {
replies.add(reply.toString());
while (finishLatch.getCount() > 0) {
finishLatch.countDown();
}
}
}

@Override
Expand All @@ -249,22 +264,13 @@ public void onError(Throwable t) {
@Override
public void onCompleted() {
LOG.info("Complete receiving message from ACA@" + hostIp);
finishLatch.countDown();
}
};

StreamObserver<Goalstate.GoalStateV2> requestObserver = asyncStub.pushGoalStatesStream(responseObserver);
try {
Goalstate.GoalStateV2 goalState = unicastGoalState.getGoalState();
LOG.info("Sending GS to Host " + hostIp + " as follows | " + goalState.toString());
requestObserver.onNext(goalState);
if (unicastGoalState.getGoalState().getNeighborStatesCount() == 1 && monitorHosts.contains(hostIp)) {
long sent_gs_time = System.currentTimeMillis();
// If there's only one neighbor state and it is trying to send it to aca_node_one, the IP of which is now
// hardcoded) this send goalstate action is probably caused by on-demand workflow, need to record when it
// sends this goalState so what we can look into this and the ACA log to see how much time was spent.
String neighbor_id = unicastGoalState.getGoalState().getNeighborStatesMap().keySet().iterator().next();
LOG.info("Sending neighbor ID: " + neighbor_id + " at: " + sent_gs_time);
}
requestObserver.onNext(goalStateV2);
} catch (RuntimeException e) {
// Cancel RPC
LOG.warn("[doSendGoalState] Sending GS, but error happened | " + e.getMessage());
Expand All @@ -275,10 +281,7 @@ public void onCompleted() {
LOG.info("Sending GS to Host " + hostIp + " is completed");

// comment out onCompleted so that the same channel/stub and keep sending next time.
// requestObserver.onCompleted();

// shutdown(channel);

requestObserver.onCompleted();
return null;
}

Expand All @@ -291,4 +294,115 @@ public GrpcChannelStub(ManagedChannel channel, GoalStateProvisionerGrpc.GoalStat
this.stub = stub;
}
}

private Goalstate.GoalStateV2.Builder getGoalState(Goalstate.GoalStateV2.Builder goalStateBuilder, UnicastGoalStateV2 unicastGoalStateV2) {
Goalstate.GoalStateV2 goalStateV2 = unicastGoalStateV2.getGoalState();
Goalstate.HostResources.Builder hostResourceBuilder = Goalstate.HostResources.newBuilder();
if (goalStateV2.getSubnetStatesCount() > 0) {
goalStateV2.getSubnetStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType subnetResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.SUBNET)
.setId(key)
.build();
hostResourceBuilder.addResources(subnetResourceIdType);
});
goalStateBuilder.putAllSubnetStates(goalStateV2.getSubnetStatesMap());
}

if (goalStateV2.getDhcpStatesCount() > 0) {
goalStateV2.getDhcpStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType dhcpResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.DHCP)
.setId(key)
.build();
hostResourceBuilder.addResources(dhcpResourceIdType);
});
goalStateBuilder.putAllDhcpStates(goalStateV2.getDhcpStatesMap());
}

if (goalStateV2.getPortStatesCount() > 0) {
goalStateV2.getPortStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType portResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.PORT)
.setId(key)
.build();
hostResourceBuilder.addResources(portResourceIdType);
});
goalStateBuilder.putAllPortStates(goalStateV2.getPortStatesMap());
}

if (goalStateV2.getSecurityGroupStatesCount() > 0) {
goalStateV2.getSecurityGroupStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType securityGroupResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.SECURITYGROUP)
.setId(key)
.build();
hostResourceBuilder.addResources(securityGroupResourceIdType);
});
goalStateBuilder.putAllSecurityGroupStates(goalStateV2.getSecurityGroupStatesMap());
}

if (goalStateV2.getNeighborStatesCount() > 0) {
goalStateV2.getNeighborStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType neighborGroupResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.NEIGHBOR)
.setId(key)
.build();
hostResourceBuilder.addResources(neighborGroupResourceIdType);
});
goalStateBuilder.putAllNeighborStates(goalStateV2.getNeighborStatesMap());
}

if (goalStateV2.getRouterStatesCount() > 0) {
goalStateV2.getRouterStatesMap().entrySet().forEach(entry -> {
Goalstate.ResourceIdType routerResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.ROUTER)
.setId(unicastGoalStateV2.getHostIp() + "/" + entry.getKey())
.build();
hostResourceBuilder.addResources(routerResourceIdType);


if (goalStateBuilder.containsRouterStates(unicastGoalStateV2.getHostIp() + "/" + entry.getKey())) {
Router.RouterConfiguration.Builder routerConfigurationBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).getConfiguration().toBuilder();
routerConfigurationBuilder.addAllSubnetRoutingTables(entry.getValue().getConfiguration().getSubnetRoutingTablesList());
Router.RouterState.Builder routerStateBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).toBuilder();
routerStateBuilder.setConfiguration(routerConfigurationBuilder);
} else {
goalStateBuilder.putRouterStates(unicastGoalStateV2.getHostIp() + "/" + entry.getKey(), entry.getValue());
}
});
}

if (goalStateV2.getVpcStatesCount() > 0) {
goalStateV2.getVpcStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType vpcResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.VPC)
.setId(key)
.build();
hostResourceBuilder.addResources(vpcResourceIdType);
});
goalStateBuilder.putAllVpcStates(goalStateV2.getVpcStatesMap());
}

if (goalStateV2.getGatewayStatesCount() > 0) {
goalStateV2.getGatewayStatesMap().keySet().forEach(key -> {
Goalstate.ResourceIdType gatewayResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.GATEWAY)
.setId(key)
.build();
hostResourceBuilder.addResources(gatewayResourceIdType);
});
goalStateBuilder.putAllGatewayStates(goalStateV2.getGatewayStatesMap());
}

if (goalStateBuilder.containsHostResources(unicastGoalStateV2.getHostIp())) {
Goalstate.HostResources.Builder hostResourceBuilder1 = Goalstate.HostResources.newBuilder();
hostResourceBuilder1.addAllResources(hostResourceBuilder.getResourcesList());
hostResourceBuilder1.addAllResources(goalStateBuilder.getHostResourcesMap().get(unicastGoalStateV2.getHostIp()).getResourcesList());
goalStateBuilder.putHostResources(unicastGoalStateV2.getHostIp(), hostResourceBuilder1.build());
} else {
goalStateBuilder.putHostResources(unicastGoalStateV2.getHostIp(), hostResourceBuilder.build());
}
return goalStateBuilder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class Config {
@Value("${grpc.monitor-hosts}")
public ArrayList<String> monitorHosts;

@Value("${microservices.netwconfigmanager.service.url}")
public String netwconfigmanagerHost;
xieus marked this conversation as resolved.
Show resolved Hide resolved

public static FileWriter TIME_STAMP_FILE;
public static BufferedWriter TIME_STAMP_WRITER;
public static String LOG_FILE_PATH = "timestamp.log";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ free of charge, to any person obtaining a copy of this software and associated d

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Service
public class DhcpService extends ResourceService {
Expand Down Expand Up @@ -72,6 +73,7 @@ public void buildDhcpStates(NetworkConfiguration networkConfig, UnicastGoalState
DHCP.DHCPConfiguration.Builder dhcpConfigBuilder = DHCP.DHCPConfiguration.newBuilder();
dhcpConfigBuilder.setRevisionNumber(FORMAT_REVISION_NUMBER);
dhcpConfigBuilder.setMacAddress(macAddress);
dhcpConfigBuilder.setId(UUID.randomUUID().toString());
dhcpConfigBuilder.setIpv4Address(fixedIp.getIpAddress());
dhcpConfigBuilder.setSubnetId(fixedIp.getSubnetId());

Expand All @@ -87,14 +89,6 @@ public void buildDhcpStates(NetworkConfiguration networkConfig, UnicastGoalState

DHCP.DHCPState dhcpState = dhcpStateBuilder.build();
unicastGoalState.getGoalStateBuilder().putDhcpStates(dhcpState.getConfiguration().getId(), dhcpState);

Goalstate.ResourceIdType dhcpResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.DHCP)
.setId(dhcpState.getConfiguration().getId())
.build();
Goalstate.HostResources.Builder hostResourceBuilder = Goalstate.HostResources.newBuilder();
hostResourceBuilder.addResources(dhcpResourceIdType);
unicastGoalState.getGoalStateBuilder().putHostResources(unicastGoalState.getHostIp(), hostResourceBuilder.build());
xieus marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,6 @@ public void buildNeighborStates(NetworkConfiguration networkConfig, String hostI

Neighbor.NeighborState neighborState = buildNeighborState(neighborEntry.getNeighborType(), neighborInfo, networkConfig.getOpType());
unicastGoalState.getGoalStateBuilder().putNeighborStates(neighborState.getConfiguration().getId(), neighborState);

Goalstate.ResourceIdType neighborResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.NEIGHBOR)
.setId(neighborState.getConfiguration().getId())
.build();
Goalstate.HostResources.Builder hostResourceBuilder = Goalstate.HostResources.newBuilder();
hostResourceBuilder.addResources(neighborResourceIdType);
unicastGoalState.getGoalStateBuilder().putHostResources(unicastGoalState.getHostIp(), hostResourceBuilder.build());

multicastNeighborEntries.add(neighborEntry);
}
}
Expand All @@ -277,15 +268,6 @@ public void buildNeighborStates(NetworkConfiguration networkConfig, String hostI
Neighbor.NeighborState neighborState = buildNeighborState(neighborEntry.getNeighborType(), neighborInfo1, networkConfig.getOpType());
multicastGoalState.getGoalStateBuilder().putNeighborStates(neighborState.getConfiguration().getId(), neighborState);

Goalstate.ResourceIdType neighborResourceIdType = Goalstate.ResourceIdType.newBuilder()
.setType(Common.ResourceType.NEIGHBOR)
.setId(neighborState.getConfiguration().getId())
.build();
Goalstate.HostResources.Builder hostResourceBuilder = Goalstate.HostResources.newBuilder();
hostResourceBuilder.addResources(neighborResourceIdType);
// TODO: Change resource id
multicastGoalState.getGoalStateBuilder().putHostResources(unicastGoalState.getHostIp(), hostResourceBuilder.build());

neighborInfoSet.add(neighborInfo1);
}
}
Expand Down
Loading