Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-17297 - Add IPv6 support #56

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,26 @@ virsh = sudo virsh --connect=$(VIRSH_CONNECT)

SEED_VM_NAME ?= seed
SEED_DOMAIN ?= $(NET_SEED_DOMAIN)
SEED_VM_IP ?= 192.168.126.10
SEED_VERSION ?= 4.15.2
SEED_MAC ?= 52:54:00:ee:42:e1

ifdef IPV6
SEED_VM_IP ?= fdfa:bada:faba:da::10
else
SEED_VM_IP ?= 192.168.126.10
endif

RECIPIENT_VM_NAME ?= recipient
RECIPIENT_DOMAIN ?= $(NET_RECIPIENT_DOMAIN)
RECIPIENT_VM_IP ?= 192.168.127.99
RECIPIENT_VERSION ?= 4.14.14
RECIPIENT_MAC ?= 52:54:00:fa:ba:da

ifdef IPV6
RECIPIENT_VM_IP ?= fdfa:bada:faba:db::99
else
RECIPIENT_VM_IP ?= 192.168.127.99
endif

UPGRADE_TIMEOUT ?= 30m

LIBVIRT_IMAGE_PATH := $(or ${LIBVIRT_IMAGE_PATH},/var/lib/libvirt/images)
Expand Down Expand Up @@ -140,6 +150,7 @@ seed-vm-create: RELEASE_VERSION=$(SEED_VERSION)
seed-vm-create: MAC_ADDRESS=$(SEED_MAC)
seed-vm-create: BASE_DOMAIN=$(SEED_DOMAIN)
seed-vm-create: NET_NAME=$(NET_SEED_NAME)
seed-vm-create: NET_TYPE=$(NET_SEED_TYPE)
seed-vm-create: NET_BRIDGE_NAME=$(NET_SEED_BRIDGE_NAME)
seed-vm-create: NET_MAC=$(NET_SEED_MAC)
seed-vm-create: NET_UUID=$(NET_SEED_UUID)
Expand Down Expand Up @@ -206,6 +217,7 @@ recipient-vm-create: RELEASE_VERSION=$(RECIPIENT_VERSION)
recipient-vm-create: MAC_ADDRESS=$(RECIPIENT_MAC)
recipient-vm-create: BASE_DOMAIN=$(RECIPIENT_DOMAIN)
recipient-vm-create: NET_NAME=$(NET_RECIPIENT_NAME)
recipient-vm-create: NET_TYPE=$(NET_RECIPIENT_TYPE)
recipient-vm-create: NET_BRIDGE_NAME=$(NET_RECIPIENT_BRIDGE_NAME)
recipient-vm-create: NET_MAC=$(NET_RECIPIENT_MAC)
recipient-vm-create: NET_UUID=$(NET_RECIPIENT_UUID)
Expand Down Expand Up @@ -273,7 +285,10 @@ start-iso-abi: checkenv bip-orchestrate-vm check-old-net network
VM_NAME=$(VM_NAME) \
HOST_IP=$(HOST_IP) \
HOST_MAC=$(MAC_ADDRESS) \
NET_TYPE=$(NET_TYPE) \
HOST_ROUTE=$(shell $(virsh) net-dumpxml $(NET_NAME) | grep '<ip ' | xargs -n1 | grep address | cut -d = -f 2) \
NET_PREFIX=$(shell $(virsh) net-dumpxml $(NET_NAME) | grep '<ip ' | xargs -n1 | grep prefix | cut -d = -f 2 | tr -d '>') \
NET_DEFAULTROUTE=$(shell $(virsh) net-dumpxml $(NET_NAME) | grep '<ip ' | xargs -n1 | grep address | grep -q : && echo ::/0 || echo 0.0.0.0/0) \
envsubst > $(shell pwd)/agent-config-$(VM_NAME).yaml
make -C $(SNO_DIR) $@ \
VM_NAME=$(VM_NAME) \
Expand All @@ -290,6 +305,7 @@ start-iso-abi: checkenv bip-orchestrate-vm check-old-net network
RAM_MB=$(RAM_MB) \
BASE_DOMAIN=$(BASE_DOMAIN) \
NET_NAME=$(NET_NAME) \
NET_TYPE=$(NET_TYPE) \
NET_BRIDGE_NAME=$(NET_BRIDGE_NAME) \
NET_UUID=$(NET_UUID) \
NET_MAC=$(NET_MAC)
Expand All @@ -298,6 +314,7 @@ start-iso-abi: checkenv bip-orchestrate-vm check-old-net network
fi

# Network used for the seed VM
seed-network: NET_TYPE=$(NET_SEED_TYPE)
seed-network: NET_NAME=$(NET_SEED_NAME)
seed-network: NET_UUID=$(NET_SEED_UUID)
seed-network: NET_BRIDGE_NAME=$(NET_SEED_BRIDGE_NAME)
Expand All @@ -307,6 +324,7 @@ seed-network: BASE_DOMAIN=$(NET_SEED_DOMAIN)
seed-network: network

