# 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: ![](/assets/guides/add_a_new_datacenter.png) ## Creating a datacenter record using the CLI To create a datacenter using the CLI create a configuration file. It can be in yaml or json formats: ```yaml #DC Agents primary IP BSIVRRPListenIPv4: 172.16.10.6 #DC Agents secondary IP list (comma separated) BSIMachineListenIPv4List: - 172.16.10.6 #DC Agents IPs subnet, in CIDR format (x.x.x.x/x) BSIMachinesSubnetIPv4CIDR: 172.16.10.6/24 #This is the ip from which the controller will #see the incoming connections from this datacenter's DC agents 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 agent will not resolve the DNS record. repoURLRoot: http:// #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:// #This is the TFTP DC Agent'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: {} #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 ``` ```bash 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 ```