IT/Openstack

[Openstack - Train] Centos에 설치하기(5) - nova

louky 2019. 11. 4. 17:48
반응형

이 장에서는 Controller 와  compute node에만 설치를 한다. 

 

 

Controller Node에 NOVA PKG를 설치시  Compute node에 대한  PKG도 같이 설치 할 경우  controller node도 compute node 처럼 사용할 수 있다. 

하지만 여기서는 각각 분리하여 설치 한다. 

 

A) Controller Node에 설치 

A-1) DB생성 

## DB 생성 전 확인 
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "show databases;"
+--------------------+
| Database           |
+--------------------+
| glance             |
| information_schema |
| keystone           |
| mysql              |
| performance_schema |
| placement          |
+--------------------+

## DB 생성 
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "CREATE DATABASE nova_api;"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "CREATE DATABASE nova;"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "CREATE DATABASE nova_cell0;"

## DB 생성 후 확인 
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "show databases;"
+--------------------+
| Database           |
+--------------------+
| glance             |
| information_schema |
| keystone           |
| mysql              |
| nova               |
| nova_api           |
| nova_cell0         |
| performance_schema |
| placement          |
+--------------------+

A-2) DB 권한 설정

## 권한 설정 전 확인
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova_api';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova_cell0';"

##DB 권한 설정
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'nova.123';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova.123';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova.123';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova.123';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'nova.123';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'nova.123';"

## 권한 설정 반영
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} -e "Flush Privileges;"


## 권한 설정 확인 
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova';"
+-----------+------+-------------------------------------------+
| Host      | User | PASSWORD                                  |
+-----------+------+-------------------------------------------+
| localhost | nova | *1C82B157DB331DFF216C43C8731768139C895506 |
| %         | nova | *1C82B157DB331DFF216C43C8731768139C895506 |
+-----------+------+-------------------------------------------+

## nova DB 계정만 사용함으로 아래 계정은 필요 없으며, 출력도 되지 않는다. -- 참고 사항!!!!!
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova_cell0';"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} mysql -e "select Host,User,PASSWORD from user where User='nova_api';"

A-3) Service User 생성 및 role 권한 설정

## Service User 생성
[root@controller ~] (admin-openrc):~# openstack user create --domain default --password nova.123 nova
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 3cbd49e5426145409d467f1502bea9ab |
| name                | nova                             |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+


## Role 권한 설정
[root@controller ~] (admin-openrc):~# openstack role add --project service --user nova admin

 

A-4) Service 생성

## Service 생성
[root@controller ~] (admin-openrc):~# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 91d5675745c748318502890a58941944 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

A-5) Endpoint 생성

## Endpoint 생성
[root@controller ~] (admin-openrc):~# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | c2ee0c0a819b49c8a53873f815517b1e |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 91d5675745c748318502890a58941944 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@controller ~] (admin-openrc):~# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 5c3e904c965742ad91bde4bd45734e31 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 91d5675745c748318502890a58941944 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@controller ~] (admin-openrc):~# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 0a15d5d640ff42a68de3c0012284568f |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 91d5675745c748318502890a58941944 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+

A-6) PKG 설치 

[root@controller ~] (admin-openrc):~# yum install -y openstack-nova-api \
  openstack-nova-conductor \
  openstack-nova-novncproxy \
  openstack-nova-scheduler

A-7) Config 백업

## Config 파일 이름 변경
[root@controller ~]# cat /etc/nova/nova.conf.orig | grep -Ev "^#|^$" | sed -e "s/\[/\n\[/g" > /etc/nova/nova.conf

## 이전 config 파일 퍼미션 확인 
[root@controller ~]# ls -al /etc/nova/nova.conf.orig
-rw-r----- 1 root nova 218078 10월 16 23:10 /etc/nova/nova.conf.orig

## 이전 파일과 동일한 퍼미션으로 변경
[root@controller ~]# chown nova.nova  /etc/nova/nova.conf
[root@controller ~]# chmod 640 /etc/nova/nova.conf

A-8) Config 수정

[root@controller ~]# cat /etc/nova/nova.conf 
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:rabbitmq.123@controller:5672/

##Controller Node의 MGT IP주소 입력
my_ip = CONTROLLER_MGMT_IP_ADDR
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
state_path=/openstack_data/nova/lib/nova

debug=true

[api]
auth_strategy = keystone

[api_database]
connection = mysql+pymysql://nova:nova.123@controller/nova_api

