본문 바로가기
Openstack

4. 오픈스택: nova 설치

by 왈레 2023. 4. 6.

컨트롤러 노드에서 진행

$ mysql
> CREATE DATABASE nova_api;
> CREATE DATABASE nova;
> CREATE DATABASE nova_cell0;

> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost'IDENTIFIED BY 'a';
> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'a';

> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'a';
> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'a';

> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'a';
> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'a';
> quit

# 유저 생성 및 admin 권한 부여
$ openstack user create --domain default --password-prompt nova # 비밀번호 a
$ openstack role add --project service --user nova admin

# 서비스 추가
$ openstack service create --name nova --description "OpenStack Compute" compute

# API 엔드포인드 추가
$ openstack endpoint create --region RegionOne compute public <http://172.16.0.4:8774/v2.1>
$ openstack endpoint create --region RegionOne compute internal <http://controller:8774/v2.1>
$ openstack endpoint create --region RegionOne compute admin <http://controller:8774/v2.1>

# 확인
$ openstack user list | grep nova
$ openstack service list | grep nova
$ openstack endpoint list | grep nova

# 패키지 설치
$ apt install nova-api nova-conductor nova-novncproxy nova-scheduler
$ cp /etc/nova/nova.conf /etc/nova/nova.conf.org
$ grep -E '^[^#].' /etc/nova/nova.conf.org > /etc/nova/nova.conf
$ vi /etc/nova/nova.conf
[api_database]
connection = mysql+pymysql://nova:a@controller/nova_api

[database]
connection = mysql+pymysql://nova:a@controller/nova

[DEFAULT]
my_ip = 10.0.0.11 # 컴퓨터에 맞게 설정
transport_url = rabbit://openstack:a@controller:5672/
#log_dir # 패키징 버그로 인해 이 옵션은 지워야함

[api]
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = <http://controller:5000/>
auth_url = <http://controller:5000/>
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = a

[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

[glance]
api_servers = <http://controller:9292>

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

[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = <http://controller:5000/v3>
username = placement
password = a

# 이 밑에 설정들은 지금 추가하는게 아니고 향후 다른 컴포넌트를 설치하면서 추가 되는 옵션들임
# ========================================================================================
[DEFAULT]
block_device_allocate_retries_interval = 3
block_device_allocate_retries = 300

[neutron]
auth_url = <http://controller:5000>
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = a

[vnc]
novncproxy_base_url = <http://controller:6080/vnc_auto.html>
# ========================================================================================

$ su -s /bin/sh -c "nova-manage api_db sync" nova 
$ su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
$ su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
$ su -s /bin/sh -c "nova-manage db sync" nova

# nova cell0 및 cell1이 올바르게 등록되었는지 확인
$ su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
+-------+--------------------------------------+----------------------------------------------------+--------------------------------------------------------------+----------+
|  Name |                 UUID                 |                   Transport URL                    |                     Database Connection                      | Disabled |
+-------+--------------------------------------+----------------------------------------------------+--------------------------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 |                       none:/                       | mysql+pymysql://nova:****@controller/nova_cell0?charset=utf8 |  False   |
| cell1 | f690f4fd-2bc5-4f15-8145-db561a7b9d3d | rabbit://openstack:****@controller:5672/nova_cell1 | mysql+pymysql://nova:****@controller/nova_cell1?charset=utf8 |  False   |
+-------+--------------------------------------+----------------------------------------------------+--------------------------------------------------------------+----------+

$ service nova-api restart
$ service nova-scheduler restart
$ service nova-conductor restart
$ service nova-novncproxy restart

$ service nova-api status
$ service nova-scheduler status
$ service nova-conductor status
$ service nova-novncproxy status

# 검증 scheduler, conductor는 기본으로 떠야하고, compute 추가 후 검증시 compute도 같이 떠야함
$ openstack compute service list
+----+----------------+------------+----------+---------+-------+----------------------------+
| ID | Binary         | Host       | Zone     | Status  | State | Updated At                 |
+----+----------------+------------+----------+---------+-------+----------------------------+
|  3 | nova-scheduler | controller | internal | enabled | up    | 2022-12-12T02:41:25.000000 |
|  7 | nova-conductor | controller | internal | enabled | up    | 2022-12-12T02:41:18.000000 |
+----+----------------+------------+----------+---------+-------+----------------------------+

$ openstack catalog list
+-----------+-----------+-----------------------------------------+
| Name      | Type      | Endpoints                               |
+-----------+-----------+-----------------------------------------+
| keystone  | identity  | RegionOne                               |
|           |           |   public: <http://controller:5000/v3/>    |
|           |           | RegionOne                               |
|           |           |   internal: <http://controller:5000/v3/>  |
|           |           | RegionOne                               |
|           |           |   admin: <http://controller:5000/v3/>     |
|           |           |                                         |
| glance    | image     | RegionOne                               |
|           |           |   admin: <http://controller:9292>         |
|           |           | RegionOne                               |
|           |           |   public: <http://controller:9292>        |
|           |           | RegionOne                               |
|           |           |   internal: <http://controller:9292>      |
|           |           |                                         |
| nova      | compute   | RegionOne                               |
|           |           |   admin: <http://controller:8774/v2.1>    |
|           |           | RegionOne                               |
|           |           |   internal: <http://controller:8774/v2.1> |
|           |           | RegionOne                               |
|           |           |   public: <http://controller:8774/v2.1>   |
|           |           |                                         |
| placement | placement | RegionOne                               |
|           |           |   public: <http://controller:8778>        |
|           |           | RegionOne                               |
|           |           |   admin: <http://controller:8778>         |
|           |           | RegionOne                               |
|           |           |   internal: <http://controller:8778>      |
|           |           |                                         |
+-----------+-----------+-----------------------------------------+

$ openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 789b0fb5-cd87-489e-a7f0-952265bbc7ec | cirros | active |
+--------------------------------------+--------+--------+

$ nova-status upgrade check
+--------------------------------------------------------------------+
| Upgrade Check Results                                              |
+--------------------------------------------------------------------+
| Check: Cells v2                                                    |
| Result: Success                                                    |
| Details: No host mappings or compute nodes were found. Remember to |
|   run command 'nova-manage cell_v2 discover_hosts' when new        |
|   compute hosts are deployed.                                      |
+--------------------------------------------------------------------+
| Check: Placement API                                               |
| Result: Success                                                    |
| Details: None                                                      |
+--------------------------------------------------------------------+
| Check: Ironic Flavor Migration                                     |
| Result: Success                                                    |
| Details: None                                                      |
+--------------------------------------------------------------------+
| Check: Cinder API                                                  |
| Result: Success                                                    |
| Details: None                                                      |
+--------------------------------------------------------------------+
| Check: Policy Scope-based Defaults                                 |
| Result: Success                                                    |
| Details: None                                                      |
+--------------------------------------------------------------------+
| Check: Older than N-1 computes                                     |
| Result: Success                                                    |
| Details: None                                                      |
+--------------------------------------------------------------------+

'Openstack' 카테고리의 다른 글

6. 오픈스택: horizon 설치  (0) 2023.04.06
5. 오픈스택: neutron 설치  (0) 2023.04.06
3. 오픈스택: placement 설치  (0) 2023.04.06
2. 오픈스택: glance 설치  (1) 2023.04.06
1. 오픈스택: keystone 설치  (0) 2023.04.06

댓글