본문으로 바로가기

본 문서는 Openstack Antelop(2023.1) 버전을 Kolla-ansible을 이용하여 All-in-one으로 설치하는 방법을 설명합니다.

설치 준비

필수 모듈 설치

// 모듈 목록 업데이트
root@openstack:~# sudo apt update

// 네트워크 도구 설치
root@openstack:~# sudo apt install net-tools

// 파티션 도구 설치
root@openstack:~# sudo apt install parted

// Python 설치
root@openstack:~# sudo apt install git python3-dev python3-pip libffi-dev gcc libssl-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
......
After this operation, 191 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
......

디스크 파티션 설정

파티션 도구를 사용하여 cinder에서 사용할 볼륨을 생성합니다. 본 문서에서는 SSD 2TB(/dev/nvme), HDD 2TB(/dev/sda) 를 기준으로 작성되었습니다.

현재 파티션 조회

root@openstack:~# fdisk -l
Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk model: SAMSUNG MZVL22T0HBLB-00B00              
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F9EDE650-6FD9-4FA1-BC8A-9F24DF331856

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    2203647    2201600    1G EFI System
/dev/nvme0n1p2 2203648    6397951    4194304    2G Linux filesystem
/dev/nvme0n1p3 6397952 4000794623 3994396672  1.9T Linux filesystem


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3F5664B8-F95F-436A-A28C-1903B880BA02


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

디스크 파티션 생성

root@openstack:~# parted /dev/sda
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?

(parted) print                                                            
Model: ATA TOSHIBA HDWD120 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) unit                                                             
Unit?  [compact]? gb                                                      

(parted) mkpart primary 0 100%                                            

(parted) print                                                            
Model: ATA TOSHIBA HDWD120 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      0.00GB  2000GB  2000GB               primary

(parted) quit                                                             
Information: You may need to update /etc/fstab.




root@openstack:~# fdisk -l                                                
Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk model: SAMSUNG MZVL22T0HBLB-00B00              
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F9EDE650-6FD9-4FA1-BC8A-9F24DF331856

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    2203647    2201600    1G EFI System
/dev/nvme0n1p2 2203648    6397951    4194304    2G Linux filesystem
/dev/nvme0n1p3 6397952 4000794623 3994396672  1.9T Linux filesystem


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3F5664B8-F95F-436A-A28C-1903B880BA02

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 3907028991 3907026944  1.8T Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@openstack:~# 

Cinder 가상 볼륨 생성

// 물리 볼륨에 가상볼륨 cinder-volumes 를 추가합니다.
root@openstack:~# vgcreate cinder-volumes /dev/sda1
  Physical volume "/dev/sda1" successfully created.
  Volume group "cinder-volumes" successfully created

   
root@openstack:~# vgs
  VG             #PV #LV #SN Attr   VSize  VFree 
  cinder-volumes   1   0   0 wz--n- <1.82t <1.82t
  ubuntu-vg        1   1   0 wz--n-  1.86t  1.76t


root@openstack:~# vgdisplay
  --- Volume group ---
  VG Name               ubuntu-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.86 TiB
  PE Size               4.00 MiB
  Total PE              487597
  Alloc PE / Size       25600 / 100.00 GiB
  Free  PE / Size       461997 / 1.76 TiB
  VG UUID               HWCer0-zrjr-CwPl-JXbh-5iiT-kKBN-NrI4ut
   
  --- Volume group ---
  VG Name               cinder-volumes
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <1.82 TiB
  PE Size               4.00 MiB
  Total PE              476931
  Alloc PE / Size       0 / 0   
  Free  PE / Size       476931 / <1.82 TiB
  VG UUID               fHweeJ-QWpp-XkRA-aita-EQF5-XMu0-CLZVfF

Kolla-Ansible 설치 및 실행

Kolla-Ansible 설치

kolla-ansible 리포지토리 추가 및 모듈 목록 업데이트