[barbican]

[cache]

[cinder]

[compute]

[conductor]

[console]

[consoleauth]

[cors]

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

[devices]

[ephemeral_storage_encryption]

[filter_scheduler]

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

[guestfs]

[healthcheck]

[hyperv]

[ironic]

[key_manager]

[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 = nova.123

[libvirt]

[metrics]

[mks]

[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 = neutron.123
service_metadata_proxy = true
metadata_proxy_shared_secret = meta.123

[notifications]

[osapi_v21]

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

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_middleware]

[oslo_policy]

[pci]

[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 = placement.123

[powervm]

[privsep]

[profiler]

[quota]

[rdp]

[remote_debug]

[scheduler]

[serial_console]

[service_user]

[spice]

[upgrade_levels]

[vault]

[vendordata_dynamic_auth]

[vmware]

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

[workarounds]

[wsgi]

[xenserver]

[xvp]

[zvm]

A-9) DB 내 table생성 

## 생성 전 table 존재 확인
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova_cell0 -e "show tables;"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova_api -e "show tables;"
[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova -e "show tables;"

 

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

** 주의  :  특별한 출력이 없으므로 /var/log/nova/nova-manage.log에  특이 사항이 없는지 확인한다. 

<정상적으로 실행이 되었다면....>

[root@controller nova]# cat /var/log/nova/nova-manage.log
2019-11-04 15:40:06.468 6340 INFO migrate.versioning.api [-] 0 -> 1...
~(중간 생략)
2019-11-04 15:40:07.358 6340 INFO migrate.versioning.api [-] 66 -> 67...
2019-11-04 15:40:07.363 6340 INFO migrate.versioning.api [-] done

 

register the cell0 database

## 아무런 출력도 없고 log도 없다.
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

 

Cell1 cell생성 

[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
703c9f24-055d-44d6-859b-59af456b279d

 

[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release')
  result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release')
  result = self._query(query)

**참고 : Duplication error 가 발생하지만 정상적으로  table이 생성 되니 무시해도 된다. 

 

[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova_cell0 -e "show tables;"
+--------------------------------------------+
| Tables_in_nova_cell0                       |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_auth_tokens                        |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+


 

[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova_api -e "show tables;"
+------------------------------+
| Tables_in_nova_api           |
+------------------------------+
| aggregate_hosts              |
| aggregate_metadata           |
| aggregates                   |
| allocations                  |
| build_requests               |
| cell_mappings                |
| consumers                    |
| flavor_extra_specs           |
| flavor_projects              |
| flavors                      |
| host_mappings                |
| instance_group_member        |
| instance_group_policy        |
| instance_groups              |
| instance_mappings            |
| inventories                  |
| key_pairs                    |
| migrate_version              |
| placement_aggregates         |
| project_user_quotas          |
| projects                     |
| quota_classes                |
| quota_usages                 |
| quotas                       |
| request_specs                |
| reservations                 |
| resource_classes             |
| resource_provider_aggregates |
| resource_provider_traits     |
| resource_providers           |
| traits                       |
| users                        |
+------------------------------+

 

[root@controller ~]# mysql -u${DB_USER} -p${DB_PASSWD} nova -e "show tables;"
+--------------------------------------------+
| Tables_in_nova                             |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_auth_tokens                        |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+

A-10) cell등록 여부 확인

[root@controller ~]# 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   |  False   |
| cell1 | 703c9f24-055d-44d6-859b-59af456b279d | rabbit://openstack:****@controller:5672/     |    mysql+pymysql://nova:****@controller/nova      |  False   |
+-------+--------------------------------------+----------------------------------------------+---------------------------------------------------+----------+

A-11) Nova Daemon 실행

### 시스템 재부팅 후 자동으로 시작되도록 설정
[root@controller ~]# systemctl enable \
     openstack-nova-api.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-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.


## Nova Daemon 시작 (또는 재시작)
[root@controller ~]# systemctl start \
     openstack-nova-api.service \
     openstack-nova-scheduler.service \
     openstack-nova-conductor.service \
     openstack-nova-novncproxy.service



## Nova Daemon 동작 상태 확인
[root@controller ~]# systemctl status \
     openstack-nova-api.service \
     openstack-nova-scheduler.service \
     openstack-nova-conductor.service \
     openstack-nova-novncproxy.service
● openstack-nova-api.service - OpenStack Nova API Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)
   Active: active (running) since 월 2019-11-04 15:54:28 KST; 43s ago
 Main PID: 7085 (nova-api)
   CGroup: /system.slice/openstack-nova-api.service
           ├─7085 /usr/bin/python2 /usr/bin/nova-api
           ├─7165 /usr/bin/python2 /usr/bin/nova-api
           ├─7166 /usr/bin/python2 /usr/bin/nova-api
           ├─7167 /usr/bin/python2 /usr/bin/nova-api
           ├─7168 /usr/bin/python2 /usr/bin/nova-api
           ├─7169 /usr/bin/python2 /usr/bin/nova-api
           ├─7170 /usr/bin/python2 /usr/bin/nova-api
           ├─7171 /usr/bin/python2 /usr/bin/nova-api
           ├─7172 /usr/bin/python2 /usr/bin/nova-api
           ├─7180 /usr/bin/python2 /usr/bin/nova-api
           ├─7182 /usr/bin/python2 /usr/bin/nova-api
           ├─7183 /usr/bin/python2 /usr/bin/nova-api
           ├─7184 /usr/bin/python2 /usr/bin/nova-api
           ├─7185 /usr/bin/python2 /usr/bin/nova-api
           ├─7186 /usr/bin/python2 /usr/bin/nova-api
           ├─7187 /usr/bin/python2 /usr/bin/nova-api
           └─7188 /usr/bin/python2 /usr/bin/nova-api

11월 04 15:54:24 controller systemd[1]: Starting OpenStack Nova API Server...
11월 04 15:54:26 controller nova-api[7085]: /usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py:22: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and ....re separately.
11월 04 15:54:26 controller nova-api[7085]: return pkg_resources.EntryPoint.parse("x=" + s).load(False)
11월 04 15:54:28 controller systemd[1]: Started OpenStack Nova API Server.

● openstack-nova-scheduler.service - OpenStack Nova Scheduler Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-scheduler.service; enabled; vendor preset: disabled)
   Active: active (running) since 월 2019-11-04 15:54:28 KST; 43s ago
 Main PID: 7086 (nova-scheduler)
   CGroup: /system.slice/openstack-nova-scheduler.service
           ├─7086 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7149 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7150 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7151 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7152 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7153 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7154 /usr/bin/python2 /usr/bin/nova-scheduler
           ├─7155 /usr/bin/python2 /usr/bin/nova-scheduler
           └─7156 /usr/bin/python2 /usr/bin/nova-scheduler

11월 04 15:54:24 controller systemd[1]: Starting OpenStack Nova Scheduler Server...
11월 04 15:54:28 controller systemd[1]: Started OpenStack Nova Scheduler Server.

● openstack-nova-conductor.service - OpenStack Nova Conductor Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; vendor preset: disabled)
   Active: active (running) since 월 2019-11-04 15:54:27 KST; 44s ago
 Main PID: 7087 (nova-conductor)
   CGroup: /system.slice/openstack-nova-conductor.service
           ├─7087 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7131 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7132 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7133 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7134 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7135 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7136 /usr/bin/python2 /usr/bin/nova-conductor
           ├─7137 /usr/bin/python2 /usr/bin/nova-conductor
           └─7138 /usr/bin/python2 /usr/bin/nova-conductor

11월 04 15:54:24 controller systemd[1]: Starting OpenStack Nova Conductor Server...
11월 04 15:54:27 controller systemd[1]: Started OpenStack Nova Conductor Server.

● openstack-nova-novncproxy.service - OpenStack Nova NoVNC Proxy Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)
   Active: active (running) since 월 2019-11-04 15:54:24 KST; 47s ago
 Main PID: 7088 (nova-novncproxy)
   CGroup: /system.slice/openstack-nova-novncproxy.service
           └─7088 /usr/bin/python2 /usr/bin/nova-novncproxy --web /usr/share/novnc/

