Skip to content

Network of InfraSIM on VirtualBox

ForrestGu edited this page Nov 7, 2016 · 2 revisions

InfraSIM now provides encapsulated infrasim-compute applications in box. You can fetch this box via a Vagrantfile we shall provide later, or build such a box with the Packer template infrasim-box.json in infrasim tools.

In this situation, 4 networks are in use:

  • 1st enp0s3 is for Vagrant adminstration
  • 2nd enp0s8 is for vitual BMC
  • 3rd enp0s9 is for virtual compute, specifially for PXE
  • 4th enp0s10 is virtual compute's data network

To enable 4 networks in virtualbox, we need to write infrasim vagrant file to add 3 more networks besides vagrant administration network:

# add three nics for bmc, control and data
config.vm.network "private_network", virtualbox__intnet: "closednet", nic_type:"82540EM", auto_config: false
config.vm.network "private_network", virtualbox__intnet: "closednet", nic_type:"82540EM", auto_config: false
config.vm.network "public_network", auto_config: false

So we have virtualbox instance: 1.jpeg

We also write in /etc/network/interfaces to ensure ubuntu leverage these networks:

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet dhcp

auto enp0s8
iface enp0s8 inet dhcp

auto enp0s9
iface enp0s9 inet static
address 0.0.0.0

auto enp0s10
iface enp0s10 inet static
address 0.0.0.0

auto br0
iface br0 inet dhcp
bridge_ports enp0s9
bridge_fd 0
bridge_hello 1
bridge_stp off

auto br1
iface br1 inet dhcp
bridge_ports enp0s10
bridge_fd 0
bridge_hello 1
bridge_stp off

source /etc/network/interfaces.d/*.cfg

When you vagrant up infrasim box independently, you can see network like this: 2.jpeg

We write the /usr/local/infrasim/etc/infrasim.yml when we use packer to build box. So when we start infrasim-compute application, with the configuration of infrasim.yml, things looks like this: 3.jpeg

Again, you can fetch this box via a Vagrantfile we shall provide later, or build such a box with the Packer template infrasim-box.json in infrasim tools.

With RackHD, we connect both 2nd and 3rd network to RackHD's control network. You can get an environment like this: 4.jpeg

Please start such environment with RackHD example This feature is in PR#xx now, and NOT merged yet. We will fix this message once the PR is merged.