root@openstack:~# pip install git+https://opendev.org/openstack/kolla-ansible@stable/2023.1
Collecting git+https://opendev.org/openstack/kolla-ansible@stable/2023.1
  Cloning https://opendev.org/openstack/kolla-ansible (to revision stable/2023.1) to /tmp/pip-req-build-1miswxkc
  Running command git clone --filter=blob:none --quiet https://opendev.org/openstack/kolla-ansible /tmp/pip-req-build-1miswxkc
  Running command git checkout -b stable/2023.1 --track origin/stable/2023.1
  Switched to a new branch 'stable/2023.1'
  Branch 'stable/2023.1' set up to track remote branch 'stable/2023.1' from 'origin'.
  Resolved https://opendev.org/openstack/kolla-ansible to commit 10857e95014c29d26de158b586a4a7006638ef3f
  Preparing metadata (setup.py) ... done
......
Building wheels for collected packages: kolla-ansible
  Building wheel for kolla-ansible (setup.py) ... done
  Created wheel for kolla-ansible: filename=kolla_ansible-16.5.1.dev13-py3-none-any.whl size=1426583 sha256=febd510aa3229d798a357942e49b2c69721519212f62c3ebf72bbf45b8ad2541
  Stored in directory: /tmp/pip-ephem-wheel-cache-mrnowwf4/wheels/94/ea/de/b27ea7f7f73eb0341a85de0a16d85e3b3c84a8d5f1e8f99878
Successfully built kolla-ansible
Installing collected packages: wrapt, tzdata, rfc3986, pbr, packaging, netaddr, jmespath, iso8601, charset-normalizer, stevedore, requests, oslo.i18n, debtcollector, oslo.utils, oslo.config, hvac, kolla-ansible
  Attempting uninstall: requests
    Found existing installation: requests 2.25.1
    Not uninstalling requests at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'requests'. No files were found to uninstall.
Successfully installed charset-normalizer-3.3.2 debtcollector-3.0.0 hvac-2.1.0 iso8601-2.1.0 jmespath-1.0.1 kolla-ansible-16.5.1.dev13 netaddr-1.2.1 oslo.config-9.4.0 oslo.i18n-6.3.0 oslo.utils-7.1.0 packaging-24.0 pbr-6.0.0 requests-2.31.0 rfc3986-2.0.0 stevedore-5.2.0 tzdata-2024.1 wrapt-1.16.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@openstack:~#



