OpenStack Victoria : ネットワークを構成する2020/10/19 |
仮想マシンインスタンスが利用するネットワークを構成します。
All in One 構成の Neutron サービス
または ノード毎に分離設定した Neutron サービスを事前に構成済みであることが前提です。
当例では、以下のような All in One 構成の環境を前提に、シンプルな FLAT タイプのネットワークを構成します。
また、ノードはネットワークインターフェースを二つ持っているものとします。 eth0|10.0.0.30 +-----------+-----------+ | [ Control Node ] | | | | MariaDB RabbitMQ | | Memcached httpd | | Keystone Glance | | Nova API,Compute | | Neutron Server | | L2,L3,Metadata Agent | +-----------+-----------+ eth1|(UP with no IP) |
[1] | Neutron サービスに追加設定します。 |
# IP なしインターフェース起動ファイル作成 # インターフェース名 [eth1] は自身の環境に置き換え root@dlp ~(keystone)# vi /etc/systemd/network/eth1.network [Match] Name=eth1 [Network] LinkLocalAddressing=no IPv6AcceptRA=no
root@dlp ~(keystone)#
systemctl restart systemd-networkd
root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini # 206行目:追記 [ml2_type_flat]
flat_networks = physnet1
root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini # 190行目:追記 [linux_bridge]
physical_interface_mappings = physnet1:eth1
# 257行目:コメント解除して変更 enable_vxlan = false
systemctl restart neutron-linuxbridge-agent |
[2] | 仮想ネットワークを構成します。 |
root@dlp ~(keystone)#
projectID=$(openstack project list | grep service | awk '{print $2}') # [sharednet1] という名称の仮想ネットワーク作成 root@dlp ~(keystone)# openstack network create --project $projectID \ --share --provider-network-type flat --provider-physical-network physnet1 sharednet1 +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | UP | | availability_zone_hints | | | availability_zones | | | created_at | 2020-10-19T03:53:34Z | | description | | | dns_domain | None | | id | 5317a0bf-3df8-42e8-93c2-45134fb7b645 | | ipv4_address_scope | None | | ipv6_address_scope | None | | is_default | False | | is_vlan_transparent | None | | mtu | 1500 | | name | sharednet1 | | port_security_enabled | True | | project_id | 37197271a1954ddb90207a95d5f46488 | | provider:network_type | flat | | provider:physical_network | physnet1 | | provider:segmentation_id | None | | qos_policy_id | None | | revision_number | 1 | | router:external | Internal | | segments | None | | shared | True | | status | ACTIVE | | subnets | | | tags | | | updated_at | 2020-10-19T03:53:34Z | +---------------------------+--------------------------------------+ # [sharednet1] に [10.0.0.0/24] のサブネット追加 root@dlp ~(keystone)# openstack subnet create subnet1 --network sharednet1 \ --project $projectID --subnet-range 10.0.0.0/24 \ --allocation-pool start=10.0.0.200,end=10.0.0.254 \ --gateway 10.0.0.1 --dns-nameserver 10.0.0.10 +----------------------+--------------------------------------+ | Field | Value | +----------------------+--------------------------------------+ | allocation_pools | 10.0.0.200-10.0.0.254 | | cidr | 10.0.0.0/24 | | created_at | 2020-10-19T03:54:17Z | | description | | | dns_nameservers | 10.0.0.10 | | dns_publish_fixed_ip | None | | enable_dhcp | True | | gateway_ip | 10.0.0.1 | | host_routes | | | id | fc5038ba-9d82-4367-99ac-d1f63ec75372 | | ip_version | 4 | | ipv6_address_mode | None | | ipv6_ra_mode | None | | name | subnet1 | | network_id | 5317a0bf-3df8-42e8-93c2-45134fb7b645 | | prefix_length | None | | project_id | 37197271a1954ddb90207a95d5f46488 | | revision_number | 0 | | segment_id | None | | service_types | | | subnetpool_id | None | | tags | | | updated_at | 2020-10-19T03:54:17Z | +----------------------+--------------------------------------+ # 設定確認 root@dlp ~(keystone)# openstack network list +--------------------------------------+------------+--------------------------------------+ | ID | Name | Subnets | +--------------------------------------+------------+--------------------------------------+ | 5317a0bf-3df8-42e8-93c2-45134fb7b645 | sharednet1 | fc5038ba-9d82-4367-99ac-d1f63ec75372 | +--------------------------------------+------------+--------------------------------------+root@dlp ~(keystone)# openstack subnet list +--------------------------------------+---------+--------------------------------------+-------------+ | ID | Name | Network | Subnet | +--------------------------------------+---------+--------------------------------------+-------------+ | fc5038ba-9d82-4367-99ac-d1f63ec75372 | subnet1 | 5317a0bf-3df8-42e8-93c2-45134fb7b645 | 10.0.0.0/24 | +--------------------------------------+---------+--------------------------------------+-------------+ |
Sponsored Link |
|