From b9b00f336f20bad8bc58b325172ebf9c71c83b6a Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Fri, 5 Oct 2018 09:52:06 +0200 Subject: [baremetal] Add two interfaces to the opnfv vm opnfv vm requires connectivity to two physical interfaces of the host. These interfaces are: 1 - admin, where DHCP requests will arrive from blades to do PXE boot 2 - mgmt, which connects to the mgmt of the blades to do the ansible configuration To achive this, it is required: 1 - Two libvirt networks that connect to two different linux bridges. The important physical interfaces are connected to them. The interfaces name is fetched from the idf 2 - Two templates representing the new libvirt networks (net-mgmt.xml.j2 and net-admin.xml.j2) 3 - Two interfaces defined in vm.xml.j2 Change-Id: I9037aa36802cfde44717b9394bab79b22d7dfaab Signed-off-by: Manuel Buil --- xci/playbooks/roles/create-nodes/defaults/main.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'xci/playbooks/roles/create-nodes/defaults/main.yml') diff --git a/xci/playbooks/roles/create-nodes/defaults/main.yml b/xci/playbooks/roles/create-nodes/defaults/main.yml index 6ac266a5..b03f1386 100644 --- a/xci/playbooks/roles/create-nodes/defaults/main.yml +++ b/xci/playbooks/roles/create-nodes/defaults/main.yml @@ -9,11 +9,12 @@ vm_default_groups: "{{ lookup('env', 'DEFAULT_HOST_GROUPS').split() | default([' vm_disk_cache: unsafe node_names: "{{ lookup('env', 'NODE_NAMES').split() }}" -# NOTE(pas-ha) name and default are chosen to be the same -# as in 'bifrost-ironic-install' role -network_interface: "virbr0" -# NOTE(pas-ha) these correspond to settings for the libvirt network created by default -vm_network: "{{ lookup('env', 'VM_NET_BRIDGE') | default('default', true) }}" +network_bridge_admin: 'br-admin' +network_bridge_mgmt: 'br-mgmt' + +vm_network_admin: "{{ lookup('env', 'VM_NET_BRIDGE') | default('admin', true) }}" +vm_network_mgmt: "{{ lookup('env', 'VM_NET_BRIDGE_MGMT') | default('mgmt', true) }}" + node_network_netmask: "255.255.255.0" node_storage_pool: "{{ lookup('env', 'LIBVIRT_STORAGE_POOL') | default('default', true) }}" @@ -25,3 +26,5 @@ vm_emulator: "/usr/bin/qemu-system-x86_64" vm_libvirt_uri: "{{ lookup('env', 'LIBVIRT_CONNECT_URI') | default('qemu:///system', true) }}" opnfv_image_path: "/var/lib/libvirt/images" + +libvirt_networks: "{{ (baremetal | bool) | ternary([vm_network_admin,vm_network_mgmt],[vm_network_admin]) }}" -- cgit 1.2.3-korg