Fixed vpc private gateway backend issues

This commit is contained in:
Jayapal 2014-05-07 16:16:14 +05:30 committed by Daan Hoogland
parent da97f3f6e5
commit adcc21ef3b
3 changed files with 24 additions and 11 deletions

View File

@ -567,6 +567,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) {
Pair<Boolean, String> result;
try {
s_logger.debug("Executing command in VR: /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args);
result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
60000, 60000, timeout * 1000);
} catch (Exception e) {

View File

@ -1653,10 +1653,14 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
boolean success = true;
try {
List<Provider> providersToImplement = getVpcProviders(vo.getVpcId());
PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
for (VpcProvider provider : getVpcElements()) {
if (!provider.createPrivateGateway(gateway)) {
success = false;
if (providersToImplement.contains(provider.getProvider())) {
if (!provider.createPrivateGateway(gateway)) {
success = false;
}
}
}
if (success) {
@ -1715,17 +1719,20 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
});
//1) delete the gateway on the backend
List<Provider> providersToImplement = getVpcProviders(gatewayVO.getVpcId());
PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
for (VpcProvider provider : getVpcElements()) {
if (provider.deletePrivateGateway(gateway)) {
s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
} else {
s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
gatewayVO.setState(VpcGateway.State.Ready);
_vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
if (providersToImplement.contains(provider.getProvider())) {
if (provider.deletePrivateGateway(gateway)) {
s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
} else {
s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
gatewayVO.setState(VpcGateway.State.Ready);
_vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
return false;
return false;
}
}
}

View File

@ -155,10 +155,12 @@ acl_entry_for_guest_network() {
dflag=0
gflag=0
aflag=0
mflag=0
rules=""
rules_list=""
dev=""
while getopts 'd:a:' OPTION
mac=""
while getopts 'd:a:M:' OPTION
do
case $OPTION in
d) dflag=1
@ -167,6 +169,9 @@ do
a) aflag=1
rules="$OPTARG"
;;
M) mflag=1
mac="$OPTARG"
;;
?) usage
unlock_exit 2 $lock $locked
;;