11월 04 15:54:24 controller systemd[1]: Started OpenStack Nova NoVNC Proxy Server.
Hint: Some lines were ellipsized, use -l to show in full.

 

B) Compute Node에 설치 

Compute node로 사용할 모든 서버에 설치를 진행한다. 

 

B-1) PKG 설치 

[root@compute01 ~]# yum install openstack-nova-compute -y

B-2) config 백업

##  파일명 변경
[root@compute01 ~]# mv  /etc/nova/nova.conf   /etc/nova/nova.conf.orig

## 이전 파일의 퍼미션 확인 
[root@compute01 ~]# ls -al /etc/nova/nova.conf.orig
-rw-r----- 1 root nova 218078 10월 16 23:10 /etc/nova/nova.conf.orig

## 주석을 제외한 config 만 출력하여 config 파일로 생성
[root@compute01 ~]# cat /etc/nova/nova.conf.orig | grep -Ev "^#|^$" | sed -e "s/\[/\n\[/g" > /etc/nova/nova.conf

## 이전과 동일한  퍼미션 설정
[root@compute01 ~]# chown root.nova /etc/nova/nova.conf
[root@compute01 ~]# chmod 640 /etc/nova/nova.conf

B-3) config 수정 

[root@compute01 ~]# cat /etc/nova/nova.conf 
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:rabbit.123@controller
my_ip = ##MANAGEMENT_INTERFACE_IP_ADDRESS
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver

## instance가 저장되고 실행되는 path 
state_path=/openstack_data/nova/lib/nova

[api]
auth_strategy = keystone


~(중간 생략)

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

~(중간 생략)

[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 = nova.123

[libvirt]
## egrep -c '(vmx|svm)' /proc/cpuinfo 실행 후 결과가 없거나 0 일 경우 qemu로 변경
virt_type = kvm

[metrics]

[mks]

[neutron]

[notifications]

[osapi_v21]

[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 = placement.123

~(중간 생략)

[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

~(이하 생략)

B-4) Daemon  재시작

## 시스템 재부팅 시 자동으로 실행되도록 하기 위한 설정
[root@compute01 ~]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.

## Daemon 재시작 
[root@compute01 ~]# systemctl start libvirtd.service openstack-nova-compute.service

## Daemon동작 상태 확인 
[root@compute01 ~]# systemctl status libvirtd.service openstack-nova-compute.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since 월 2019-11-04 16:26:04 KST; 32s ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 20608 (libvirtd)
    Tasks: 17 (limit: 32768)
   CGroup: /system.slice/libvirtd.service
           └─20608 /usr/sbin/libvirtd

11월 04 16:26:04 compute01 systemd[1]: Starting Virtualization daemon...
11월 04 16:26:04 compute01 systemd[1]: Started Virtualization daemon.

● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
   Active: active (running) since 월 2019-11-04 16:26:09 KST; 27s ago
 Main PID: 20625 (nova-compute)
    Tasks: 22
   CGroup: /system.slice/openstack-nova-compute.service
           └─20625 /usr/bin/python2 /usr/bin/nova-compute

11월 04 16:26:04 compute01 systemd[1]: Starting OpenStack Nova Compute Server...
11월 04 16:26:09 compute01 systemd[1]: Started OpenStack Nova Compute Server.

 

 

C) 설치 확인 

Controoller node에서 아래 명령어를 이용하여 Compute node가 등록되었는지 확인한다. 

## Openstack admin환경변수를 읽어들인다. 
[root@controller ~]# source admin-openrc
[root@controller ~] (admin-openrc):~#

## Compute node list를 확인한다. 
[root@controller ~] (admin-openrc):~# openstack compute service list --service nova-compute
+----+--------------+-------------+------+---------+-------+----------------------------+
| ID | Binary       | Host        | Zone | Status  | State | Updated At                 |
+----+--------------+-------------+------+---------+-------+----------------------------+
| 15 | nova-compute | compute02   | nova | enabled | up    | 2019-11-04T07:30:04.000000 |
| 16 | nova-compute | compute01   | nova | enabled | up    | 2019-11-04T07:30:04.000000 |
+----+--------------+-------------+------+---------+-------+----------------------------+
[root@controller ~] (admin-openrc):~#

추가한 compute node가 보이지 않을 경우에는 아래 명령어를 이용하여 확인한다. 

### Compute node 추가할 대상이 없을 경우 
[root@controller ~] (admin-openrc):~# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 703c9f24-055d-44d6-859b-59af456b279d
Found 0 unmapped computes in cell: 703c9f24-055d-44d6-859b-59af456b279d



### compute node 추가할 대상이 있을 경우 (예시)
[root@controller ~] (admin-openrc):~# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting compute nodes from cell 'cell1': ad5a5985-a719-4567-98d8-8d148aaae4bc
Found 1 computes in cell: ad5a5985-a719-4567-98d8-8d148aaae4bc
Checking host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3
Creating host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3

 

 

 

반응형