plumb hpc_client_ip through to vCPE docker container
diff --git a/xos/cord/models.py b/xos/cord/models.py
index 7ef63c4..a7a05c0 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -224,7 +224,8 @@
"nat_ip",
"lan_ip",
"wan_ip",
- "private_ip")
+ "private_ip",
+ "hpc_client_ip")
default_attributes = {"firewall_enable": False,
"firewall_rules": "accept all anywhere anywhere",
@@ -464,6 +465,8 @@
addresses["private"] = ns.ip
elif "nat" in ns.network.name.lower():
addresses["nat"] = ns.ip
+ elif "hpc_client" in ns.network.name.lower():
+ addresses["hpc_client"] = ns.ip
return addresses
@property
@@ -482,6 +485,10 @@
def private_ip(self):
return self.addresses.get("private",None)
+ @property
+ def hpc_client_ip(self):
+ return self.addresses.get("hpc_client",None)
+
def pick_node(self):
nodes = list(Node.objects.all())
# TODO: logic to filter nodes by which nodes are up, and which
diff --git a/xos/observers/vcpe/steps/sync_vcpetenant.yaml b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
index 0dc9f48..6decb95 100644
--- a/xos/observers/vcpe/steps/sync_vcpetenant.yaml
+++ b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
@@ -24,6 +24,7 @@
lan_ip: {{ lan_ip }}
wan_ip: {{ wan_ip }}
private_ip: {{ private_ip }}
+ hpc_client_ip: {{ hpc_client_ip }}
tasks:
- name: Docker repository
diff --git a/xos/observers/vcpe/templates/start-vcpe.sh.j2 b/xos/observers/vcpe/templates/start-vcpe.sh.j2
old mode 100755
new mode 100644
index 7863b2f..ab1b6f3
--- a/xos/observers/vcpe/templates/start-vcpe.sh.j2
+++ b/xos/observers/vcpe/templates/start-vcpe.sh.j2
@@ -14,6 +14,7 @@
# Set up networking via pipework
docker exec vcpe ifconfig eth0 >> /dev/null || pipework eth4 -i eth0 vcpe {{ wan_ip }}/17@192.168.128.1
docker exec vcpe ifconfig eth1 >> /dev/null || pipework eth3 -i eth1 vcpe 192.168.0.1/24 @{{ vlan_ids[0] }}
+docker exec vcpe ifconfig eth2 >> /dev/null || pipework eth1 -i eth2 vcpe {{ hpc_client_ip }}/16
# Now can start up dnsmasq
docker exec vcpe service dnsmasq start