Deploying MetalSoft on a flat L2 network

MetalSoft can also be deployed on networks with no switches, in a flat L2 broadcast domain. This setup is very simple and requires minimal hardware.


Environment configuration

  1. Since our software will allocate entire subnets to users from the WAN subnet pool, but on a flat L2 network there is a single gateway, an “override” property is used to force the DHCP agent to provide the correct gateway irrespective of the subnet pool.

The wan_gateway_override and the wan_subnet_override need to be configured in the environment config:

 "wan_subnet_override" : "",
 "wan_subnet_override" : "",
  1. If the system requires servers with a single interface enable allowServersWithOneInterface and allowTFTPBootThroughWAN flags on the environment configuration on the controller.

Create the datacenter:

Create the following datacenter config file: datacenter.yaml:

    dataLakeEnabled: false
    #This property configures the datacenter to work as a flat L2 network
    datacenterNetworkIsLayer2Only: true
    #These settings are actually ignored by the switch simulator
        ACLSAN: 3999
        ACLWAN: 3399
        NorthWANVLANRange: 1001-2000
        SANACLRange: 3700-3998
        ToRLANVLANRange: 400-699
        ToRSANVLANRange: 700-999
        ToRWANVLANRange: 100-300
        quarantineVLANID: 5
        type: VPLSProvisioner
    #This needs to be configured if the username and password on the server BMC should not be automatically changed at register time and should instead be requested from the user
    serverRegisterUsingGeneratedIPMICredentialsEnabled: false
metalcloud-cli  datacenter create --id us-reston --title US,Reston --config dc-hpe-reston.yml --format yaml

Create WAN subnets

Create the following WAN subnet config file subnet-pool-wan.yaml

datacenter: te-test
size: 27
type: ipv4
routable: true
destination: wan
metalcloud-cli subnet-pool create --config subnet-pool-wan.yaml --format yaml

Create a “dummy” switch

Create the following switch config file switch.yaml:

#the hostname of the switch
identifierString: SWITCH_SIMULATOR_1111
description: ToR switch
#the datacenter label
datacenterName: te-test

driver: dummy
provisionerType: vpls
provisionerPosition: tor

#connection details. This can be in-band management iP or the out-of-band. In this setup we used the out of band
managementProtocol: ssh
managementPort: 22
managementUsername: admin
managementPassword: XXX

#Used if switch will go through ONIE imaging
#managementMACAddress: 00:00:00:00:00:00

#Network address (first IP) of the WAN IPv6 subnet.
#These will be the IPs that will be allocated to hosts
#that need to be reachable from outside an infrastructure
#Both Ipv4 and IPv6 IPs are allocated to servers
#The IPv6 subnet will be automatically created
primaryWANIPv6SubnetPool: fd1f:8bbb:56b3:2000:0000:0000:1000:0000
#Subnet size of the above subnet. If it is fd1f:8bbb:56b3:2000:0000:0000:1000:0000/53 in CIRD notation this number will be 53
primaryWANIPv6SubnetPrefixSize: 53

#Network address (first IP) of the SAN subnet.
#By default, the SAN subnet has a netmask of 21.
primarySANSubnetPrefixSize: 21

#This IP range is used as a hack to
#prevent downtime during dynamic provisioning of ports (since we have multiple secondary IPs on the same interface)
#the traffic is not routed to these IPs.
#The real IPv4 WAN subnet pool needs to be added using the subnets tab.
#Subnet size of the above subnet. If it is in CIRD notation this number will be 22
primaryWANIPv4SubnetPrefixSize: 22

# The pool from which to allocate ips to servers during registration
#the subnet size (CIDR) of the above pool
quarantineSubnetPrefixSize: 24
#the IP of the SVI in the quarantine network

#Set to true to enable ONIE for this switch.
requiresOSInstall: false
#Set this to the ID of the volume template that holds the ONIE image
volumeTemplateID: 0

Install pre-requisites on the datacenter agent machine

On the datacenter agent machine execute the following:

yum -y install epel-release
#this is required only for troubleshooting
#yum -y install libselinux-python vim-enhanced wget screen tmux mc telnet mtr traceroute git tcpdump links parted xfsprogs ntp htop bash-completion psmisc bwm-ng yum-protectbase
yum -y install device-mapper-persistent-data lvm2
wget -O /etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce
wget -O /usr/local/bin/docker-compose
chmod u+x,g+x /usr/local/bin/docker-compose
systemctl enable docker
systemctl start docker
mkdir -p /root/agents /opt/BSIAgentsVolume /opt/Agent_logs /opt/agents /opt/containerd

#disable firewall
iptables -F
#disable selinux
set enforce 0 

Login to the docker repository. Username and password are provided by the Metalsoft team

docker login

Get the datacenter agent URL

$ metalcloud-cli datacenter get -id ro-bucharest --return-config-url

Configure the datacenter agents

Retrieve the datacenter auto-config URL using the metalcloud-cli:

metalcloud-cli datacenter get -id us-reston --return-config-url

On the datacenter agents machine create an environment variable with the URL

export DCCONF=``

On the datacenter agent machine create the following docker-compose.yml:

version: '3'
    network_mode: host
    container_name: dc-agents
    restart: always
    privileged: true
      - /opt/BSIAgentsVolume:/etc/BSIDatacenterAgents
      - /opt/Agent_logs:/var/log/
      - /opt/.ssh:/root/.ssh
      - TZ=Etc/UTC
      - URL=${DCCONF}
    hostname: agents-onie
    network_mode: host
    container_name: dc-haproxy
    restart: always
    privileged: true
    #this is in case you need to override the default haproxy configuration
    #for example when you need to add SSL certificates
      - /root/agents/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
      #This needs to match your hostname. It is a configuration file that changes the default behaviour of the entire environment
      - /root/agents/
      - TZ=Etc/UTC
    hostname: dc-haproxy

Bring the agents up

docker-compose up -d

Check the logs

tail -f /var/log/*

Branding support

To enable custom email branding set the following environment setting: franchiseDomainToRAPIDExportDomain to root