diff options
author | Manuel Buil <mbuil@suse.com> | 2018-10-05 09:52:06 +0200 |
---|---|---|
committer | Manuel Buil <mbuil@suse.com> | 2018-10-15 15:57:32 +0000 |
commit | b9b00f336f20bad8bc58b325172ebf9c71c83b6a (patch) | |
tree | ef647fabc31ab694bbd5966d09e9064ebbf0d4bb /xci/playbooks/roles/create-nodes/templates/vm.xml.j2 | |
parent | eab5448287464ca3900a3e7495e27ac1a2cf1dc9 (diff) |
[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 <mbuil@suse.com>
Diffstat (limited to 'xci/playbooks/roles/create-nodes/templates/vm.xml.j2')
-rw-r--r-- | xci/playbooks/roles/create-nodes/templates/vm.xml.j2 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 index e4e41eda..6061fc52 100644 --- a/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 +++ b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 @@ -36,10 +36,21 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='network'> - <source network='{{ vm_network }}'/> + <source network='{{ vm_network_admin }}'/> <model type='{{ vm_nic }}'/> + {%- if vm_name == 'opnfv' -%} <mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}'/> + {%- else -%} + <mac address='{{ item.1.interfaces[idf.net_config.admin.interface].mac_address }}'/> + {%- endif -%} </interface> + {%- if baremetal | bool -%} + <interface type='network'> + <source network='{{ vm_network_mgmt }}'/> + <model type='{{ vm_nic }}'/> + <mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.mgmt.interface].mac_address }}'/> + </interface> + {%- endif -%} <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <video> |