Ham.Blog
블로그로 돌아가기
2025. 11. 19.7분

OpenStack 설치 및 트러블슈팅

OpenStackVirtualBoxUbuntuServer

OpenStack 설치 트러블슈팅 보고서

목차

  1. 환경 구성
  2. Neutron 네트워킹 설정 문제
  3. Horizon 대시보드 설치 문제
  4. 결론

환경 구성

시스템 사양

  • 호스트 머신: RAM 32GB
  • Controller VM: RAM 6GB, IP 192.168.56.10
  • Compute VM: RAM 8GB, IP 192.168.56.11
  • OS: Ubuntu Server
  • OpenStack 버전: 2024.2 (Caracal)
  • 네트워킹: Option 2 (Self-service networks)

네트워크 인터페이스 구성

Controller/Compute:
├─ enp0s3 (10.0.2.x): NAT 네트워크 (외부/인터넷)
└─ enp0s8 (192.168.56.x): Host-Only 네트워크 (관리용)

Neutron 네트워킹 설정 문제

문제 1: Open vSwitch 브리지 설정 시 SSH 연결 끊김

증상

sudo ovs-vsctl add-port br-provider enp0s3

명령 실행 후 SSH 연결이 끊어짐

원인

  • enp0s3가 인터넷 접속용 인터페이스였음
  • 브리지에 추가하면서 IP 설정이 사라짐
  • 네트워크 연결 불가

해결 방법

VirtualBox 콘솔로 접속하여 브리지에서 제거:

sudo ovs-vsctl del-port br-provider enp0s3
sudo systemctl restart networking

올바른 구성

Provider 네트워크용 인터페이스는 별도로 구성하거나, 단일 인터페이스 환경에서는 브리지만 생성하고 포트는 추가하지 않음:

sudo ovs-vsctl add-br br-provider
# add-port는 실행하지 않음

문제 2: 네트워크 브리지 필터 설정

증상

sysctl net.bridge.bridge-nf-call-iptables
# command not found

원인

net.bridge.bridge-nf-call-iptables는 명령어가 아닌 커널 파라미터

해결 방법

# br_netfilter 모듈 로드
sudo modprobe br_netfilter
echo "br_netfilter" | sudo tee /etc/modules-load.d/br_netfilter.conf

# sysctl 설정
cat <<EOF | sudo tee /etc/sysctl.d/99-neutron.conf
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
EOF

# 적용
sudo sysctl -p /etc/sysctl.d/99-neutron.conf

문제 3: Netplan 네트워크 설정

증상

Open vSwitch 브리지 설정 후 인터넷 연결 끊김

해결 방법

Netplan에서 브리지 설정:

# /etc/netplan/00-installer-config.yaml
network:
  version: 2
  ethernets:
    enp0s3:
      dhcp4: no
      dhcp6: no
    enp0s8:
      addresses:
        - 192.168.56.10/24
      routes:
        - to: default
          via: 192.168.56.1
          metric: 200
  bridges:
    br-provider:
      interfaces: [enp0s3]
      dhcp4: yes
      dhcp6: no

적용:

sudo netplan apply

Horizon 대시보드 설치 문제

문제 1: Django 타임존 설정 오류

증상

ValueError: Incorrect timezone setting: KST

원인

Django는 KST 형식의 타임존을 인식하지 못함

해결 방법

/etc/openstack-dashboard/local_settings.py 수정:

# 변경 전
TIME_ZONE = "KST"

# 변경 후
TIME_ZONE = "Asia/Seoul"

문제 2: Memcached 백엔드 설정 오류

증상

AttributeError: module 'django.core.cache.backends.memcached' has no attribute 'MemcachedCache'. 
Did you mean: 'PyMemcacheCache'?

원인

Django 4.x에서 MemcachedCache가 deprecated되고 PyMemcacheCache로 변경됨

해결 방법

# /etc/openstack-dashboard/local_settings.py

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

주의사항:

  • memcached (d 포함)
  • PyMemcacheCache (d 없음)

문제 3: Memcached 서비스 시작 실패

증상

failed to listen on one of interface(s) 192.168.56.11,::1: Cannot assign requested address

원인

Memcached가 잘못된 IP 주소(Compute 노드 IP)에 바인드 시도

해결 방법

/etc/memcached.conf 수정:

# 변경 전
-l 192.168.56.11,::1

# 변경 후
-l 127.0.0.1

재시작:

sudo systemctl restart memcached
sudo systemctl status memcached

문제 4: Keystone API 접근 권한 (403 Forbidden)

증상

curl http://192.168.56.10/identity/v3
# 403 Forbidden

원인

Keystone Apache 설정에서 /identity 경로에 대한 접근 권한 누락

해결 방법

/etc/apache2/sites-available/keystone.conf 수정:

Alias /identity /usr/bin/keystone-wsgi-public
<Location /identity>
    SetHandler wsgi-script
    Options +ExecCGI
    WSGIProcessGroup keystone-public
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
    <IfVersion >= 2.4>
        Require all granted
    </IfVersion>
    <IfVersion < 2.4>
        Order allow,deny
        Allow from all
    </IfVersion>
</Location>

재시작:

sudo apache2ctl configtest
sudo systemctl restart apache2

검증:

curl http://192.168.56.10/identity/v3
# JSON 응답 확인