# Network used for the recipients (recipient and ibi)
recipient-network: NET_TYPE=$(NET_RECIPIENT_TYPE)
recipient-network: NET_NAME=$(NET_RECIPIENT_NAME)
recipient-network: NET_UUID=$(NET_RECIPIENT_UUID)
recipient-network: NET_BRIDGE_NAME=$(NET_RECIPIENT_BRIDGE_NAME)
Expand All @@ -318,6 +336,7 @@ recipient-network: network
# Call network creation in bip-orchestrate-vm repo
network: check-old-net
make -C $(SNO_DIR) $@ \
NET_TYPE=$(NET_TYPE) \
NET_NAME=$(NET_NAME) \
NET_UUID=$(NET_UUID) \
NET_BRIDGE_NAME=$(NET_BRIDGE_NAME) \
Expand Down
8 changes: 4 additions & 4 deletions agent-config-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ hosts:
type: ethernet
state: up
mac-address: ${HOST_MAC}
ipv4:
${NET_TYPE}:
enabled: true
address:
- ip: ${HOST_IP}
prefix-length: 24
prefix-length: ${NET_PREFIX}
routes:
config:
- next-hop-address: ${HOST_ROUTE}
next-hop-interface: eno1
destination: 0.0.0.0/0
destination: ${NET_DEFAULTROUTE}
dns-resolver:
config:
server:
- ${HOST_ROUTE}
- ${HOST_ROUTE}
44 changes: 32 additions & 12 deletions network.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
NET_SEED_NAME ?= ib-orchestrate-0
NET_SEED_BRIDGE_NAME ?= ibo0
NET_SEED_DOMAIN ?= ibo0.redhat.com
NET_SEED_UUID ?= 268ce8c5-afa5-4076-8c48-963db001bf7d
NET_SEED_MAC ?= 52:54:00:1b:1b:00
NET_SEED_NETWORK ?= 192.168.126.0/24
ifdef IPV6
NET_SEED_TYPE=ipv6
NET_SEED_NAME ?= ib-orchestrate-2
NET_SEED_BRIDGE_NAME ?= ibo2
NET_SEED_DOMAIN ?= ibo2.redhat.com
NET_SEED_UUID ?= 3cb1b02d-0f93-4a21-9998-a108c618dcac
NET_SEED_MAC ?= 52:54:00:1b:1b:02
NET_SEED_NETWORK ?= fdfa:bada:faba:da::/64

NET_RECIPIENT_NAME ?= ib-orchestrate-1
NET_RECIPIENT_BRIDGE_NAME ?= ibo1
NET_RECIPIENT_DOMAIN ?= ibo1.redhat.com
NET_RECIPIENT_UUID ?= 12a4d419-dd03-43c2-8414-ad3339913c02
NET_RECIPIENT_MAC ?= 52:54:00:1b:1b:01
NET_RECIPIENT_NETWORK ?= 192.168.127.0/24
NET_RECIPIENT_TYPE=ipv6
NET_RECIPIENT_NAME ?= ib-orchestrate-3
NET_RECIPIENT_BRIDGE_NAME ?= ibo3
NET_RECIPIENT_DOMAIN ?= ibo3.redhat.com
NET_RECIPIENT_UUID ?= 01320196-98ec-4eda-ac81-a4f4b34a957c
NET_RECIPIENT_MAC ?= 52:54:00:1b:1b:03
NET_RECIPIENT_NETWORK ?= fdfa:bada:faba:db::/64
else
NET_SEED_TYPE=ipv4
NET_SEED_NAME ?= ib-orchestrate-0
NET_SEED_BRIDGE_NAME ?= ibo0
NET_SEED_DOMAIN ?= ibo0.redhat.com
NET_SEED_UUID ?= 268ce8c5-afa5-4076-8c48-963db001bf7d
NET_SEED_MAC ?= 52:54:00:1b:1b:00
NET_SEED_NETWORK ?= 192.168.126.0/24

NET_RECIPIENT_TYPE=ipv4
NET_RECIPIENT_NAME ?= ib-orchestrate-1
NET_RECIPIENT_BRIDGE_NAME ?= ibo1
NET_RECIPIENT_DOMAIN ?= ibo1.redhat.com
NET_RECIPIENT_UUID ?= 12a4d419-dd03-43c2-8414-ad3339913c02
NET_RECIPIENT_MAC ?= 52:54:00:1b:1b:01
NET_RECIPIENT_NETWORK ?= 192.168.127.0/24
endif

# So vim treats this file as a makefile
# vim: set filetype=make: