Giter Club home page Giter Club logo

contrail-virtual-fabric's Introduction

# Contrail Virtual Fabric with vQFX and vMX

Contrail 5.0.2 Fabric Management

# 1 Topology

```
   +-------------+
   |   client    |
   | 172.16.1.10 |
   +-------------+
          |
        br-ext
          |
  +-----------------+-----------------+  +-----------------+-----------------+
  |  xe-0/0/0       |  xe-0/0/1       |  |  xe-0/0/0       |  xe-0/0/1       |
  |  172.16.1.254   |                 |  |                 |                 |
  |                                   |  |                                   |
  | vmx-gw1                           |  | vmx-gw2                           |
  |  em0: 10.6.8.31                   |  |  em0: 10.6.8.32                   |
  |  lo0: 10.6.0.31                   |  |  lo0: 10.6.0.32                   |
  |  ASN: 64031                       |  |  ASN: 64032                       |
  |                                   |  |                                   |
  |  10.6.30.1/30   |  10.6.30.5/30   |  |  10.6.30.9/30   |  10.6.30.13/30  |
  |  xe-0/0/2       |  xe-0/0/3       |  |  xe-0/0/2       |  xe-0/0/3       |
  +-----------------+-----------------+  +-----------------+-----------------+
        |                  |                   |                 |
        |               +--(-------------------+                 |
        |               |  |                                     |
        |               |  +-------------------+                 |
        |               |                      |                 |
  +-----------------+-----------------+  +-----------------+-----------------+
  |  xe-0/0/0       |  xe-0/0/1       |  |  xe-0/0/0       |  xe-0/0/1       |
  |  10.6.30.2/30   |  10.6.30.10/30  |  |  10.6.30.4/30   |  10.6.50.14/30  |
  |                                   |  |                                   |
  | vqfx-spine1                       |  | vqfx-spine2                       |
  |  em0: 10.6.8.21                   |  |  em0: 10.6.8.22                   |
  |  lo0: 10.6.0.21                   |  |  lo0: 10.6.0.22                   |
  |  ASN: 64021                       |  |  ASN: 64022                       |
  |                                   |  |                                   |
  |  10.6.20.1/30   |  10.6.20.5/30   |  |  10.6.20.9/30   |  10.6.20.13/30  |
  |  xe-0/0/2       |  xe-0/0/3       |  |  xe-0/0/2       |  xe-0/0/3       |
  +-----------------+-----------------+  +-----------------+-----------------+
        |                  |                   |                 |
        |               +--(-------------------+                 |
        |               |  |                                     |
        |               |  +-------------------+                 |
        |               |                      |                 |
  +----------------+------------------+  +-----------------------------------+
  |  xe-0/0/0      |  xe-0/0/1        |  |  xe-0/0/0       |  xe-0/0/1       |
  |  10.6.20.2/30  |  10.6.20.10/30   |  |  10.6.20.4/30   |  10.6.20.14/30  |
  |                                   |  |                                   |
  | vqfx-leaf1                        |  | vqfx-leaf2                        |
  |  em0: 10.6.8.11                   |  |  em0: 10.6.8.12                   |
  |  lo0: 10.6.0.11                   |  |  lo0: 10.6.0.12                   |
  |  ASN: 64011                       |  |  ASN: 64012                       |
  |                                   |  |                                   |
  |  xe-0/0/4  |  xe-0/0/2 | xe-0/0/3 |  |  xe-0/0/2  |  xe-0/0/3            |
  +------------+-----------+----------+  +------------+----------------------+
       |              |         |              |            |
       |              |         |              |            |
     br-r1        +-------+     |          +-------+        |
       |          | bms12 |     |          | bms22 |        |
       |          +-------+     |          +-------+        |
       |                        |                           |
  +-----------------------+   +-------------------------------+
  | openstack   10.6.8.1  |   |          bms-dh               |
  | contrail    10.6.8.2  |   +-------------------------------+
  | csn         10.6.8.3  |
  | compute     10.6.8.4  |
  | command     10.6.8.10 |
  +-----------------------+
       |                         management: 10.6.8.0/24
     br-int                      loopback:   10.6.0.0/24
   10.6.8.254                    spine-leaf: 10.6.20.0/24 10.6.30.0/24
       |                         rack-1:     10.6.11.0/24
    HAProxy                      rack-2:     10.6.12.0/24

  Contrail web UI:   https://<host>:8143
  Contrail Command:  https://<host>:9091
  OpenStack Horizon: http://<host>
```


