Skip to content
Snippets Groups Projects
Commit 09717c19 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

feat: Use conditional to make --network optional

Closes #181

Defining a network can be optional when a port is already defined when
deploying a VM.

This commit adds flexibility where you can either use --port or
--network options to define a network during the deployment.

Alternatively, you can define both but the port cannot be from the same
network you used in the --network option. Otherwise, you will have two
ips from the same network which will cause network reachability issues.
parent cd35517c
No related branches found
No related tags found
2 merge requests!175Resolve SSH proxy routing hang in prod by fixing dual IP assignment on same network.,!117This MR merges the feat-hpc-factory branch, which was focused on building and deploying proxy images for the COD cluster.
......@@ -206,12 +206,12 @@ deploy_http_proxy_node:
export cmd="openstack server create"
cmd+=" -c id -f value --image $HTTP_PROXY_IMAGE_ID"
cmd+=" --flavor $INSTANCE_FLAVOR"
cmd+=" --network $PROXY_NETWORK"
for security_group in ${SECURITY_GROUP_LIST[@]};
do
cmd+=" --security-group $security_group"
done
cmd+=" --user-data user_data.txt"
if [ -n "$PROXY_NETWORK" ];then cmd+=" --network $PROXY_NETWORK"; fi
if [ -n "$HTTP_PROXY_PORT" ];then cmd+=" --port $HTTP_PROXY_PORT"; fi
cmd+=" --wait $HTTP_PROXY_INSTANCE_NAME"
- export HTTP_PROXY_INSTANCE_ID=$(bash -c "$cmd")
......@@ -259,12 +259,12 @@ deploy_ssh_proxy_node:
export cmd="openstack server create"
cmd+=" -c id -f value --image $SSH_PROXY_IMAGE_ID"
cmd+=" --flavor $INSTANCE_FLAVOR"
cmd+=" --network $PROXY_NETWORK"
for security_group in ${SECURITY_GROUP_LIST[@]};
do
cmd+=" --security-group $security_group"
done
cmd+=" --user-data user_data.txt"
if [ -n "$PROXY_NETWORK" ];then cmd+=" --network $PROXY_NETWORK"; fi
if [ -n "$SSH_PROXY_PORT" ];then cmd+=" --port $SSH_PROXY_PORT"; fi
cmd+=" --wait $SSH_PROXY_INSTANCE_NAME"
- export SSH_PROXY_INSTANCE_ID=$(bash -c "$cmd")
......@@ -313,12 +313,12 @@ deploy_login_node:
export cmd="openstack server create"
cmd+=" -c id -f value --image $LOGIN_IMAGE_ID"
cmd+=" --flavor $INSTANCE_FLAVOR"
cmd+=" --network $INSTANCE_NETWORK"
for security_group in ${SECURITY_GROUP_LIST[@]};
do
cmd+=" --security-group $security_group"
done
cmd+=" --user-data user_data.txt"
if [ -n "$INSTANCE_NETWORK" ];then cmd+=" --network $INSTANCE_NETWORK"; fi
if [ -n "$LOGIN_PORT" ];then cmd+=" --port $LOGIN_PORT"; fi
cmd+=" --wait $LOGIN_INSTANCE_NAME"
- export LOGIN_INSTANCE_ID=$(bash -c "$cmd")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment