Skip to content

Commit 0dbeb26

Browse files
Pearl1594Pearl Dsilva
andauthored
server: Support for persistence mode in L2 networks (#4561)
This PR aims at introducing persistence mode in L2 networks and enhancing the behavior in Isolated networks Doc PR apache/cloudstack-documentation#183 Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
1 parent 3783fd5 commit 0dbeb26

File tree

41 files changed

+1259
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1259
-91
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.agent.api;
19+
20+
public class CleanupPersistentNetworkResourceAnswer extends Answer {
21+
public CleanupPersistentNetworkResourceAnswer() {
22+
}
23+
24+
public CleanupPersistentNetworkResourceAnswer(CleanupPersistentNetworkResourceCommand cmd, boolean success, String result) {
25+
super(cmd, success, result);
26+
}
27+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.agent.api;
19+
20+
import com.cloud.agent.api.to.NicTO;
21+
22+
public class CleanupPersistentNetworkResourceCommand extends Command {
23+
NicTO nicTO;
24+
25+
protected CleanupPersistentNetworkResourceCommand() {}
26+
27+
public CleanupPersistentNetworkResourceCommand(NicTO nicTO) {
28+
this.nicTO = nicTO;
29+
}
30+
31+
public NicTO getNicTO() {
32+
return nicTO;
33+
}
34+
35+
public void setNicTO(NicTO nicTO) {
36+
this.nicTO = nicTO;
37+
}
38+
39+
@Override
40+
public boolean executeInSequence() {
41+
return false;
42+
}
43+
}

core/src/main/java/com/cloud/agent/api/MigrateCommand.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class MigrateCommand extends Command {
4040
private boolean executeInSequence = false;
4141
private List<MigrateDiskInfo> migrateDiskInfoList = new ArrayList<>();
4242
private Map<String, DpdkTO> dpdkInterfaceMapping = new HashMap<>();
43+
Map<String, Boolean> vlanToPersistenceMap = new HashMap<>();
4344

4445
public Map<String, DpdkTO> getDpdkInterfaceMapping() {
4546
return dpdkInterfaceMapping;
@@ -49,6 +50,14 @@ public void setDpdkInterfaceMapping(Map<String, DpdkTO> dpdkInterfaceMapping) {
4950
this.dpdkInterfaceMapping = dpdkInterfaceMapping;
5051
}
5152

53+
public Map<String, Boolean> getVlanToPersistenceMap() {
54+
return vlanToPersistenceMap;
55+
}
56+
57+
public void setVlanToPersistenceMap(Map<String, Boolean> vlanToPersistenceMap) {
58+
this.vlanToPersistenceMap = vlanToPersistenceMap;
59+
}
60+
5261
protected MigrateCommand() {
5362
}
5463

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.agent.api;
19+
20+
public class SetupPersistentNetworkAnswer extends Answer {
21+
public SetupPersistentNetworkAnswer(){}
22+
23+
public SetupPersistentNetworkAnswer(SetupPersistentNetworkCommand cmd, boolean success, String result) {
24+
super(cmd, success, result);
25+
}
26+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.agent.api;
19+
20+
import com.cloud.agent.api.to.NicTO;
21+
22+
public class SetupPersistentNetworkCommand extends Command {
23+
24+
NicTO nic;
25+
26+
public SetupPersistentNetworkCommand(NicTO nic) {
27+
this.nic = nic;
28+
}
29+
30+
public NicTO getNic() {
31+
return nic;
32+
}
33+
34+
protected SetupPersistentNetworkCommand() {
35+
}
36+
37+
@Override
38+
public boolean executeInSequence() {
39+
return false;
40+
}
41+
}

core/src/main/java/com/cloud/agent/api/StopCommand.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class StopCommand extends RebootCommand {
3636
String controlIp = null;
3737
boolean forceStop = false;
3838
private Map<String, DpdkTO> dpdkInterfaceMapping;
39+
Map<String, Boolean> vlanToPersistenceMap;
3940

4041
public Map<String, DpdkTO> getDpdkInterfaceMapping() {
4142
return dpdkInterfaceMapping;
@@ -129,4 +130,12 @@ public void setVolumesToDisconnect(List<Map<String, String>> volumesToDisconnect
129130
public List<Map<String, String>> getVolumesToDisconnect() {
130131
return volumesToDisconnect;
131132
}
133+
134+
public Map<String, Boolean> getVlanToPersistenceMap() {
135+
return vlanToPersistenceMap;
136+
}
137+
138+
public void setVlanToPersistenceMap(Map<String, Boolean> vlanToPersistenceMap) {
139+
this.vlanToPersistenceMap = vlanToPersistenceMap;
140+
}
132141
}

core/src/main/java/com/cloud/agent/api/UnPlugNicCommand.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
package com.cloud.agent.api;
2121

22+
import java.util.Map;
23+
2224
import com.cloud.agent.api.to.NicTO;
2325

2426
public class UnPlugNicCommand extends Command {
2527
NicTO nic;
2628
String instanceName;
29+
Map<String, Boolean> vlanToPersistenceMap;
2730

2831
public NicTO getNic() {
2932
return nic;
@@ -45,4 +48,12 @@ public UnPlugNicCommand(NicTO nic, String instanceName) {
4548
public String getVmName() {
4649
return instanceName;
4750
}
51+
52+
public Map<String, Boolean> getVlanToPersistenceMap() {
53+
return vlanToPersistenceMap;
54+
}
55+
56+
public void setVlanToPersistenceMap(Map<String, Boolean> vlanToPersistenceMap) {
57+
this.vlanToPersistenceMap = vlanToPersistenceMap;
58+
}
4859
}

0 commit comments

Comments
 (0)