def _create_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
subnet = self.alloc_retrieve_subnet_info(tenant_id, direc)<EOL>network = self.retrieve_network_info(tenant_id, direc)<EOL>net_id, subnet_id = self.create_openstack_network(subnet, network,<EOL>tenant_id,<EOL>tenant_name, direc)<EOL>if not net_id or not subnet_id:<EOL><INDENT>return net_id, subnet_id<EOL><DEDENT>self.allocate_seg_vlan(net_id, is_fw_virt, direc, tenant_id)<EOL>self.update_subnet_db_info(tenant_id, direc, net_id, subnet_id)<EOL>return net_id, subnet_id<EOL>
Function to create Openstack network.

        This function does the following:
        1. Allocate an IP address with the net_id/subnet_id not filled in the
           DB.
        2. Fill network parameters w/o vlan, segmentation_id, because we don't
           have net_id to store in DB.
        3. Create a Openstack network, using the network parameters created in
           the previous step. At this point we will have a net_id.
        4. Allocate segmentation_id, vlan and along with net_id store it in the
           DB.
        5. Update IP DB with net_id created in step 3. So, after restart
           deallocate any IP DB entries that does not have a net_id/subnet_id.