본문 바로가기
Openstack

openstack 수동설정 nova

by 판매자명단 2023. 9. 7.

[Openstack] - openstack 수동설정 사전 작업

 

openstack 수동설정 사전 작업

* ubuntu 20.04 2대 사용 controller ip 192.168.1.10 / dhcp ip 192.168.2.5 ( process 4/1 memory 8GB hard disk 100GB) compute ip 192.168.1.11 / dhcp ip 192.168.2.6 ( process 2/1 memory 4GB hard disk 50GB) chrony #controller apt install -y chrony systemctl

y7712.tistory.com

* 사전 작업을 먼저 할 것

 

controller

mysql
create database nova;
create database nova_api;
create database nova_cell0;

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

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

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

flush privileges;

 

nova용 database와 계정생성, 권한부여를 해준다

. admin-openrc # keystone글 참조

# nova 계정생성
openstack user create --domain default --project service --password-prompt nova

# nova admin 권한 부여
openstack role add --project service --user nova admin

# nova 서비스 생성
openstack service create --name nova --description "OpenStack Compute" compute

# endpoint 생성
openstack endpoint create --region RegionOne compute public http://controller: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에서 사용할 nova 계정을 생성하고 권한을 부여한다

nova 서비스를 생성하고 endpoint를 만든다

 

 

apt install -y nova-api nova-conductor nova-novncproxy nova-scheduler python3-novaclient
nano /etc/nova/nova.conf

# nova.conf

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

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

[DEFAULT]
transport_url = rabbit://openstack:openstack@controller
my_ip = 192.168.1.10
log_dir = /var/log/nova # 이 부분 주석처리 or 삭제
auth_strategy = keystone
use_neutron = True # neutron 사용허가
firewall_driver = nova.virt.firewall.NoopFirewallDriver # neutron 사용 드라이버 정의
enabled_apis = osapi_compute,metadata # 사용가능한 api 지정

[api]
auth_strategy = keystone

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

[service_user]
send_service_user_token = true
auth_url = https://controller/identity
auth_strategy = keystone
auth_type = password
project_domain_name = Default
project_name = service
user_domain_name = Default
username = nova
password = openstack

[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 = openstack

nova 를 설치하고 conf파일에 아래 내용들을 수정/추가 한다

su -s /bin/sh -c "nova-manage api_db sync" nova # api_db 초기화
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova # cell0 등록
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova # cell1 생성
su -s /bin/sh -c "nova-manage db sync" nova # db 초기화
su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova # cell 확인

systemctl restart nova-api nova-scheduler nova-conductor nova-novncproxy

nova db등을 초기화해주고 nova 서비스들을 재시작 해준다

compute

apt install -y nova-compute qemu-kvm virtinst bridge-utils nova-compute-kvm
nano /etc/nova/nova.conf

# nova.conf

[DEFAULT]
my_ip = 192.168.1.11
lock_path = /var/lock/nova
state_path = /var/lib/nova
auth_strategy = keystone
transport_url = rabbit://openstack:openstack@controller 
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis = osapi_compute,metadata


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

[service_user]
send_service_user_token = true
auth_url = https://controller/identity
auth_strategy = keystone
auth_type = password
project_domain_name = Default
project_name = service
user_domain_name = Default
username = nova
password = openstack

[api]
auth_strategy = keystone

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

[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:35357/v3
username = placement
password = openstack

[libvirt]
virt_type = kvm
-----------------------------------------------------------
nano /etc/nova/nova-compute.conf

# nova-compute.conf

[libvirt]
virt_type = kvm

 

* nova-compute를 restart해도 계속 down되는데 이것은 neutron을 설정하면 해결된다

참고

https://docs.openstack.org/nova/latest/install/controller-install-ubuntu.html

 

Install and configure controller node for Ubuntu — nova 27.1.0.dev173 documentation

Install and configure controller node for Ubuntu This section describes how to install and configure the Compute service, code-named nova, on the controller node. Prerequisites Before you install and configure the Compute service, you must create databases

docs.openstack.org

https://docs.openstack.org/nova/latest/install/compute-install-ubuntu.html

 

Install and configure a compute node for Ubuntu — nova 27.1.0.dev173 documentation

Install and configure a compute node for Ubuntu This section describes how to install and configure the Compute service on a compute node. The service supports several hypervisors to deploy instances or virtual machines (VMs). For simplicity, this configur

docs.openstack.org

 

'Openstack' 카테고리의 다른 글

openstack 수동 설정 placement  (0) 2023.09.07
openstack 수동설정 glance  (0) 2023.09.07
openstack 수동설정 keystone  (0) 2023.09.06
openstack 수동설정 사전 작업  (0) 2023.09.06
devstack으로 openstack 실습  (0) 2023.09.05