Ubuntu 24.04
Sponsored Link

OpenStack Caracal : Neutron कॉन्फ़िगर करें #22024/05/21

 

OpenStack नेटवर्क सेवा (Neutron) कॉन्फ़िगर करें।

यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है।
यदि आप किसी अन्य होस्ट पर Neutron सेवाएं स्थापित करना चाहते हैं, तो यहां देखें.

ओपन वर्चुअल नेटवर्क (OVN) के साथ Neutron सेवाओं को कॉन्फ़िगर करें।

        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     |
+-----------------------+

[1] Neutron सेवाएँ स्थापित करें।
root@dlp ~(keystone)#
apt -y install neutron-server neutron-plugin-ml2 neutron-ovn-metadata-agent python3-neutronclient ovn-central ovn-host openvswitch-switch
[2] Neutron सेवाएँ कॉन्फ़िगर करें।
root@dlp ~(keystone)#
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org

root@dlp ~(keystone)#
vi /etc/neutron/neutron.conf
# नया निर्माण

[DEFAULT]
bind_host = 127.0.0.1
bind_port = 9696
core_plugin = ml2
service_plugins = ovn-router
auth_strategy = keystone
state_path = /var/lib/neutron
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
# RabbitMQ कनेक्शन जानकारी
transport_url = rabbit://openstack:password@dlp.srv.world:5672

# Keystone प्रामाणिक जानकारी
[keystone_authtoken]
www_authenticate_uri = https://dlp.srv.world:5000
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = servicepassword
# यदि Apache2 Keystone पर स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो [true] पर जाएँ
insecure = false

[database]
connection = mysql+pymysql://neutron:password@dlp.srv.world:3306/neutron_ml2

[nova]
auth_url = https://dlp.srv.world:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = nova
password = servicepassword
# यदि Apache2 Keystone पर स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो [true] पर जाएँ
insecure = false

[oslo_concurrency]
lock_path = $state_path/tmp

[oslo_policy]
enforce_new_defaults = true

root@dlp ~(keystone)#
chmod 640 /etc/neutron/neutron.conf

root@dlp ~(keystone)#
chgrp neutron /etc/neutron/neutron.conf
root@dlp ~(keystone)#
mv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.org

root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini
# नया निर्माण

[DEFAULT]
debug = false

[ml2]
type_drivers = flat,geneve
tenant_network_types = geneve
mechanism_drivers = ovn
extension_drivers = port_security
overlay_ip_version = 4

[ml2_type_geneve]
vni_ranges = 1:65536
max_header_size = 38

[ml2_type_flat]
flat_networks = *