root@openstack:~# sudo apt update
Hit:1 http://kr.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:4 http://kr.archive.ubuntu.com/ubuntu jammy-backports InRelease 
Fetched 229 kB in 2s (132 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.



Kolla-Ansible 설정 경로 생성 및 주요 파일 복사

root@openstack:~# mkdir /etc/kolla
root@openstack:~# ll
total 32
drwx------  4 root root 4096 Apr  4 05:06 ./
drwxr-xr-x 20 root root 4096 Apr  4 03:38 ../
-rw-------  1 root root  113 Apr  4 05:02 .bash_history
-rw-r--r--  1 root root 3106 Oct 15  2021 .bashrc
drwx------  4 root root 4096 Apr  4 05:31 .cache/
-rw-r--r--  1 root root  161 Jul  9  2019 .profile
drwx------  2 root root 4096 Apr  4 03:40 .ssh/
-rw-------  1 root root 3051 Apr  4 05:06 .viminfo


root@openstack:~# cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/
globals.yml    passwords.yml  
root@openstack:~# cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla/


// Kolla-ansible 동작 여부확인(필요 ansible 버전확인)
root@openstack:~# kolla-ansible install-deps
ERROR: Ansible is not installed in the current (virtual) environment.
Ansible version should be between 2.13 and 2.14.

Ansible 모듈 설치 및 버전 확인

Kolla-ansible에서 요구되는 버전은 ansible 2.13, 2.14 버전으로 pip를 이용해 2.13비전은 ansible>=6,<7값으로 2.14버전은 ansible>=7,<8값을 지정하여 설치가 가능합니다.

root@openstack:~# pip install --no-cache-dir 'ansible>=7,<8'
Collecting ansible<8,>=7
  Downloading ansible-7.7.0-py3-none-any.whl.metadata (7.9 kB)
Collecting ansible-core~=2.14.7 (from ansible<8,>=7)
  Downloading ansible_core-2.14.15-py3-none-any.whl.metadata (6.9 kB)
Requirement already satisfied: jinja2>=3.0.0 in /usr/lib/python3/dist-packages (from ansible-core~=2.14.7->ansible<8,>=7) (3.0.3)
Requirement already satisfied: PyYAML>=5.1 in /usr/lib/python3/dist-packages (from ansible-core~=2.14.7->ansible<8,>=7) (5.4.1)
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (from ansible-core~=2.14.7->ansible<8,>=7) (3.4.8)
Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from ansible-core~=2.14.7->ansible<8,>=7) (24.0)
Requirement already satisfied: resolvelib<0.9.0,>=0.5.3 in /usr/local/lib/python3.10/dist-packages (from ansible-core~=2.14.7->ansible<8,>=7) (0.5.4)
Downloading ansible-7.7.0-py3-none-any.whl (46.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 MB 4.2 MB/s eta 0:00:00
Downloading ansible_core-2.14.15-py3-none-any.whl (2.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 15.3 MB/s eta 0:00:00
Installing collected packages: ansible-core, ansible
Successfully installed ansible-7.7.0 ansible-core-2.14.15
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv


root@openstack:~# ansible --version
ansible [core 2.14.15]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Kolla-ansible 에 필요한 모듈 설치

root@openstack:~# kolla-ansible install-deps
Installing Ansible Galaxy dependencies
Starting galaxy collection install process
Process install dependency map
Cloning into '/root/.ansible/tmp/ansible-local-5515z318obnk/tmpsmm_7t0p/ansible-collection-kollavqef4wzg'...
remote: Enumerating objects: 882, done.
remote: Counting objects: 100% (318/318), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 882 (delta 276), reused 198 (delta 198), pack-reused 564
Receiving objects: 100% (882/882), 146.51 KiB | 491.00 KiB/s, done.
Resolving deltas: 100% (413/413), done.
Branch 'stable/2023.1' set up to track remote branch 'stable/2023.1' from 'origin'.
Switched to a new branch 'stable/2023.1'
Starting collection install process
Installing 'openstack.kolla:1.0.0' to '/root/.ansible/collections/ansible_collections/openstack/kolla'
Created collection for openstack.kolla:1.0.0 at /root/.ansible/collections/ansible_collections/openstack/kolla
openstack.kolla:1.0.0 was installed successfully

Openstack 설치 준비

Inventory 파일 복사

root@openstack:~# mkdir kolla-ansible
root@openstack:~# cd kolla-ansible/
root@openstack:~/kolla-ansible# cp /usr/local/share/kolla-ansible/ansible/inventory/* .
root@openstack:~/kolla-ansible# ll
total 32
drwxr-xr-x 2 root root 4096 Apr  4 06:38 ./
drwx------ 8 root root 4096 Apr  4 06:38 ../
-rw-r--r-- 1 root root 9040 Apr  4 06:38 all-in-one
-rw-r--r-- 1 root root 9492 Apr  4 06:38 multinode
root@openstack:~/kolla-ansible# 

Openstack 암호 복사 및 편집

root@openstack:~/kolla-ansible# kolla-genpwd
WARNING: Passwords file "/etc/kolla/passwords.yml" is world-readable. The permissions will be changed.



// 데이터 베이스와 keystone 암호를 고정
root@aio01:~/kolla-ansible# vi /etc/kolla/password.yml
database_password: openstack
keystone_admin_password: openstack



root@openstack:~/kolla-ansible# vi /etc/kolla/globals.yml 

kolla_base_distro: "ubuntu"
openstack_release: "2023.1"
kolla_internal_vip_address: "192.168.140.80"
kolla_external_vip_address: "{{ kolla_internal_vip_address }}"
network_interface: "enp11s0"
neutron_external_interface: "enp11s0"
neutron_plugin_agent: "ovn"
enable_openstack_core: "yes"
enable_haproxy: "no"
enable_mariadb: "yes"
enable_memcached: "yes"
enable_neutron: "{{ enable_openstack_core | bool }}"
enable_nova: "{{ enable_openstack_core | bool }}"
enable_rabbitmq: "{{ 'yes' if om_rpc_transport == 'rabbit' or om_notify_transport == 'rabbit' else 'no' }}"
enable_cinder: "yes"
enable_cinder_backup: "yes"
enable_cinder_backend_lvm: "yes"
enable_fluentd: "yes"
enable_heat: "{{ enable_openstack_core | bool }}"
enable_horizon: "{{ enable_openstack_core | bool }}"
enable_horizon_heat: "{{ enable_heat | bool }}"
enable_ovn: "{{ enable_neutron | bool and neutron_plugin_agent == 'ovn' }}"
glance_backend_file: "yes"
cinder_volume_group: "cinder-volumes"
nova_compute_virt_type: "qemu"
nova_console: "novnc"

Openstack 설치

Openstack 설치 준비

root@openstack:~/kolla-ansible# kolla-ansible -i ./all-in-one bootstrap-servers

Bootstrapping servers : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=bootstrap-servers /usr/local/share/kolla-ansible/ansible/kolla-host.yml  --inventory ./all-in-one
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

......

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=32   changed=13   unreachable=0    failed=0    skipped=23   rescued=0    ignored=1   

root@openstack:~/kolla-ansible# 

Openstack 설정 확인



oot@openstack:~/kolla-ansible# kolla-ansible -i ./all-in-one prechecks
Pre-deployment checking : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=precheck /usr/local/share/kolla-ansible/ansible/site.yml  --inventory ./all-in-one
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details


......


PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=87   changed=0    unreachable=0    failed=0    skipped=66   rescued=0    ignored=0   

root@openstack:~/kolla-ansible# 

Openstack 모듈 다운로드

root@openstack:~/kolla-ansible# 
root@openstack:~/kolla-ansible# kolla-ansible -i ./all-in-one pull
Pulling Docker images : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=pull /usr/local/share/kolla-ansible/ansible/site.yml  --inventory ./all-in-one
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details


......



*******************************************************************************************************************************************
localhost                  : ok=39   changed=17   unreachable=0    failed=0    skipped=14   rescued=0    ignored=0   

root@openstack:~/kolla-ansible# 

Openstack 모듈 배포

본 작업은 반드시 내부 네트워크 또는 배포 서버에 직업 접속하여 작업해야 합니다. 외부네트워크를 통해 설치할 경우 ssh 세션이 종료되어 배포가 정상적으로 이루어지지 않습니다.

root@openstack:~/kolla-ansible# kolla-ansible -i ./all-in-one deploy
Pulling Docker images : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=deploy /usr/local/share/kolla-ansible/ansible/site.yml  --inventory ./all-in-one
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
......
*******************************************************************************************************************************************
localhost                  : ok=337   changed=207   unreachable=0    failed=0    skipped=165   rescued=0    ignored=1   

root@openstack:~/kolla-ansible# 

네트워크 배포 중 네트워크 설정

기존 네트워크 인터페이스 이름에는 {}로 설정하고 네트워크 인터페이스 이름을 br-ex로 변경합니다.

root@openstack:~/kolla-ansible# vi /etc/netplan/00-installer-config.yaml 

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp11s0: {}
    br-ex:
      addresses:
      - 192.168.140.80/24
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.8.4
        - 168.126.63.1
        search:
        - openstack
      routes:
      - to: default
        via: 192.168.140.254
  version: 2


# 네트워크 정보를 반영합니다.
root@openstack:~/kolla-ansible# netplan apply


root@openstack:~/kolla-ansible# ifconfig -a
br-ex: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.140.80  netmask 255.255.255.0  broadcast 192.168.140.255
        inet6 fe80::7656:3cff:fe36:2130  prefixlen 64  scopeid 0x20<link>
        ether 74:56:3c:36:21:30  txqueuelen 1000  (Ethernet)
        RX packets 28827  bytes 2276825 (2.2 MB)
        RX errors 0  dropped 14781  overruns 0  frame 0
        TX packets 519  bytes 105819 (105.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br-int: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 92:54:3e:87:39:4f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp11s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::7656:3cff:fe36:2130  prefixlen 64  scopeid 0x20<link>
        ether 74:56:3c:36:21:30  txqueuelen 1000  (Ethernet)
        RX packets 2045634  bytes 2061169147 (2.0 GB)
        RX errors 0  dropped 6601  overruns 0  frame 0
        TX packets 563969  bytes 43143316 (43.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 101150  bytes 22144189 (22.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 101150  bytes 22144189 (22.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ovs-system: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether a6:53:c2:9f:f0:04  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Openstack 배포 정리

root@openstack:~/kolla-ansible# kolla-ansible -i ./all-in-one post-deploy
Post-Deploying Playbooks : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  /usr/local/share/kolla-ansible/ansible/post-deploy.yml  --inventory ./all-in-one
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

PLAY [Creating clouds.yaml file on the deploy node] **************************************************************************************************
......

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=5    changed=3    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0


                type: internal

Openstack 상태 확인

root@openstack:~/kolla-ansible# docker exec -it ovn_controller ovs-vsctl show
5c2f02f1-7818-4aa6-84d9-09597fc4c6cc
    Bridge br-ex
        Port enp11s0
            Interface enp11s0
        Port br-ex
            Interface br-ex
                type: internal
    Bridge br-int
        fail_mode: secure
        datapath_type: system
        Port br-int
            Interface br-int

Openstack CLI 설치 및 테스트

root@openstack:~# apt install python3-openstackclient -y

root@openstack:~# source /etc/kolla/admin-openrc.sh 

root@openstack:~# openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+---------------------------------------------+
| ID                               | Region    | Service Name | Service Type   | Enabled | Interface | URL                                         |
+----------------------------------+-----------+--------------+----------------+---------+-----------+---------------------------------------------+
| 17e1d96d210a4e72b7c3fff81e65762d | RegionOne | cinderv3     | volumev3       | True    | public    | http://192.168.140.80:8776/v3/%(tenant_id)s |
| 41ae391f1d764e7192c04643a7a6d524 | RegionOne | placement    | placement      | True    | public    | http://192.168.140.80:8780                  |
| 497b264c20f4444e9d77da6923771aa6 | RegionOne | placement    | placement      | True    | internal  | http://192.168.140.80:8780                  |
| 4b30b618c4294b0e92c0b9215673fa6c | RegionOne | cinderv3     | volumev3       | True    | internal  | http://192.168.140.80:8776/v3/%(tenant_id)s |
| 4c59c5ea551c49b3bc42d83a951e17e3 | RegionOne | heat-cfn     | cloudformation | True    | public    | http://192.168.140.80:8000/v1               |
| 4fb6975113f341d7824760e87f14b644 | RegionOne | keystone     | identity       | True    | internal  | http://192.168.140.80:5000                  |
| 50cc7906bc5c437e961ad7b2f46d6195 | RegionOne | glance       | image          | True    | public    | http://192.168.140.80:9292                  |
| 891fd0f6cc9447529c506905ddbafd46 | RegionOne | nova         | compute        | True    | internal  | http://192.168.140.80:8774/v2.1             |
| 9f9651a310e2404385959d1ec3746032 | RegionOne | heat         | orchestration  | True    | internal  | http://192.168.140.80:8004/v1/%(tenant_id)s |
| b5b018638c7d4be9aac7570707560e00 | RegionOne | heat-cfn     | cloudformation | True    | internal  | http://192.168.140.80:8000/v1               |
| c260b533774041f6b0c5813ce043b97d | RegionOne | neutron      | network        | True    | public    | http://192.168.140.80:9696                  |
| d5c1fdc776334809ab7cfbedf238f72b | RegionOne | heat         | orchestration  | True    | public    | http://192.168.140.80:8004/v1/%(tenant_id)s |
| f094591e2912432b8194f229c5c84ded | RegionOne | glance       | image          | True    | internal  | http://192.168.140.80:9292                  |
| f0c0476543054f04ae556ea5d082dfef | RegionOne | keystone     | identity       | True    | public    | http://192.168.140.80:5000                  |
| f29982d2923344a78f4ab4596072dbe9 | RegionOne | neutron      | network        | True    | internal  | http://192.168.140.80:9696                  |
| f325452a37a44da2ad3d656f5d90eeff | RegionOne | nova         | compute        | True    | public    | http://192.168.140.80:8774/v2.1             |
+----------------------------------+-----------+--------------+----------------+---------+-----------+---------------------------------------------+

Openstack Horizon 포트 변경(부가사항)

root@openstack:~# vi /etc/kolla/horizon/horizon.conf 
root@openstack:~# docker restart horizon
horizon

Appendix

네트워크 종류 정보 확인

아래 내용을 확인하여 external 네트워크 생성에 참고합니다.

root@openstack:~/kolla-ansible# cat /etc/kolla/neutron-server/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan,geneve
tenant_network_types = geneve
mechanism_drivers = ovn
extension_drivers = port_security

[ml2_type_vlan]
network_vlan_ranges =

[ml2_type_flat]
flat_networks = physnet1

[ml2_type_vxlan]
vni_ranges = 1:1000

[ml2_type_geneve]
vni_ranges = 1001:2000
max_header_size = 38

[ovn]
ovn_nb_connection = tcp:192.168.140.80:6641
ovn_sb_connection = tcp:192.168.140.80:6642
ovn_metadata_enabled = True
enable_distributed_floating_ip = False

Hypervisor 용량 늘리기

리눅스를 포맷할 때 lvm으로 설정하면 vg가 ubuntu-vg가 잡혀있는데, ubuntu-lv으로 /경로에 100 GB가 잡혀있다. 따라서, 특별한 작업을 하지 않으면 Openstack 설치 시 Hypervisor의 Local Storage 용량이100GB로 설치된다.

참고

 

명령

# 논리 볼륨을 남은 디스크 공간만큼 확장
# lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

# 파티션 크기 변경
# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

작업 예시

Hypervisor 용량

root@openstack:~# vgdisplay
  --- Volume group ---
  VG Name               ubuntu-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.86 TiB
  PE Size               4.00 MiB
  Total PE              487597
  Alloc PE / Size       25600 / 100.00 GiB
  Free  PE / Size       461997 / 1.76 TiB
  VG UUID               HWCer0-zrjr-CwPl-JXbh-5iiT-kKBN-NrI4ut
   
  --- Volume group ---
  VG Name               cinder-volumes
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <1.82 TiB
  PE Size               4.00 MiB
  Total PE              476931
  Alloc PE / Size       453141 / <1.73 TiB
  Free  PE / Size       23790 / <92.93 GiB
  VG UUID               fHweeJ-QWpp-XkRA-aita-EQF5-XMu0-CLZVfF
   
root@openstack:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              6.2G  4.8M  6.2G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   98G   42G   52G  45% /
tmpfs                               31G     0   31G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/nvme0n1p2                     2.0G  130M  1.7G   8% /boot
/dev/nvme0n1p1                     1.1G  6.1M  1.1G   1% /boot/efi
tmpfs                              6.2G  4.0K  6.2G   1% /run/user/1000
tmpfs                              6.2G  4.0K  6.2G   1% /run/user/0





root@openstack:~# 
root@openstack:~# lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from 100.00 GiB (25600 extents) to 1.86 TiB (487597 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.


root@openstack:~# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 239
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 499299328 (4k) blocks long.



root@openstack:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              6.2G  4.8M  6.2G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  1.9T   42G  1.8T   3% /
tmpfs                               31G     0   31G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/nvme0n1p2                     2.0G  130M  1.7G   8% /boot
/dev/nvme0n1p1                     1.1G  6.1M  1.1G   1% /boot/efi
tmpfs                              6.2G  4.0K  6.2G   1% /run/user/1000
tmpfs                              6.2G  4.0K  6.2G   1% /run/user/0

728x90