## Resource
```
                  vCPU    memory(GB)    disk(GB)    OS
command             2        32            100      CentOS 7.5-1805
openstack           4        64            100      CentOS 7.5-1805
contrail            4        64            100      CentOS 7.5-1805
csn                 1        16             80      CentOS 7.5-1805
compute             4        32            100      CentOS 7.5-1805
vqfx-leaf1-re       1         1                     Junos 18.1
vqfx-leaf1-pfe      1         2                     Junos 18.1
vqfx-leaf2-re       1         1                     Junos 18.1
vqfx-leaf2-pfe      1         2                     Junos 18.1
vqfx-spine1-re      1         1                     Junos 18.1
vqfx-spine11-pfe    1         2                     Junos 18.1
vqfx-spine1-re      1         1                     Junos 18.1
vqfx-spine11-pfe    1         2                     Junos 18.1
vmx-gw1-vcp         1         1                     Junos 18.3R1
vmx-gw1-vfp         4         2                     Junos 18.3R1
vmx-gw1-vcp         1         1                     Junos 18.3R1
vmx-gw1-vfp         4         2                     Junos 18.3R1
bms12               1         1                     Cirros 0.4.0
bms22               1         1                     Cirros 0.4.0
bms-dh              1         1                     CentOS 7.5-1805
----------------------------------------------------------------
Total              36       214
```


# 2 Build host

## 2.1 Packages

`sshpass` is for SSH to vQFX with password in command line. This is only for initialization. After that, SSH key will be used.

`isc-dhcp-server` is for providing DHCP service to vQFX for initialization. After that, static address will be configured on vQFX.

### Ubuntu 16.04.3 with 256GB memory, 2T disk, 32 vCPU
Install packages.
```
apt-get install sshpass isc-dhcp-server
```

### CentOS 7.5 with 256GB memory, 2T disk, 32 vCPU
Install packages.
```
yum install sshpass dhcp
```

Stop firewalld.
```
systemctl stop firewalld
systemctl disable firewalld
```

### SSH key
Generate SSH key or copy existing key.
```
ssh-keygen
```

## 2.2 Links

### Linux bridge
Doesn't forward LACP packet, can't validate BMS duel-homeing.

### macvtap on veth
Better performance. The MAC in VM has to match the MAC on macvtap interface. For vQFX, it doesn't take the MAC from NIC, have to set MAC in configuration.


## 2.3 SNAT

Enable SNAT on the host for the cluster to access external/internet.

Ensure `ip_forward` is enabled. Otherwise, enable it in `/etc/sysctl.conf`.
```
cat /proc/sys/net/ipv4/ip_forward
```

Add `iptables` rule into NAT table.
```
iptables -t nat -A POSTROUTING -o <nic> -j SNAT --to <address>
```
`nic` is the interface having external connectivity. `address` is the address on `nic`.


## 2.4 vMX

vMX PFE requires hugepage.


## 2.5 vQFX

[vQFX trial](https://www.juniper.net/us/en/dm/free-vqfx-trial/)

[vQFX image download](http://www.juniper.net/support/downloads/?p=vqfxeval#sw)

* Version 18.4, VQFX10K RE Disk Image (qcow2), jinstall-vqfx-10-f-18.4R1.8.qcow2
* Version 17.4, VQFX10K PFE Disk Image, cosim_20180212.qcow2

RE VM supports virtio NIC. PFE VM has to be e1000 NIC.

Customize the origin RE VM to add configuration for root password, SSH and NETCONF services, and DHCP on em0 interface.


# 3 Build POC

* vQFX PFE image and customized RE image.
* vMX image.
* CentOS image `CentOS-7-x86_64-GenericCloud-1805.qcow2`.
* Cirros image `cirros-0.4.0-x86_64-disk.img`.
* Playbook `contrail-ansible-deployer-5.0.tgz`.
* Script `vf`, `contrail-command`.
* command_servers.yml, instances.yaml

```
vf create-bridge
vf launch-vqfx
vf launch-vmx
```

```
vf configure-vqfx
vf configure-vmx
```
Underlay is done.

``
vf launch-builder
```

```
vf build-cluster
vf install-command
vf launch-command
```

# 4 Post deployment

### Enable HAProxy

This for accessing cluster, like web UI, API, etc.
```
apt-get install haproxy
```


contrail-virtual-fabric's People

Contributors

suntech-lab avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.