OpenStack Caracal : ネットワークを構成する2024/08/06 |
仮想マシンインスタンスが利用するネットワークを構成します。 All in One 構成の Neutron サービス または ノード毎に分離設定した Neutron サービスを事前に構成済みであることが前提です。
当例では、以下のような All in One 構成の環境を前提に、シンプルな FLAT タイプのネットワークを構成します。 eth0|10.0.0.30 +-----------+-----------+ | [ dlp.srv.world ] | | (Control Node) | | | | MariaDB RabbitMQ | | Memcached Nginx | | Keystone httpd | | Glance Nova API | | Nova Compute | | Neutron Server | | Open vSwitch | | OVN Metadata Agent | | OVN-Controller | +-----------+-----------+ eth1|(UP with no IP) |
[1] | Neutron サービスに追加設定します。 |
# ブリッジ追加 [root@dlp ~(keystone)]# ovs-vsctl add-br br-eth1
# 追加したブリッジのポートに [eth1] を追加 # [eth1] は環境によって異なるため自身の環境に置き換え [root@dlp ~(keystone)]# ovs-vsctl add-port br-eth1 eth1
# ブリッジと [physnet1] をマッピング : [physnet1] の名称は任意 [root@dlp ~(keystone)]# ovs-vsctl set open . external-ids:ovn-bridge-mappings=physnet1:br-eth1
|
[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 | 2024-08-06T01:35:58Z | | description | | | dns_domain | None | | id | 03d69fb5-74c0-4273-874e-e2fd0af17339 | | 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 | 0b826f1bf49d489494e94badc32f2cea | | 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 | | | tenant_id | 0b826f1bf49d489494e94badc32f2cea | | updated_at | 2024-08-06T01:35:58Z | +---------------------------+--------------------------------------+ # [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 | 2024-08-06T01:36:35Z | | description | | | dns_nameservers | 10.0.0.10 | | dns_publish_fixed_ip | None | | enable_dhcp | True | | gateway_ip | 10.0.0.1 | | host_routes | | | id | cff78758-3fdc-450c-9cec-3b8b3b6cb44b | | ip_version | 4 | | ipv6_address_mode | None | | ipv6_ra_mode | None | | name | subnet1 | | network_id | 03d69fb5-74c0-4273-874e-e2fd0af17339 | | project_id | 0b826f1bf49d489494e94badc32f2cea | | revision_number | 0 | | segment_id | None | | service_types | | | subnetpool_id | None | | tags | | | updated_at | 2024-08-06T01:36:35Z | +----------------------+--------------------------------------+ # 設定確認 [root@dlp ~(keystone)]# openstack network list +--------------------------------------+------------+--------------------------------------+ | ID | Name | Subnets | +--------------------------------------+------------+--------------------------------------+ | 03d69fb5-74c0-4273-874e-e2fd0af17339 | sharednet1 | cff78758-3fdc-450c-9cec-3b8b3b6cb44b | +--------------------------------------+------------+--------------------------------------+[root@dlp ~(keystone)]# openstack subnet list +--------------------------------------+---------+--------------------------------------+-------------+ | ID | Name | Network | Subnet | +--------------------------------------+---------+--------------------------------------+-------------+ | cff78758-3fdc-450c-9cec-3b8b3b6cb44b | subnet1 | 03d69fb5-74c0-4273-874e-e2fd0af17339 | 10.0.0.0/24 | +--------------------------------------+---------+--------------------------------------+-------------+ |
Sponsored Link |
|