mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
bug 3120: incremental checkin
This commit is contained in:
parent
437f717633
commit
a9c96b4da0
@ -1330,33 +1330,26 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
|
||||
|
||||
String args = null;
|
||||
|
||||
if(guestIp!=null)
|
||||
{
|
||||
args += " -G ";
|
||||
args += guestIp;
|
||||
args += " -l ";
|
||||
args += publicIpAddress;
|
||||
args += " -i ";
|
||||
args += privateIpAddress;
|
||||
if (add) {
|
||||
args = "-A";
|
||||
} else {
|
||||
args = "-D";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (add) {
|
||||
args = "-A";
|
||||
} else {
|
||||
args = "-D";
|
||||
}
|
||||
if (sourceNat) {
|
||||
args += " -f";
|
||||
}
|
||||
args += " -i ";
|
||||
args += privateIpAddress;
|
||||
args += " -l ";
|
||||
args += publicIpAddress;
|
||||
args += " -c ";
|
||||
args += "eth" + correctVif.getDevice(conn);
|
||||
args += " -g ";
|
||||
args += vlanGateway;
|
||||
if (sourceNat) {
|
||||
args += " -f";
|
||||
}
|
||||
args += " -i ";
|
||||
args += privateIpAddress;
|
||||
args += " -l ";
|
||||
args += publicIpAddress;
|
||||
args += " -c ";
|
||||
args += "eth" + correctVif.getDevice(conn);
|
||||
args += " -g ";
|
||||
args += vlanGateway;
|
||||
|
||||
if(guestIp!=null){
|
||||
args += " -G ";
|
||||
args += guestIp;
|
||||
}
|
||||
|
||||
String result = callHostPlugin("vmops", "ipassoc", "args", args);
|
||||
|
||||
@ -62,6 +62,8 @@ add_one_to_one_nat_entry() {
|
||||
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
iptables -A FORWARD -i $eth2 -o $eth1 -d $guestIp -m state --state NEW -j ACCEPT
|
||||
iptables -A FORWARD -i $eth1 -o $eth2 -s $guestIp -m state --state NEW -j ACCEPT
|
||||
"
|
||||
return $?
|
||||
}
|
||||
|
||||
#Add the NAT entries into iptables in the routing domain
|
||||
@ -173,7 +175,7 @@ do
|
||||
correctVif="$OPTARG"
|
||||
;;
|
||||
G) Gflag=1
|
||||
guestIp = "$OPTARG"
|
||||
guestIp="$OPTARG"
|
||||
;;
|
||||
?) usage
|
||||
exit 2
|
||||
@ -181,6 +183,14 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
#1:1 NAT
|
||||
if [ "$Gflag" == "1" ] && [ "$fflag" == "1" ] && [ "$Aflag" == "1" ]
|
||||
then
|
||||
add_nat_entry $domRIp $publicIp
|
||||
add_one_to_one_nat_entry $guestIp $publicIp $domRIp
|
||||
exit $?
|
||||
fi
|
||||
|
||||
#Either the A flag or the D flag but not both
|
||||
if [ "$Aflag$Dflag" != "1" ]
|
||||
then
|
||||
@ -200,13 +210,6 @@ then
|
||||
exit 3
|
||||
fi
|
||||
|
||||
#1:1 NAT
|
||||
if [ "$Gflag" == "1" ]
|
||||
then
|
||||
add_one_to_one_nat_entry $guestIp $publicIp $domRIp
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ "$fflag" == "1" ] && [ "$Aflag" == "1" ]
|
||||
then
|
||||
add_nat_entry $domRIp $publicIp
|
||||
@ -232,4 +235,3 @@ then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
@ -71,7 +71,11 @@ public class AssociateIPAddrCmd extends BaseCmd {
|
||||
Long userId = (Long)params.get(BaseCmd.Properties.USER_ID.getName());
|
||||
String accountName = (String)params.get(BaseCmd.Properties.ACCOUNT.getName());
|
||||
Long domainId = (Long)params.get(BaseCmd.Properties.DOMAIN_ID.getName());
|
||||
Long vmId = (Long)params.get(BaseCmd.Properties.VIRTUAL_MACHINE_ID.getName());
|
||||
Long vmId = (Long)params.get(BaseCmd.Properties.VIRTUAL_MACHINE_ID.getName());
|
||||
|
||||
//todo REMOVE
|
||||
//vmId = new Long(3);
|
||||
|
||||
String newIpAddr = null;
|
||||
String errorDesc = null;
|
||||
Long accountId = null;
|
||||
|
||||
@ -62,7 +62,7 @@ public class AssociateIpAddressExecutor extends BaseAsyncJobExecutor {
|
||||
} else {
|
||||
try {
|
||||
String ipAddress = managementServer.associateIpAddress(param.getUserId(), param.getAccountId(),
|
||||
param.getDomainId(), param.getZoneId());
|
||||
param.getDomainId(), param.getZoneId(), 0);
|
||||
asyncMgr.completeAsyncJob(getJob().getId(), AsyncJobResult.STATUS_SUCCEEDED, 0,
|
||||
composeResultObject(managementServer, param, ipAddress));
|
||||
} catch (ResourceAllocationException e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user