[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

[ovn]
ovn_nb_connection = tcp:10.0.0.30:6641
ovn_sb_connection = tcp:10.0.0.30:6642
ovn_l3_scheduler = leastloaded
ovn_metadata_enabled = True

root@dlp ~(keystone)#
chmod 640 /etc/neutron/plugins/ml2/ml2_conf.ini

root@dlp ~(keystone)#
chgrp neutron /etc/neutron/plugins/ml2/ml2_conf.ini
root@dlp ~(keystone)#
vi /etc/neutron/neutron_ovn_metadata_agent.ini
[DEFAULT]
# पंक्ति 2 : Nova API होस्ट निर्दिष्ट करने के लिए जोड़ें
nova_metadata_host = dlp.srv.world
nova_metadata_protocol = https
# अपनी पसंद की कोई भी गुप्त कुंजी निर्दिष्ट करें
metadata_proxy_shared_secret = metadata_secret

# पंक्ति 263 : परिवर्तन
[ovs]
ovsdb_connection = tcp:127.0.0.1:6640

# अंत में जोड़ें
[agent]
root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf

[ovn]
ovn_sb_connection = tcp:10.0.0.30:6642

root@dlp ~(keystone)#
vi /etc/default/openvswitch-switch
# पंक्ति 8 : टिप्पणी हटाएं और इस प्रकार जोड़ें

OVS_CTL_OPTS=
"--ovsdb-server-options='--remote=ptcp:6640:127.0.0.1'"
root@dlp ~(keystone)#
vi /etc/nova/nova.conf
# [DEFAULT] अनुभाग में अनुसरण जोड़ें

vif_plugging_is_fatal = True
vif_plugging_timeout = 300

# अंत में निम्न जोड़ें : Neutron प्रामाणिक जानकारी
# [metadata_proxy_shared_secret] का मान [metadata_agent.ini] के मान के समान है
[neutron]
auth_url = https://dlp.srv.world:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = servicepassword
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
insecure = false
[3] प्रॉक्सी सेटिंग्स के लिए Nginx कॉन्फ़िगर करें।
root@dlp ~(keystone)#
vi /etc/nginx/nginx.conf
# [stream] अनुभाग में जोड़ें

stream {
    upstream glance-api {
        server 127.0.0.1:9292;
    }
    server {
        listen 10.0.0.30:9292 ssl;
        proxy_pass glance-api;
    }
    upstream nova-api {
        server 127.0.0.1:8774;
    }
    server {
        listen 10.0.0.30:8774 ssl;
        proxy_pass nova-api;
    }
    upstream nova-metadata-api {
        server 127.0.0.1:8775;
    }
    server {
        listen 10.0.0.30:8775 ssl;
        proxy_pass nova-metadata-api;
    }
    upstream placement-api {
        server 127.0.0.1:8778;
    }
    server {
        listen 10.0.0.30:8778 ssl;
        proxy_pass placement-api;
    }
    upstream novncproxy {
        server 127.0.0.1:6080;
    }
    server {
        listen 10.0.0.30:6080 ssl;
        proxy_pass novncproxy;
    }
    upstream neutron-api {
        server 127.0.0.1:9696;
    }
    server {
        listen 10.0.0.30:9696 ssl;
        proxy_pass neutron-api;
    }
    ssl_certificate "/etc/letsencrypt/live/dlp.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/dlp.srv.world/privkey.pem";
}
[4] Neutron सेवाएँ प्रारंभ करें।
root@dlp ~(keystone)#
systemctl restart openvswitch-switch

root@dlp ~(keystone)#
ovs-vsctl add-br br-int
root@dlp ~(keystone)#
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

root@dlp ~(keystone)#
su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head"
root@dlp ~(keystone)#
systemctl restart ovn-central ovn-northd ovn-controller ovn-host

root@dlp ~(keystone)#
ovn-nbctl set-connection ptcp:6641:10.0.0.30 -- set connection . inactivity_probe=60000

root@dlp ~(keystone)#
ovn-sbctl set-connection ptcp:6642:10.0.0.30 -- set connection . inactivity_probe=60000

root@dlp ~(keystone)#
ovs-vsctl set open . external-ids:ovn-remote=tcp:10.0.0.30:6642

root@dlp ~(keystone)#
ovs-vsctl set open . external-ids:ovn-encap-type=geneve

root@dlp ~(keystone)#
ovs-vsctl set open . external-ids:ovn-encap-ip=10.0.0.30

root@dlp ~(keystone)#
ovs-vsctl set open . external-ids:ovn-cms-options=enable-chassis-as-gw

root@dlp ~(keystone)#
systemctl restart neutron-server neutron-ovn-metadata-agent nova-api nova-compute nginx
# स्थिति दिखाओ

root@dlp ~(keystone)#
openstack network agent list

+-----------+------------+-----------+-------------------+-------+-------+--------------+
| ID        | Agent Type | Host      | Availability Zone | Alive | State | Binary       |
+-----------+------------+-----------+-------------------+-------+-------+--------------+
| 589edb29- | OVN        | dlp.srv.w |                   | :-)   | UP    | neutron-ovn- |
| 2c5d-     | Metadata   | orld      |                   |       |       | metadata-    |
| 59c6-     | agent      |           |                   |       |       | agent        |
| 985e-     |            |           |                   |       |       |              |
| a3a4a9326 |            |           |                   |       |       |              |
| 7c5       |            |           |                   |       |       |              |
| c4bac074- | OVN        | dlp.srv.w |                   | :-)   | UP    | ovn-         |
| 1b13-     | Controller | orld      |                   |       |       | controller   |
| 4175-     | agent      |           |                   |       |       |              |
| 8002-     |            |           |                   |       |       |              |
| f83fbadf6 |            |           |                   |       |       |              |
| e33       |            |           |                   |       |       |              |
+-----------+------------+-----------+-------------------+-------+-------+--------------+
मिलान सामग्री