OpenStack Xena : Configure Nova #22021/11/22 |
Install OpenStack Compute Service (Nova).
This example is based on the environment like follows.
eth0|10.0.0.30 +-----------+-----------+ | [ Control Node ] | | | | MariaDB RabbitMQ | | Memcached httpd | | Keystone Glance | | Nova API | +-----------------------+ |
[1] | Install Nova services. |
[root@dlp ~(keystone)]# dnf --enablerepo=centos-openstack-xena,powertools,epel -y install openstack-nova openstack-placement-api
|
[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] # define own IP address my_ip = 10.0.0.30 state_path = /var/lib/nova enabled_apis = osapi_compute,metadata log_dir = /var/log/nova # RabbitMQ connection info transport_url = rabbit://openstack:password@10.0.0.30 [api] auth_strategy = keystone # Glance connection info [glance] api_servers = http://10.0.0.30:9292 [oslo_concurrency] lock_path = $state_path/tmp # MariaDB connection info [api_database] connection = mysql+pymysql://nova:password@10.0.0.30/nova_api [database] connection = mysql+pymysql://nova:password@10.0.0.30/nova # Keystone auth info [keystone_authtoken] www_authenticate_uri = http://10.0.0.30:5000 auth_url = http://10.0.0.30:5000 memcached_servers = 10.0.0.30:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = servicepassword [placement] auth_url = http://10.0.0.30:5000 os_region_name = RegionOne auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword [wsgi] api_paste_config = /etc/nova/api-paste.ini
[root@dlp ~(keystone)]#
[root@dlp ~(keystone)]# chmod 640 /etc/nova/nova.conf [root@dlp ~(keystone)]# chgrp nova /etc/nova/nova.conf
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 = http://10.0.0.30:5000 auth_url = http://10.0.0.30:5000 memcached_servers = 10.0.0.30:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword [placement_database] connection = mysql+pymysql://placement:password@10.0.0.30/placement
[root@dlp ~(keystone)]#
chmod 640 /etc/placement/placement.conf [root@dlp ~(keystone)]# chgrp placement /etc/placement/placement.conf
[root@dlp ~(keystone)]#
vi /etc/httpd/conf.d/00-placement-api.conf # add near line 15 <Directory /usr/bin> Require all granted </Directory> |
[3] | If SELinux is enabled, change policy. |
[root@dlp ~(keystone)]# dnf --enablerepo=centos-openstack-xena -y install openstack-selinux [root@dlp ~(keystone)]# semanage port -a -t http_port_t -p tcp 8778
[root@dlp ~(keystone)]#
vi novaapi.te # create new module novaapi 1.0; require { type rpm_exec_t; type hostname_exec_t; type nova_t; type mysqld_exec_t; type mysqld_safe_exec_t; type gpg_exec_t; type crontab_exec_t; type consolehelper_exec_t; class file getattr; } #============= nova_t ============== allow nova_t mysqld_exec_t:file getattr; allow nova_t mysqld_safe_exec_t:file getattr; allow nova_t gpg_exec_t:file getattr; allow nova_t hostname_exec_t:file getattr; allow nova_t rpm_exec_t:file getattr; allow nova_t consolehelper_exec_t:file getattr; allow nova_t crontab_exec_t:file getattr; checkmodule -m -M -o novaapi.mod novaapi.te [root@dlp ~(keystone)]# semodule_package --outfile novaapi.pp --module novaapi.mod [root@dlp ~(keystone)]# semodule -i novaapi.pp |
[4] | If Firewalld is running, allow ports for services. |
[root@dlp ~(keystone)]# firewall-cmd --add-port={6080/tcp,6081/tcp,6082/tcp,8774/tcp,8775/tcp,8778/tcp} success [root@dlp ~(keystone)]# firewall-cmd --runtime-to-permanent success |
[5] | Add Data into Database and start Nova services. |
[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 restart httpd [root@dlp ~(keystone)]# chown placement. /var/log/placement/placement-api.log
[root@dlp ~(keystone)]#
for service in api conductor scheduler; do
systemctl enable --now openstack-nova-$service done # show status [root@dlp ~(keystone)]# openstack compute service list +----+----------------+---------------+----------+---------+-------+----------------------------+ | ID | Binary | Host | Zone | Status | State | Updated At | +----+----------------+---------------+----------+---------+-------+----------------------------+ | 6 | nova-conductor | dlp.srv.world | internal | enabled | up | 2021-11-22T02:41:40.000000 | | 10 | nova-scheduler | dlp.srv.world | internal | enabled | up | 2021-11-22T02:41:46.000000 | +----+----------------+---------------+----------+---------+-------+----------------------------+ |
Sponsored Link |
|