Debian 12 bookworm
Sponsored Link

OpenStack Zed : Configure Magnum (Network Node)2023/06/30

 
Install OpenStack Container Infrastructure Management Service (Magnum).
This example is based on the environment like follows.
Install Magnum services on Network Node.
------------+--------------------------+--------------------------+------------
            |                          |                          |
        eth0|10.0.0.30             eth0|10.0.0.50             eth0|10.0.0.51
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |  |  [ node01.srv.world ] |
|     (Control Node)    |  |     (Network Node)    |  |     (Compute Node)    |
|                       |  |                       |  |                       |
|  MariaDB    RabbitMQ  |  |  Neutron L2/L3 Agent  |  |        Libvirt        |
|  Memcached  Nginx     |  |   Neutron Metadata    |  |      Nova Compute     |
|  Keystone   httpd     |  |     Open vSwitch      |  |    Neutron L2 Agent   |
|  Glance     Nova API  |  |     iSCSI Target      |  |      Open vSwitch     |
|  Neutron Server       |  |     Cinder Volume     |  |                       |
|  Neutron Metadata     |  |    Heat API/Engine    |  |                       |
|  Cinder API           |  |         Nginx         |  |                       |
|  Barbican API         |  |    Magnum Services    |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Install Magnum services on Network Node. For questions during the installation, it's OK with [No] to All.
root@network:~#
apt -y install magnum-api magnum-conductor python3-magnumclient nginx libnginx-mod-stream
[2] Configure Magnum.
root@network:~#
mv /etc/magnum/magnum.conf /etc/magnum/magnum.conf.org

root@network:~#
vi /etc/magnum/magnum.conf
# create new

[DEFAULT]
state_path = /var/lib/magnum
log_dir = /var/log/magnum
# RabbitMQ connection info
transport_url = rabbit://openstack:password@dlp.srv.world

[api]
host = 127.0.0.1
port = 9511
enabled_ssl = false

[database]
# MariaDB connection info
connection = mysql+pymysql://magnum:password@dlp.srv.world/magnum

[certificates]
cert_manager_type = barbican

[cinder]
default_docker_volume_type = lvm-magnum

[cinder_client]
region_name = RegionOne

[magnum_client]
region_name = RegionOne

# Keystone auth info
[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
auth_version = v3
project_domain_name = default
user_domain_name = default
project_name = service
username = magnum
password = servicepassword
admin_user = magnum
admin_password = servicepassword
admin_tenant_name = service

[oslo_policy]
enforce_scope = false
enforce_new_defaults = false

[oslo_messaging_notifications]
driver = messagingv2

[trust]
trustee_domain_name = magnum
trustee_domain_admin_name = magnum_domain_admin
trustee_domain_admin_password = servicepassword
trustee_keystone_interface = public

root@network:~#
chmod 640 /etc/magnum/magnum.conf

root@network:~#
chgrp magnum /etc/magnum/magnum.conf

root@network:~#
mkdir /var/lib/magnum/{tmp,certificates}

root@network:~#
chown magnum:magnum /var/lib/magnum/{tmp,certificates}

root@network:~#
sed -i -e "s/UWSGI_BIND_IP=\"\"/UWSGI_BIND_IP=\"127.0.0.1\"/" /etc/init.d/magnum-api

[3] Get valid SSL/TLS certificate or Create self-signed certificate for Network Node and configure Nginx for proxy settings.
root@network:~#
unlink /etc/nginx/sites-enabled/default

root@network:~#
vi /etc/nginx/nginx.conf
# add to the end

stream {
    upstream magnum-api {
        server 127.0.0.1:9511;
    }
    server {
        listen 10.0.0.50:9511 ssl;
        proxy_pass magnum-api;
    }
    ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem";
}
[4] Add Data into Database and start Magnum services.
root@network:~#
su -s /bin/bash magnum -c "magnum-db-manage upgrade"

root@network:~#
systemctl restart magnum-api magnum-conductor

root@network:~#
systemctl enable magnum-api magnum-conductor

root@network:~#
systemctl restart nginx

[5] Verify Magnum status on Control Node. It's OK if state is [up].
Also Create a Cinder volume type configured in [magnum.conf].
root@dlp ~(keystone)#
apt -y install python3-magnumclient
root@dlp ~(keystone)#
openstack coe service list

+----+------+------------------+-------+----------+-----------------+---------------------------+---------------------------+
| id | host | binary           | state | disabled | disabled_reason | created_at                | updated_at                |
+----+------+------------------+-------+----------+-----------------+---------------------------+---------------------------+
|  1 | None | magnum-conductor | up    | False    | None            | 2023-06-30T06:48:11+00:00 | 2023-06-30T06:48:11+00:00 |
+----+------+------------------+-------+----------+-----------------+---------------------------+---------------------------+

root@dlp ~(keystone)#
openstack volume type create lvm-magnum --public

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| description | None                                 |
| id          | 4f1a48bd-faf6-4aa3-bb1e-a194017e7593 |
| is_public   | True                                 |
| name        | lvm-magnum                           |
+-------------+--------------------------------------+
Matched Content