Adding a new datacenter

Datacenters are the root object for almost all elements that MetalSoft operates with:

  • Servers

  • Switches

  • Storages

  • Subnets

Creating a datacenter record using the UI

To create a datacenter using the UI go to Datacenters > Create new datacenter button:

Creating a datacenter record using the CLI

Using the CLI

To create a datacenter using the CLI create a configuration file. It can be in yaml or json formats:

#Site Controller primary IP
BSIVRRPListenIPv4: 172.16.10.6
#Site Controller secondary IP list (comma separated)
BSIMachineListenIPv4List: 
    - 172.16.10.6
#Site Controller IPs subnet, in CIDR format (x.x.x.x/x)
BSIMachinesSubnetIPv4CIDR: 172.16.10.6/24

#IP of the NFS server, typically the same as the Site Controller's primary IP  
NFSServer: 172.16.10.6

#This is the ip from which the controller will
#see the incoming connections from this datacenter's Site Controller
BSIExternallyVisibleIPv4:  83.246.0.140

#HTTP(S) root URL for the general purpose HTTP repository 
#(package manager resources, deploy setup files, etc.). It does not end in a slash.
#Make sure the DNSServers property below includes a server that will be authoritative for the domainname listed here otherwise the Site Controller will not resolve the DNS record.
repoURLRoot: http://<repo>

#Repo URL root for the quarantine network (installation network) where DNS is not available yet. 
#Must not contain a DNS entry. it is usually the ip to which the above resolves 
#to that is reachable from the quarantine network
repoURLRootQuarantineNetwork: http://<repo>

#This is the TFTP Site Controller's ip. This is usually the same as BSIVRRPListenIPv4
TFTPServerWANVRRPListenIPv4: 172.16.10.6

#The IP range of the storage arrays in your network
SANRoutedSubnet: 100.96.0.0/16

NTPServers:
    - 84.40.58.44
    - 84.40.58.45

DNSServers:
    #Make sure this resolves the url at repoURLRoot
    - 84.40.63.27

#This setting controls the tenant isolation mechanism

switchProvisioner:    
    #Must be one of LANProvisioner, VPLSProvisioner, VLANProvisioner
    type: VPLSProvisioner    
    #The ACL number for SAN ports
    ACLSAN: 3999
    #The ACL number for WAN ports
    ACLWAN: 3399
    #The ACL range for ACL rules on the SAN ports. Per switch
    SANACLRange: 3700-3998
    #The VLAN Range for LAN networks, per ToR switch. Make sure these don't overlap.
    ToRLANVLANRange: 400-699
    #The VLAN Range for SAN networks, per ToR switch. Make sure these don't overlap.
    ToRSANVLANRange: 700-999
    #The VLAN Range for WAN networks, per ToR switch. Make sure these don't overlap.
    ToRWANVLANRange: 100-300
    #The VLAN to use for quarantine network
    quarantineVLANID: 5
    #VLAN Range for WAN ports 'North' switches.
    NorthWANVLANRange: 1001-2000

#Allowed BMC MAC addresses
dhcpBMCMACAddressWhitelist: []

#DHCP option 82 mapping
Option82ToIPMapping: {}

# Default method to deploy OS on servers
defaultDeploymentMechanism: virtual_media

# Set default cleanup policy
defaultServerCleanupPolicyID: 0

# Set default network profiles
defaultWANNetworkProfileID: 0
defaultLANNetworkProfileID: 0
defaultSANNetworkProfileID: 0

# Set default cleanup and registration mechanism bmc / bdk
defaultCleanupAndRegistrationMechanism: bmc

# Set minimum number of switch connected interfaces
serverMinimumNumberOfSwitchConnectedInterfaces: 1

# Set default gNMI subscription status
gNMISubscriptionEnabled: false

#switchProvisioner:    
#    type: VLANProvisioner
#    #The VLAN to use for quarantine network
#    quarantineVLANID: 5
#    #VLAN range for WAN networks
#    WANVLANRange: 100-199
#    #VLAN range for LAN networks
#    LANVLANRange: 200-299
metalcloud-cli datacenter create --raw-config examples/datacenter.yaml --format yaml --id alex-test-1 --title "Alex Test 1" --return-id

Updating a datacenter configuration using the CLI

Retrieve the current configuration and save it to a file current-config.yml

metalcloud-cli datacenter get -id us02-chi-qts01-dc --format yaml > current-config.yml

Modify the configuration then re-apply it:

metalcloud-cli datacenter update -id us02-chi-qts01-dc --format yaml --config current-config.yml