문제 5: Django Compressor 오프라인 매니페스트 오류

증상

OfflineGenerationError: You have offline compression enabled but key "..." is missing from offline manifest.

원인

Django Compressor의 오프라인 매니페스트 파일 누락 또는 손상

해결 방법

  1. 설정 활성화:
# /etc/openstack-dashboard/local_settings.py
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
  1. 캐시 및 Static 파일 재생성:
cd /usr/share/openstack-dashboard

# 기존 파일 삭제
sudo rm -rf /var/lib/openstack-dashboard/static/*
sudo rm -rf static/CACHE/*

# Static 파일 수집
sudo python3 manage.py collectstatic --noinput

# Compress 생성
sudo python3 manage.py compress --force

# 권한 수정
sudo chown -R www-data:www-data /var/lib/openstack-dashboard/

# Apache 재시작
sudo systemctl restart apache2

추가 설정 및 최적화

DEBUG 모드 활성화 (문제 진단용)

# /etc/openstack-dashboard/local_settings.py
DEBUG = True

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'logging.FileHandler',
            'filename': '/var/log/horizon/horizon.log',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'horizon': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': False,
        },
    },
}

로그 디렉토리 생성:

sudo mkdir -p /var/log/horizon
sudo chown www-data:www-data /var/log/horizon

Horizon 주요 설정 요약

# /etc/openstack-dashboard/local_settings.py

# Keystone 설정
OPENSTACK_HOST = "192.168.56.10"
OPENSTACK_KEYSTONE_URL = "http://192.168.56.10/identity/v3"

# 도메인 및 역할
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"

# API 버전
OPENSTACK_API_VERSIONS = {
    "identity": 3,
    "image": 2,
    "volume": 3,
}

# 네트워킹 (Option 2)
OPENSTACK_NEUTRON_NETWORK = {
    'enable_router': True,
    'enable_quotas': True,
    'enable_ipv6': True,
    'enable_distributed_router': False,
    'enable_ha_router': False,
    'enable_fip_topology_check': True,
}

# 캐시 설정
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

# 보안 설정
ALLOWED_HOSTS = ['*']
TIME_ZONE = "Asia/Seoul"

# Compress 설정
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True

검증 및 확인

Neutron 에이전트 상태 확인

source ~/admin-openrc
openstack network agent list

정상 출력 예시:

+--------------------------------------+--------------------+------------+-------------------+-------+-------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+
| ...                                  | Metadata agent     | controller | None              | True  | UP    |
| ...                                  | Open vSwitch agent | controller | None              | True  | UP    |
| ...                                  | Open vSwitch agent | compute1   | None              | True  | UP    |
| ...                                  | L3 agent           | controller | nova              | True  | UP    |
| ...                                  | DHCP agent         | controller | nova              | True  | UP    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+

Horizon 접속 확인

브라우저에서 http://192.168.56.10/horizon 접속

로그인 정보:

  • Domain: default
  • Username: admin
  • Password: (설정한 ADMIN_PASS)

결론

주요 트러블슈팅 포인트

  1. 네트워크 인터페이스 관리

    • Provider 네트워크용 인터페이스 선택 시 신중해야 함
    • 관리용 인터페이스를 브리지에 추가하면 연결 끊김
    • Netplan을 사용한 브리지 설정 권장
  2. Django/Python 버전 호환성

    • Django 4.x에서 많은 deprecated 변경사항 존재
    • 타임존 형식, Memcached 백엔드 등 주의 필요
  3. 서비스 설정 파일 권한

    • Apache Location 지시자에 적절한 접근 권한 설정 필수
    • Memcached는 로컬 주소(127.0.0.1)에만 바인드
  4. Static 파일 관리

    • Django Compressor 오프라인 모드 사용 시 주기적 재생성 필요
    • 캐시 문제 발생 시 완전 삭제 후 재생성

권장 사항

  1. 사전 계획

    • 네트워크 구성을 명확히 설계
    • 각 인터페이스의 용도를 문서화
  2. 점진적 설정

    • 각 컴포넌트를 순차적으로 설치하고 검증
    • 문제 발생 시 로그 우선 확인
  3. 로그 활용

    • DEBUG 모드로 상세한 에러 메시지 확인
    • /var/log/apache2/error.log, /var/log/horizon/horizon.log 주기적 모니터링
  4. 문서 참조

    • 공식 OpenStack 문서의 버전별 차이 확인
    • 커뮤니티 포럼에서 유사 사례 검색

최종 구성도

┌─────────────────────────────────────────────┐
│ Controller Node (192.168.56.10)             │
│ ├─ Keystone (Identity)                      │
│ ├─ Glance (Image)                           │
│ ├─ Nova API, Scheduler, Conductor           │
│ ├─ Neutron Server, L3, DHCP, Metadata Agent │
│ ├─ Horizon (Dashboard)                      │
│ └─ Open vSwitch Agent                       │
└─────────────────────────────────────────────┘
                    │
                    │ Management Network (192.168.56.0/24)
                    │
┌─────────────────────────────────────────────┐
│ Compute Node (192.168.56.11)                │
│ ├─ Nova Compute                             │
│ └─ Open vSwitch Agent                       │
└─────────────────────────────────────────────┘

참고 자료


작성일: 2025-11-19
OpenStack 버전: 2024.2 (Caracal)
환경: VirtualBox, Ubuntu Server