📘 Day 53 (2025.08.27.WED) - OpenStack 설치(4)

💻 Compute 노드 준비

Compute 노드 hostname 설정 및 기본 패키지 설치.

sudo passwd root (비밀번호: 123456)
su
nano /etc/hostname → compute

apt -y install chrony
nano /etc/chrony/chrony.conf
server time.bora.net iburst
allow 192.168.56.0/24

service chrony restart
systemctl enable chrony
add-apt-repository cloud-archive:zed
apt update && apt dist-upgrade
apt install python3-openstackclient -y
apt install mariadb-server python3-pymysql -y

nano /etc/mysql/mariadb.conf.d/99-openstack.cnf

MariaDB 설정:

[mysqld]
bind-address = 0.0.0.0

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
systemctl restart mariadb
systemctl enable mariadb
🚀 Nova 설치 (Compute)

Compute 서비스 설치 후 /etc/nova/nova.conf 설정.

apt -y install nova-compute nova-compute-kvm

nano /etc/nova/nova.conf

주요 설정:

[DEFAULT]
transport_url = rabbit://openstack:123456@192.168.0.198
my_ip = 192.168.0.242
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone

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

[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.0.242
novncproxy_base_url = http://192.168.0.198:6080/vnc_auto.html

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

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

[placement]
region_name = RegionOne
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = 123456
auth_url = http://192.168.0.198:5000/v3
systemctl restart nova-compute
systemctl enable nova-compute
🌐 Neutron 설치 (Compute)

LinuxBridge Agent 설치 및 ML2 설정.

apt -y install neutron-linuxbridge-agent

nano /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2] & [linux_bridge] 설정:

[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security,qos

[ml2_type_flat]
flat_networks = provider

[linux_bridge] - [ml2] 아래 넣어주기
physical_interface_mappings = provider:ens33

[vxlan]
enable_vxlan = false
local_ip = 192.168.0.242 # Compute 노드 IP
l2_population = false # VXLAN 사용 시만 true

[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

[agent]
prevent_arp_spoofing = true
systemctl restart neutron-linuxbridge-agent
systemctl enable neutron-linuxbridge-agent
🖥️ Controller 연동 및 검증

nano /home/master/admin-openrc

export OS_USERNAME=admin
export OS_PASSWORD=adminpassword
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export PS1='\u@\h \W(keystone)\$ '

admin-openrc 로드 후 서비스 확인.

source /home/master/admin-openrc

nano /etc/hosts
192.168.0.198 controller

controller 설정

source ~/admin-openrc

nano /etc/nova/nova.conf

[keystone_authtoken]
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 = 123456

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

재시작 후 1~2분 기다리기

controller에서 확인

openstack compute service list
openstack network agent list
openstack compute service list
openstack network agent list

Flavor 생성:

openstack flavor create m1.small --vcpus 1 --ram 1024 --disk 10
openstack flavor list

내부 네트워크 (optional)

openstack network create private
openstack subnet create --network private --subnet-range 10.0.0.0/24 private_subnet
📦 인스턴스 실행

보안 그룹 규칙 추가 및 인스턴스 생성.

openstack security group list --project demo
openstack security group rule create --proto icmp <SG_ID>
openstack security group rule create --proto tcp --dst-port 22 <SG_ID>
openstack security group rule list <SG_ID>
openstack server create \
--flavor m1.small \
--image Ubuntu2204 \
--nic net-id=<NETWORK_ID> \
--security-group <SG_ID> \
demo_instance

openstack server list
openstack network agent list
systemctl status neutron-server

nano /etc/nova/nova.conf(Controller + Compute)

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

[neutron]
url = http://controller:9696
auth_url = http://controller:5000/v3
username = neutron
password = 123456
project_name = service
user_domain_name = Default
project_domain_name = Default
region_name = RegionOne
auth_type = password
service_metadata_proxy = True
metadata_proxy_shared_secret = 123456

sudo systemctl restart nova-compute
sudo systemctl restart neutron-server # Controller

nano /etc/neutron/neutron.conf (Controller)

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = 123456
🌍 Floating IP 연결

외부 네트워크에 Floating IP를 부여.

openstack floating ip create provider
openstack server add floating ip demo_instance 192.168.0.232

openstack server list
📡 Placement API 설정

Placement API 설치 및 nova-compute 연동.

sudo apt update
apt install -y placement-api python3-openstackclient

nano /etc/placement/placement.conf
[database]
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement

[api]
auth_strategy = keystone
host = 0.0.0.0
port = 8778

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = 123456
systemctl enable --now apache2
systemctl restart apache2
systemctl restart nova-compute

확인:

openstack resource provider list
openstack compute service list
🔧 DHCP & Open vSwitch

DHCP Agent 및 OVS 상태 확인.

systemctl status neutron-dhcp-agent
systemctl restart neutron-dhcp-agent
openstack network agent list
sudo apt update
sudo apt install openvswitch-switch -y

apt install -y openvswitch-switch neutron-openvswitch-agent

systemctl enable openvswitch-switch neutron-openvswitch-agent
systemctl restart openvswitch-switch neutron-openvswitch-agent
systemctl restart nova-compute

systemctl status neutron-openvswitch-agent
openstack compute service list