mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7857: Added netwrork usage create command to router start command
status 7857: resolved fixed
This commit is contained in:
parent
e7d0ad3d3a
commit
956b678ed4
@ -21,6 +21,7 @@ package com.cloud.agent.api;
|
||||
public class NetworkUsageCommand extends Command {
|
||||
private String privateIP;
|
||||
private String domRName;
|
||||
private String option;
|
||||
|
||||
protected NetworkUsageCommand() {
|
||||
|
||||
@ -31,6 +32,13 @@ public class NetworkUsageCommand extends Command {
|
||||
this.privateIP = privateIP;
|
||||
this.domRName = domRName;
|
||||
}
|
||||
|
||||
public NetworkUsageCommand(String privateIP, String domRName, String option)
|
||||
{
|
||||
this.privateIP = privateIP;
|
||||
this.domRName = domRName;
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
public String getPrivateIP() {
|
||||
return privateIP;
|
||||
@ -40,6 +48,10 @@ public class NetworkUsageCommand extends Command {
|
||||
return domRName;
|
||||
}
|
||||
|
||||
public String getOption() {
|
||||
return option;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
@ -959,16 +959,6 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (vmSpec.getType() == VirtualMachine.Type.DomainRouter) {
|
||||
// Create network usage rules for domR
|
||||
NicTO[] nics = vmSpec.getNics();
|
||||
for (NicTO nic : nics) {
|
||||
if(nic.getType() == TrafficType.Control){
|
||||
networkUsage(conn, nic.getIp(), "create", null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
state = State.Running;
|
||||
return new StartAnswer(cmd);
|
||||
|
||||
@ -1206,6 +1206,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
//Resend user data
|
||||
s_logger.debug("Reapplying user data entries as a part of domR " + router + " start...");
|
||||
createUserDataCommands(router, cmds);
|
||||
// Network usage command to create iptables rules
|
||||
cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getName(), "create"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user