Update documentation for creating the provider network to use the openstack client as opposed to the neutron client. Also updated the output of the client after creating the network / subnet. Change-Id: I1094ac695c23b1c1f03027677697fd90f0f1bace
7.1 KiB
Provider network
Before launching an instance, you must create the necessary virtual network infrastructure. For networking option 1, an instance uses a provider (external) network that connects to the physical network infrastructure via layer-2 (bridging/switching). This network includes a DHCP server that provides IP addresses to instances.
The admin or other privileged user must create this
network because it connects directly to the physical network
infrastructure.
Note
The following instructions and diagrams use example IP address ranges. You must adjust them for your particular environment.
Create the provider network
On the controller node, source the
admincredentials to gain access to admin-only CLI commands:$ . admin-openrcCreate the network:
$ openstack network create --share \ --provider-physical-network provider \ --provider-network-type flat provider Created a new network: +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | UP | | availability_zone_hints | | | availability_zones | | | created_at | 2016-11-02T20:36:18Z | | description | | | headers | | | id | 9793a02d-4f05-40d2-a280-407c48db0161 | | ipv4_address_scope | None | | ipv6_address_scope | None | | mtu | 1500 | | name | provider | | port_security_enabled | True | | project_id | 7e188c33604d4b02ae0a99b5da68cae0 | | provider:network_type | flat | | provider:physical_network | provider | | provider:segmentation_id | None | | revision_number | 3 | | router:external | Internal | | shared | True | | status | ACTIVE | | subnets | | | tags | [] | | updated_at | 2016-11-02T20:36:18Z | +---------------------------+--------------------------------------+The
--shareoption allows all projects to use the virtual network.The
--provider-physical-network providerand--provider-network-type flatoptions connect the flat virtual network to the flat (native/untagged) physical network on theeth1interface on the host using information from the following files:ml2_conf.ini:[ml2_type_flat] flat_networks = providerlinuxbridge_agent.ini:[linux_bridge] physical_interface_mappings = provider:eth1Create a subnet on the network:
$ openstack subnet create --network provider \ --allocation-pool start=START_IP_ADDRESS,end=END_IP_ADDRESS \ --dns-nameserver DNS_RESOLVER --gateway PROVIDER_NETWORK_GATEWAY \ --subnet-range PROVIDER_NETWORK_CIDR providerReplace
PROVIDER_NETWORK_CIDRwith the subnet on the provider physical network in CIDR notation.Replace
START_IP_ADDRESSandEND_IP_ADDRESSwith the first and last IP address of the range within the subnet that you want to allocate for instances. This range must not include any existing active IP addresses.Replace
DNS_RESOLVERwith the IP address of a DNS resolver. In most cases, you can use one from the/etc/resolv.conffile on the host.Replace
PROVIDER_NETWORK_GATEWAYwith the gateway IP address on the provider network, typically the ".1" IP address.Example
The provider network uses 203.0.113.0/24 with a gateway on 203.0.113.1. A DHCP server assigns each instance an IP address from 203.0.113.101 to 203.0.113.250. All instances use 8.8.4.4 as a DNS resolver.
$ openstack subnet create --network provider \ --allocation-pool start=203.0.113.101,end=203.0.113.250 \ --dns-nameserver 8.8.4.4 --gateway 203.0.113.1 \ --subnet-range 203.0.113.0/24 provider Created a new subnet: +-------------------+--------------------------------------+ | Field | Value | +-------------------+--------------------------------------+ | allocation_pools | 203.0.113.101-203.0.113.250 | | cidr | 203.0.113.0/24 | | created_at | 2016-11-02T20:45:04Z | | description | | | dns_nameservers | 8.8.4.4 | | enable_dhcp | True | | gateway_ip | 203.0.113.1 | | headers | | | host_routes | | | id | 2c65ef8c-a5f3-4f51-94c1-4df0daaaab5c | | ip_version | 4 | | ipv6_address_mode | None | | ipv6_ra_mode | None | | name | provider | | network_id | 9793a02d-4f05-40d2-a280-407c48db0161 | | project_id | 7e188c33604d4b02ae0a99b5da68cae0 | | revision_number | 2 | | service_types | [] | | subnetpool_id | None | | updated_at | 2016-11-02T20:45:04Z | +-------------------+--------------------------------------+
Return to Launch an instance - Create virtual networks
<launch-instance-networks>.