OpenStack Zed : Configure Nova #22023/06/27 |
Install and Configure OpenStack Compute Service (Nova).
This example is based on the environment like follows.
eth0|10.0.0.30 +-----------+-----------+ | [ dlp.srv.world ] | | (Control Node) | | | | MariaDB RabbitMQ | | Memcached Nginx | | Keystone httpd | | Glance Nova API | +-----------------------+ |
[1] | Install Nova. That's OK to answer [No] to questions during the installation. |
root@dlp ~(keystone)# apt -y install nova-api nova-conductor nova-scheduler nova-novncproxy placement-api python3-novaclient
|
[2] | Configure Nova. |
root@dlp ~(keystone)# mv /etc/nova/nova.conf /etc/nova/nova.conf.org
root@dlp ~(keystone)#
vi /etc/nova/nova.conf # create new [DEFAULT] osapi_compute_listen = 127.0.0.1 osapi_compute_listen_port = 8774 metadata_listen = 127.0.0.1 metadata_listen_port = 8775 state_path = /var/lib/nova enabled_apis = osapi_compute,metadata log_dir = /var/log/nova # RabbitMQ connection info transport_url = rabbit://openstack:password@dlp.srv.world [api] auth_strategy = keystone [vnc] enabled = True novncproxy_host = 127.0.0.1 novncproxy_port = 6080 novncproxy_base_url = https://dlp.srv.world:6080/vnc_auto.html # Glance connection info [glance] api_servers = https://dlp.srv.world:9292 [oslo_concurrency] lock_path = $state_path/tmp # MariaDB connection info [api_database] connection = mysql+pymysql://nova:password@dlp.srv.world/nova_api [database] connection = mysql+pymysql://nova:password@dlp.srv.world/nova # 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 project_domain_name = default user_domain_name = default project_name = service username = nova password = servicepassword # if using self-signed certs on Apache2 Keystone, turn to [true] insecure = false [placement] auth_url = https://dlp.srv.world:5000 os_region_name = RegionOne auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword # if using self-signed certs on Apache2 Keystone, turn to [true] insecure = false [wsgi] api_paste_config = /etc/nova/api-paste.ini [oslo_policy] enforce_new_defaults = true
root@dlp ~(keystone)#
chmod 640 /etc/nova/nova.conf root@dlp ~(keystone)# chgrp nova /etc/nova/nova.conf
root@dlp ~(keystone)#
vi /etc/default/nova-consoleproxy # line 6 : change NOVA_CONSOLE_PROXY_TYPE= novnc
mv /etc/placement/placement.conf /etc/placement/placement.conf.org
root@dlp ~(keystone)#
vi /etc/placement/placement.conf # create new [DEFAULT] debug = false [api] auth_strategy = 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 = placement password = servicepassword # if using self-signed certs on Apache2 Keystone, turn to [true] insecure = false [placement_database] connection = mysql+pymysql://placement:password@dlp.srv.world/placement
root@dlp ~(keystone)#
vi /etc/apache2/sites-available/placement-api.conf # create new Listen 127.0.0.1:8778 <VirtualHost *:8778> WSGIScriptAlias / /usr/bin/placement-api WSGIDaemonProcess placement-api processes=5 threads=1 user=placement group=placement display-name=%{GROUP} WSGIProcessGroup placement-api WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On LimitRequestBody 114688 <IfVersion >= 2.4> ErrorLogFormat "%{cu}t %M" </IfVersion> ErrorLog /var/log/apache2/placement_api_error.log CustomLog /var/log/apache2/placement_api_access.log combined <Directory /usr/bin> Require all granted </Directory> </VirtualHost> Alias /placement /usr/bin/placement-api <Location /placement> SetHandler wsgi-script Options +ExecCGI WSGIProcessGroup placement-api WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On </Location>
root@dlp ~(keystone)#
chmod 640 /etc/placement/placement.conf root@dlp ~(keystone)# chgrp placement /etc/placement/placement.conf
root@dlp ~(keystone)#
vi /etc/init.d/nova-api # line 95 : add UWSGI_BIND_IP=" 127.0.0.1 "
root@dlp ~(keystone)#
vi /etc/init.d/nova-api-metadata # line 95 : add UWSGI_BIND_IP=" 127.0.0.1 "
a2ensite placement-api Enabling site placement-api. To activate the new configuration, you need to run: systemctl reload apache2root@dlp ~(keystone)# systemctl disable --now placement-api root@dlp ~(keystone)# systemctl reload apache2 |
[3] | Configure Nginx for proxy settings. |
root@dlp ~(keystone)#
vi /etc/nginx/nginx.conf # add into the [stream] section
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;
}
ssl_certificate "/etc/letsencrypt/live/dlp.srv.world/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/dlp.srv.world/privkey.pem";
}
|
[4] | Add Data into Database and start Nova services. It doesn't need to care the messages "deprecated ***" when sync DB. |
root@dlp ~(keystone)#
su -s /bin/bash placement -c "placement-manage db sync"
root@dlp ~(keystone)#
su -s /bin/bash nova -c "nova-manage api_db sync"
root@dlp ~(keystone)#
su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0"
root@dlp ~(keystone)#
su -s /bin/bash nova -c "nova-manage db sync"
root@dlp ~(keystone)#
su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1"
root@dlp ~(keystone)#
systemctl stop nova-api nova-api-metadata nova-conductor nova-scheduler nova-novncproxy root@dlp ~(keystone)# systemctl restart nginx root@dlp ~(keystone)# systemctl enable --now nova-api nova-api-metadata nova-conductor nova-scheduler nova-novncproxy # show status root@dlp ~(keystone)# openstack compute service list +--------------------------------------+----------------+---------------+----------+---------+-------+----------------------------+ | ID | Binary | Host | Zone | Status | State | Updated At | +--------------------------------------+----------------+---------------+----------+---------+-------+----------------------------+ | 763baff5-8b45-464c-a911-f2ef9d28f9c1 | nova-scheduler | dlp.srv.world | internal | enabled | up | 2023-06-23T03:44:29.000000 | | 025da87c-7c9d-4612-8828-1aba0438cc5f | nova-conductor | dlp.srv.world | internal | enabled | up | 2023-06-23T03:44:29.000000 | +--------------------------------------+----------------+---------------+----------+---------+-------+----------------------------+ |
Sponsored Link |