Fedora 23
Sponsored Link

OpenStack Kilo : Configure Nova2015/11/12

 
Install and Configure OpenStack Compute Service (Nova).
[1] Add users and others for Nova in Keystone.
# add nova user (set in service project)

[root@dlp ~]#
openstack user create --project service --password servicepassword nova

+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | None                             |
| enabled    | True                             |
| id         | f7fce03582694a4faccc3d6af03fff07 |
| name       | nova                             |
| project_id | f8d301995a9b423b85d3e250336ee6c3 |
| username   | nova                             |
+------------+----------------------------------+

# add nova user in admin role

[root@dlp ~]#
openstack role add --project service --user nova admin

+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | de393fc067984d469b46bc46f156ce30 |
| name  | admin                            |
+-------+----------------------------------+

# add service entry for nova

[root@dlp ~]#
openstack service create --name nova --description "OpenStack Compute service" compute

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute service        |
| enabled     | True                             |
| id          | c257f00cf7f3496ea64eddccccae9c7c |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

# define keystone host

[root@dlp ~]#
export controller=10.0.0.30
# add endpoint for nova

[root@dlp ~]#
openstack endpoint create \
--publicurl http://$controller:8774/v2/%\(tenant_id\)s \
--internalurl http://$controller:8774/v2/%\(tenant_id\)s \
--adminurl http://$controller:8774/v2/%\(tenant_id\)s \
--region RegionOne \
compute

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| adminurl     | http://10.0.0.30:8774/v2/%(tenant_id)s |
| id           | 1af2c7a365de411094057106217892ae       |
| internalurl  | http://10.0.0.30:8774/v2/%(tenant_id)s |
| publicurl    | http://10.0.0.30:8774/v2/%(tenant_id)s |
| region       | RegionOne                              |
| service_id   | c257f00cf7f3496ea64eddccccae9c7c       |
| service_name | nova                                   |
| service_type | compute                                |
+--------------+----------------------------------------+
[2] Install Nova.
[root@dlp ~]#
dnf -y install openstack-nova
[3] Add a User and Database on MariaDB for Nova.
[root@dlp ~]#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 20
Server version: 10.0.20-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database nova;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova.* to nova@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova.* to nova@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
[4] Configure Nova.
[root@dlp ~]#
mv /etc/nova/nova.conf /etc/nova/nova.conf.org

[root@dlp ~]#
vi /etc/nova/nova.conf
# create new

[DEFAULT]
# define own IP

my_ip=10.0.0.30
# add if not need IPv6

use_ipv6=false
state_path=/var/lib/nova
enabled_apis=ec2,osapi_compute,metadata
osapi_compute_listen=0.0.0.0
osapi_compute_listen_port=8774
rootwrap_config=/etc/nova/rootwrap.conf
api_paste_config=api-paste.ini
auth_strategy=keystone
log_dir=/var/log/nova
# specify Memcached server

memcached_servers=10.0.0.30:11211
scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
notification_driver=nova.openstack.common.notifier.rpc_notifier
rpc_backend=rabbit
# specify Glance server connection info

[glance]
host=10.0.0.30
port=9292
protocol=http
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
# specify RabbitMQ server connection info

[oslo_messaging_rabbit]
rabbit_host=10.0.0.30
rabbit_port=5672
rabbit_userid=guest
rabbit_password=password
# specify MariaDB server connection info

[database]
connection=mysql://nova:password@10.0.0.30/nova
# specify Keystone server connection info

[keystone_authtoken]
auth_uri=http://10.0.0.30:5000
auth_url=http://10.0.0.30:35357
auth_plugin=password
project_domain_id=default
user_domain_id=default
project_name=service
username=nova
password=servicepassword
[root@dlp ~]#
chmod 640 /etc/nova/nova.conf

[root@dlp ~]#
chgrp nova /etc/nova/nova.conf

[5] Configure Networking. The follows is for the case you use legacy nova-network function.
[root@dlp ~]#
vi /etc/nova/nova.conf
# add follows in [DEFAULT] section

network_driver=nova.network.linux_net
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
network_api_class=nova.network.api.API
security_group_api=nova
network_manager=nova.network.manager.FlatDHCPManager
network_size=254
allow_same_net_traffic=False
multi_host=True
send_arp_for_ha=True
share_dhcp_address=True
force_dhcp_release=True
# specify nic for public

public_interface=eno16777736
# specify any name you like for bridge

flat_network_bridge=br100
# specify nic for flat DHCP bridge

flat_interface=dummy0
# add a dummy interface which is for the flat DHCP bridge

[root@dlp ~]#
cat > /etc/sysconfig/network-scripts/ifcfg-dummy0 <<EOF
DEVICE=dummy0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=no
EOF
[root@dlp ~]#
echo "alias dummy0 dummy" > /etc/modprobe.d/dummy.conf

[root@dlp ~]#
ifup dummy0

[6] Start Nova Service.
If you don't use legacy nova-network, exclude the word "network" below.
[root@dlp ~]#
nova-manage db sync

[root@dlp ~]#
chown -R nova. /var/log/nova

[root@dlp ~]#
for service in api objectstore conductor scheduler cert consoleauth compute network; do
systemctl start openstack-nova-$service
systemctl enable openstack-nova-$service
done
# display status

[root@dlp ~]#
nova-manage service list

Binary           Host                Zone        Status     State Updated_At
nova-conductor   dlp.srv.world    internal    enabled    :-)   2015-11-13 14:08:02
nova-scheduler   dlp.srv.world    internal    enabled    :-)   2015-11-13 14:08:03
nova-cert        dlp.srv.world    internal    enabled    :-)   2015-11-13 14:08:02
nova-consoleauth dlp.srv.world    internal    enabled    :-)   2015-11-13 14:08:02
nova-compute     dlp.srv.world    nova        enabled    :-)   2015-11-13 14:08:04
nova-network     dlp.srv.world    internal    enabled    :-)   2015-11-13 14:08:04
Matched Content