Skip to content

Commit 99f75db

Browse files
author
Jayapal
committed
Fixed vpc private gateway backend issues
1 parent 648a724 commit 99f75db

3 files changed

Lines changed: 24 additions & 11 deletions

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ public Answer executeRequest(Command cmd) {
563563
public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) {
564564
Pair<Boolean, String> result;
565565
try {
566+
s_logger.debug("Executing command in VR: /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args);
566567
result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
567568
60000, 60000, timeout * 1000);
568569
} catch (Exception e) {

‎server/src/com/cloud/network/vpc/VpcManagerImpl.java‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,10 +1653,14 @@ public PrivateGateway applyVpcPrivateGateway(long gatewayId, boolean destroyOnFa
16531653

16541654
boolean success = true;
16551655
try {
1656+
List<Provider> providersToImplement = getVpcProviders(vo.getVpcId());
1657+
16561658
PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
16571659
for (VpcProvider provider : getVpcElements()) {
1658-
if (!provider.createPrivateGateway(gateway)) {
1659-
success = false;
1660+
if (providersToImplement.contains(provider.getProvider())) {
1661+
if (!provider.createPrivateGateway(gateway)) {
1662+
success = false;
1663+
}
16601664
}
16611665
}
16621666
if (success) {
@@ -1715,17 +1719,20 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
17151719
});
17161720

17171721
//1) delete the gateway on the backend
1722+
List<Provider> providersToImplement = getVpcProviders(gatewayVO.getVpcId());
17181723
PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
17191724
for (VpcProvider provider : getVpcElements()) {
1720-
if (provider.deletePrivateGateway(gateway)) {
1721-
s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
1722-
} else {
1723-
s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
1724-
gatewayVO.setState(VpcGateway.State.Ready);
1725-
_vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
1726-
s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
1725+
if (providersToImplement.contains(provider.getProvider())) {
1726+
if (provider.deletePrivateGateway(gateway)) {
1727+
s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
1728+
} else {
1729+
s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
1730+
gatewayVO.setState(VpcGateway.State.Ready);
1731+
_vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
1732+
s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
17271733

1728-
return false;
1734+
return false;
1735+
}
17291736
}
17301737
}
17311738

‎systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ acl_entry_for_guest_network() {
155155
dflag=0
156156
gflag=0
157157
aflag=0
158+
mflag=0
158159
rules=""
159160
rules_list=""
160161
dev=""
161-
while getopts 'd:a:' OPTION
162+
mac=""
163+
while getopts 'd:a:M:' OPTION
162164
do
163165
case $OPTION in
164166
d) dflag=1
@@ -167,6 +169,9 @@ do
167169
a) aflag=1
168170
rules="$OPTARG"
169171
;;
172+
M) mflag=1
173+
mac="$OPTARG"
174+
;;
170175
?) usage
171176
unlock_exit 2 $lock $locked
172177
;;

0 commit comments

Comments
 (0)