Skip to content

Editing the network json

mvidner edited this page Sep 25, 2012 · 9 revisions

Editing Network JSON file

Editing the network json is not difficult. The json is located at /opt/dell/barclamps/network/chef/data_bags/crowbar/bc-template-network.json. The file should be edited before the install command is run to create your admin node.

The information you will need:

  1. Vlan ID for each of the VLAN's used by crowbar.
  2. Network subnet for each vlan
  3. Netmask for each vlan
  4. Gateway for the public network and possibly the BMC ranges
  5. This is a section from the json

Example network (admin)

 "admin": {
   "vlan": 100,
   "use_vlan": false,
   "add_bridge": false,
   "subnet": "192.168.124.0",
   "netmask": "255.255.255.0",
   "broadcast": "192.168.124.255",
   "ranges": {
            "admin"
                { "start": "192.168.124.10", "end": "192.168.124.11" },
            "dhcp"
                { "start": "192.168.124.21", "end": "192.168.124.80" },
            "host"
                { "start": "192.168.124.81", "end": "192.168.124.160" },
            "switch"
                { "start": "192.168.124.241", "end": "192.168.124.250" }
   }
 }

As you can see the section is pretty straight forward. The biggest issue that many users hit is putting a comma at the end of the section. Other networks are specified in the same manner. The default file contains a public network, a nova-fixed network, an admin network, and a storage network. These are used by the various barclamps when addresses are needed.

How to add a public IP to a node

From a command prompt on the Admin node, you can execute the following:

  • crowbar network allocate_ip default <machine name> public host

To validate address, you can run:

  • crowbar machines show <machine name>

You should then have your system setup with a public IP. From the admin section above, you could do "admin switch" instead of "public host", and the IP allocated will be from the switch range of the admin network.

Making changes like this may require you to reboot your machine, especially if a bond was used.

To edit the DNS or NTP time server, please modify the DNS and NTP Barclamps.

How to add an external interface for access to the admin node

You will need to do two things prior to installing the admin node. You can see Annotated network json file for more details.

First, you will need to add a new network stanza that defines your external network. We will assume for this example that you have one address that you want to assign to the admin node and you are going to run this as a native (non-tagged) interface.

You make up a vlan number since we aren't going to use it, make sure that use_vlan and add_bridge are false, and the rest of the parameters are correct for your network. The admin range will be used to assign the address to the admin node from this pool. Place the assigned address in the start and end fields. The final field is the conduit field. We make up an unused value to use in the conduit map in step 2. This example uses "bastion1".

Something like this for example.

 "bastion": {
   "conduit": "bastion1",
   "vlan": 50,
   "use_vlan": false,
   "add_bridge": false,
   "subnet": "192.168.235.0",
   "netmask": "255.255.255.0",
   "broadcast": "192.168.235.255",
   "ranges": {
            "admin": { "start": "192.168.235.10", "end": "192.168.235.10" }           
   }
 }

Second, you will need to update the conduit map for you mode. For this example, we will assume that you are in single mode and have a second interface to use.

The normal conduit map for single mode, any role, and any interface (which is what the admin uses by default), looks like this:

      {
        "pattern": "single/.*/.*",
        "conduit_list": {
          "intf0": {
            "if_list": [ "1g1" ]
          },
          "intf1": {
            "if_list": [ "1g1" ]
          },
          "intf2": {
            "if_list": [ "1g1" ]
          }
        }
      },

You will need to add a new entry in this stanza. It looks like this:

          "bastion1": {
            "if_list": [ "1g2" ]
          },

Add it before the intf0 definition. This will ensure commas match and fun JSON stuff.

This tells the node to make a conduit logically called bastion1 on the second physical interface.

Save the network json file and install the admin node. Once the admin node is installed, exit out & log back in.

You will need to do two commands to make sure the node gets this new IP address.

sudo crowbar network allocate_ip default $admin_name bastion admin
sudo chef-client
Once the chef-client has finished, you should have access to the admin node through the new interface.