compute서비스는 하이퍼바이저 역활을 하여 인스턴스를 생성, 부팅, 삭제등 관리하는 역활을 하며 코드명은 nova.

nova는 controller노드 및 실제 compute 노드에서 인스턴스를 관리하기 위해 compute노드에도 설치된다.

 

 

우선 controller 노드 설치부터

 

다른 서비스들과 마찬가지로 DB 생성부터한다. 역시나 nova db 패스워드 변경시 'NOVA_DBPASS'를 변경한다.

[root@controller ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 55
Server version: 5.5.44-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 'NOVA_DBPASS';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'controller' \
       IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
       IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.00 sec)

 

 

openstack admin 계정을 cli에서 활성화 시켜준다.(이전 서비스 설치와 계속 이어지고 있다면 생략)

[root@controller ~]# source admin-openrc.sh

 

 

nova 유저를 생성 및 admin 롤 부여

[root@controller ~]# openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | bf828850e9ec4bcea3695216fd9728b9 |
| name      | nova                             |
+-----------+----------------------------------+

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

 

nova 서비스를 생성한다.

[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | a8522546b3ae4f509c9abeeea8229d04|
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

 

 

admin, internal, public 접근에 대한 endpoint를 생성한다.

[root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | f56a530908a04d14915dd872c1773da1        |
| interface    | public                                  |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | a8522546b3ae4f509c9abeeea8229d04        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | a3ea42ba57ba472689fbb9639062ed7c        |
| interface    | internal                                |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | a8522546b3ae4f509c9abeeea8229d04        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | f5482c450e664a82b34f96e798e975e2        |
| interface    | admin                                   |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | a8522546b3ae4f509c9abeeea8229d04        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

 

 

nova 관련 패키지를 설치한다.

[root@controller ~]# yum install -y openstack-nova-api openstack-nova-cert \
    openstack-nova-conductor openstack-nova-console \
    openstack-nova-novncproxy openstack-nova-scheduler \
    python-novaclient
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com
Package 1:python-novaclient-2.30.1-1.el7.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package openstack-nova-api.noarch 1:12.0.1-1.el7 will be installed

...(중략)...

 python2-oslo-reports.noarch 0:0.5.0-1.el7

Complete!

[root@controller ~]#

 

/etc/nova/nova.conf 파일을 다음과 같이 수정한다.

[database] 섹션에서 nova db 연결설정

[DEFAULT] 와 [oslo_messaging_rabbit]에 Message queue 서비스에 설정했던 내용으로 수정, RABBIT_PASS는 각자 수정한 패스워드로..

[DEFAULT] 와 [keystone_authtoken] 섹션을 Identity 서비스에 설정했던 내용으로 수정, NOVA_PASS는 각자 수정한 패스워드로..

[DEFAULT] 섹션에 my_ip에 컨트롤러 노드의 아이피를 설정한다.

[DEFAULT] 섹션에 Networking 서비스를 지원할수 있게 설정해준다.

[vnc] 섹션에 my_ip 변수를 이용하여 vnc서버 및 프록시클라이언트 설정을 해준다.

[glance] 섹션의 host에 glance가 설치된 컨트롤러 노드를 지정한다.

[oslo_concurrency]섹션의 lock_path를 설정한다.

[DEFAULT] 섹션의 enabled_apis의 주석 제거시 ec2 내용을 삭제하여 disables 시킨다.

(옵션)[DEFAULT] 섹션에서 트러블슈팅시 도움이 될수 있게 verbose를 활성화한다.

 

[root@controller ~]# vi /etc/nova/nova.conf

[DEFAULT]
...
rpc_backend = rabbit

...

auth_strategy=keystone

...
my_ip = 10.0.0.11

...

network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver

...
enabled_apis=osapi_compute,metadata

...
verbose = True

...

 

 

[database]
...
connection = mysql://nova:NOVA_DBPASS@controller/nova

...
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

...

 

 

[keystone_authtoken]
...
auth_uri = http://controller:5000

auth_url = http://controller:35357

auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS

 

 

[vnc]
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

...

 

[glance]
...
host = controller

 

[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

 

NOVA database의 table들을 만든다.

[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova 

 

nova 관련 서비스들 시작 및 부팅시 시작 서비스에 등록

[root@controller ~]# systemctl enable openstack-nova-api.service \
   openstack-nova-cert.service openstack-nova-consoleauth.service \
   openstack-nova-scheduler.service openstack-nova-conductor.service \
   openstack-nova-novncproxy.service

Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service to /usr/lib/systemd/system/openstack-nova-cert.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service to /usr/lib/systemd/system/openstack-nova-consoleauth.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service.
[root@controller ~]# systemctl start openstack-nova-api.service \
   openstack-nova-cert.service openstack-nova-consoleauth.service \
   openstack-nova-scheduler.service openstack-nova-conductor.service \
   openstack-nova-novncproxy.service

[root@controller ~]#

 

 

 

다음은 compute1 노드 설정

우선 compute1 노드용 nova 패키지 설치

[root@compute1 ~]# yum install -y openstack-nova-compute sysfsutils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com

...(중략)...

  yajl.x86_64 0:2.0.4-4.el7
  yum-utils.noarch 0:1.1.31-34.el7

Complete!
[root@compute1 ~]# 

 

/etc/nova/nova.conf 파일을 아래와 같이 수정한다.

[DEFAULT] 와 [oslo_messaging_rabbit]에 Message queue 서비스에 설정했던 내용으로 수정, RABBIT_PASS는 각자 수정한 패스워드로..

[DEFAULT] 와 [keystone_authtoken] 섹션을 Identity 서비스에 설정했던 내용으로 수정, NOVA_PASS는 각자 수정한 패스워드로..

[DEFAULT] 섹션에 my_ip에 compute1 노드의 아이피를 설정한다.

[DEFAULT] 섹션에 Networking 서비스를 지원할수 있게 설정해준다.

[vnc] 섹션에 vnc 설정을 해준다.

[glance] 섹션의 host에 glance가 설치된 컨트롤러 노드를 지정한다.

[oslo_concurrency]섹션의 lock_path를 설정한다.

(옵션)[DEFAULT] 섹션에서 트러블슈팅시 도움이 될수 있게 verbose를 활성화한다.

 

다만 살펴보면 controller의 nova.conf 와 거의 같다.

다음과 같이 controller 노드의 파일을 가져와 아래 처럼 수정해준다.

 

[root@compute1 ~]# scp controller:/etc/nova/nova.conf /etc/nova/nova.conf
The authenticity of host 'controller (10.0.0.11)' can't be established.
ECDSA key fingerprint is 99:e1:15:2b:05:9c:89:6b:1a:63:1d:e6:0e:7a:09:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'controller,10.0.0.11' (ECDSA) to the list of known hosts.
nova.conf      

[root@compute1 ~]# vi /etc/nova/nova.conf

[DEFAULT]
...
rpc_backend = rabbit

...

auth_strategy=keystone

...
my_ip = 10.0.0.31

...

network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver

...
#enabled_apis=osapi_compute,metadata

...
verbose = True

...

 

 

[database]
...
#connection = mysql://nova:NOVA_DBPASS@controller/nova

...

 

[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

...

 

 

[keystone_authtoken]
...
auth_uri = http://controller:5000


auth_url = http://controller:35357

auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS

 

[vnc]
...

enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

 

[glance]
...
host = controller

 

[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

 

마지막 설정을 하기전에 compute 노드가 가상머신이 hardware acceleration을 지원하는지 확인한다.

아래의 명령어를 수행하여 나오는 숫자가 hardware acceleration를 지원하는 Core 갯수이며 0이면 hardware acceleration를 지원하지 않는다.

 

[root@compute1 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
6

[root@compute1 ~]#

 

이때 숫자가 1이상의 숫자라면 더 이상 이상 수정할것이 없고 숫자가 0이라면 /etc/nova/nova.conf 파일을

다시 수정하여 [libvirt] 섹션에서 virt_type 을 kvm 대신에 qemu로 변경한다.

[root@compute1 ~]# vi /etc/nova/nova.conf

[libvirt]
...
virt_type = qemu 

 

compute 서비스 등록 및 시작

[root@compute1 ~]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/libvirtd.service to /usr/lib/systemd/system/libvirtd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@compute1 ~]# systemctl start libvirtd.service openstack-nova-compute.service

 

 

 

 

설치확인 - controller 노드로 다시 가서 수행한다.

서비스가 잘 설치되었는지 확인힌다.

[root@controller ~]# nova service-list
[root@controller ~]# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2016-03-02T22:05:51.000000 | -               |
| 2  | nova-cert        | controller | internal | enabled | up    | 2016-03-02T22:05:52.000000 | -               |
| 3  | nova-consoleauth | controller | internal | enabled | up    | 2016-03-02T22:05:42.000000 | -               |
| 4  | nova-scheduler   | controller | internal | enabled | up    | 2016-03-02T22:05:42.000000 | -               |

| 5  | nova-compute     | compute1   | nova     | enabled | up    | 2016-03-02T22:05:43.000000 | -               |

+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

 

 

엔드포인트를 확인힌다. 이때 warning 메세지는 무시한다.

[root@controller ~]# nova endpoints
WARNING: keystone has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | 37a64289ffee4d7f9cf7e9b774ab2b2b |
| interface | public                           |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:5000/v2.0      |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | 95d4152f4c464b36ab887c737c02170c |
| interface | internal                         |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:5000/v2.0      |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | fb68494248754d98b454fa5dbd193917 |
| interface | admin                            |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:35357/v2.0     |
+-----------+----------------------------------+
WARNING: glance has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | 3163e3d3732a4ce2b05246a34ddaeb2e |
| interface | internal                         |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | a6eab47cba534e3d84269ea111f8c5ea |
| interface | admin                            |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | d54bdb0434294a8b867fdbad08dec3ae |
| interface | public                           |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+
WARNING: nova has no endpoint in ! Available endpoints for this service:
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | a3ea42ba57ba472689fbb9639062ed7c                           |
| interface | internal                                                   |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/94f9c25aaa4246b0915afacca2d65c22 |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | f5482c450e664a82b34f96e798e975e2                           |
| interface | admin                                                      |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/94f9c25aaa4246b0915afacca2d65c22 |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | f56a530908a04d14915dd872c1773da1                           |
| interface | public                                                     |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/94f9c25aaa4246b0915afacca2d65c22 |
+-----------+------------------------------------------------------------+

 

glance 서비스 설치시 업데이트한 이미지를 확인한다.

[root@controller ~]# nova image-list
+--------------------------------------+--------+--------+--------+
| ID                                   | Name   | Status | Server |
+--------------------------------------+--------+--------+--------+
| 49338c63-033c-40a3-abdd-d6410799de24 | cirros | ACTIVE |        |
+--------------------------------------+--------+--------+--------+

 

 

 

 

+ Recent posts