Openstack Octavia에 Flavor를 생성하는 방법을 설명합니다.
Openstack Octavia CLI 설치
pip install python-openstackclient python-octaviaclient
장치 Flavor 생성
Load Balancer에 사용할 장치의 사양을 생성합니다.
$ openstack flavor create amphora.small --ram 1024 --disk 8 --vcpus 1
$ openstack flavor create amphora.medium --ram 2048 --disk 10 --vcpus 1
$ openstack flavor create amphora.large --ram 4096 --disk 20 --vcpus 4
$ openstack flavor list
root@devcon01:~# openstack flavor create amphora.small --ram 1024 --disk 8 --vcpus 1
+----------------------------+--------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| description | None |
| disk | 8 |
| id | e4ec4059-15a8-44c0-ad26-3c14e39d4ee5 |
| name | amphora.small |
| os-flavor-access:is_public | True |
| properties | |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | 0 |
| vcpus | 1 |
+----------------------------+--------------------------------------+
root@devcon01:~# openstack flavor create amphora.medium --ram 2048 --disk 10 --vcpus 1
+----------------------------+--------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| description | None |
| disk | 10 |
| id | 38cce02a-2499-4fcc-9136-7cf2e09a36e0 |
| name | amphora.medium |
| os-flavor-access:is_public | True |
| properties | |
| ram | 2048 |
| rxtx_factor | 1.0 |
| swap | 0 |
| vcpus | 1 |
+----------------------------+--------------------------------------+
root@devcon01:~# openstack flavor create amphora.large --ram 4096 --disk 20 --vcpus 4
+----------------------------+--------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| description | None |
| disk | 20 |
| id | fdf1a34d-9a15-4119-bbab-4b78e6c010d0 |
| name | amphora.large |
| os-flavor-access:is_public | True |
| properties | |
| ram | 4096 |
| rxtx_factor | 1.0 |
| swap | 0 |
| vcpus | 4 |
+----------------------------+--------------------------------------+
root@devcon01:~# openstack flavor list
+--------------------------------------+----------------+-------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+----------------+-------+------+-----------+-------+-----------+
| 38cce02a-2499-4fcc-9136-7cf2e09a36e0 | amphora.medium | 2048 | 10 | 0 | 1 | True |
| e4ec4059-15a8-44c0-ad26-3c14e39d4ee5 | amphora.small | 1024 | 8 | 0 | 1 | True |
| fdf1a34d-9a15-4119-bbab-4b78e6c010d0 | amphora.large | 4096 | 20 | 0 | 4 | True |
| m1.large | m1.large | 8192 | 80 | 0 | 4 | True |
| m1.medium | m1.medium | 4096 | 40 | 0 | 2 | True |
| m1.small | m1.small | 2048 | 20 | 0 | 1 | True |
| m1.tiny | m1.tiny | 1024 | 10 | 0 | 1 | True |
| m1.xlarge | m1.xlarge | 16384 | 160 | 0 | 8 | True |
+--------------------------------------+----------------+-------+------+-----------+-------+-----------+
Octavia Flavorprofile 생성
Single Mode
Compute Flavor ID를 위에서 생성한 값을 적절하게 변경합니다.
openstack loadbalancer flavorprofile create --name lb.single.small --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"}'
openstack loadbalancer flavorprofile create --name lb.single.medium --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"}'
openstack loadbalancer flavorprofile create --name lb.single.large --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"}'
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.single.small --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"}'
+---------------+-----------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-----------------------------------------------------------------------------------------------+
| id | 76d20140-f831-46d3-afcb-24dfbc8423f0 |
| name | lb.single.small |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "SINGLE", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"} |
+---------------+-----------------------------------------------------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.single.medium --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"}'
+---------------+-----------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-----------------------------------------------------------------------------------------------+
| id | 42197518-d592-4656-b96b-caf8b0f1e862 |
| name | lb.single.medium |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "SINGLE", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"} |
+---------------+-----------------------------------------------------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.single.large --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"}'
+---------------+-----------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-----------------------------------------------------------------------------------------------+
| id | ad5b9975-44b4-4274-966f-e33fb075a2d4 |
| name | lb.single.large |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "SINGLE", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"} |
+---------------+-----------------------------------------------------------------------------------------------+
Active Standby Mode
Compute Flavor ID를 위에서 생성한 값을 적절하게 변경합니다.
openstack loadbalancer flavorprofile create --name lb.active_standby.small --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"}'
openstack loadbalancer flavorprofile create --name lb.active_standby.medium --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"}'
openstack loadbalancer flavorprofile create --name lb.active_standby.large --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"}'
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.active_standby.small --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"}'
+---------------+-------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-------------------------------------------------------------------------------------------------------+
| id | c355e639-6d71-464c-9cf3-3eae1f6e80f9 |
| name | lb.active_standby.small |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "e4ec4059-15a8-44c0-ad26-3c14e39d4ee5"} |
+---------------+-------------------------------------------------------------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.active_standby.medium --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"}'
+---------------+-------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-------------------------------------------------------------------------------------------------------+
| id | abf93cc8-6f0f-44a9-ae70-d1ae3d2f33ec |
| name | lb.active_standby.medium |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "38cce02a-2499-4fcc-9136-7cf2e09a36e0"} |
+---------------+-------------------------------------------------------------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavorprofile create --name lb.active_standby.large --provider amphora --flavor-data '{"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"}'
+---------------+-------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------+-------------------------------------------------------------------------------------------------------+
| id | 1b31314a-033a-44ac-9643-917662b5fe69 |
| name | lb.active_standby.large |
| provider_name | amphora |
| flavor_data | {"loadbalancer_topology": "ACTIVE_STANDBY", "compute_flavor": "fdf1a34d-9a15-4119-bbab-4b78e6c010d0"} |
+---------------+-------------------------------------------------------------------------------------------------------+
Flavor Profile 목록 확인
openstack loadbalancer flavorprofile list
root@devcon01:~# openstack loadbalancer flavorprofile list
+--------------------------------------+--------------------------+---------------+
| id | name | provider_name |
+--------------------------------------+--------------------------+---------------+
| 1b31314a-033a-44ac-9643-917662b5fe69 | lb.active_standby.large | amphora |
| 42197518-d592-4656-b96b-caf8b0f1e862 | lb.single.medium | amphora |
| 76d20140-f831-46d3-afcb-24dfbc8423f0 | lb.single.small | amphora |
| abf93cc8-6f0f-44a9-ae70-d1ae3d2f33ec | lb.active_standby.medium | amphora |
| ad5b9975-44b4-4274-966f-e33fb075a2d4 | lb.single.large | amphora |
| c355e639-6d71-464c-9cf3-3eae1f6e80f9 | lb.active_standby.small | amphora |
+--------------------------------------+--------------------------+---------------+
Octavia Flavor 생성
Single Mode
openstack loadbalancer flavor create --flavorprofile lb.single.small --description 'single amphora, 1 vcpu, 1024 ram, 8 disk' --enable --name single.small
openstack loadbalancer flavor create --flavorprofile lb.single.medium --description 'single amphora, 2 vcpu, 2048 ram, 10 disk' --enable --name single.medium
openstack loadbalancer flavor create --flavorprofile lb.single.large --description 'single amphora, 4 vcpu, 4096 ram, 20 disk' --enable --name single.large
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.single.small --description 'single amphora, 1 vcpu, 1024 ram, 8 disk' --enable --name single.small
+-------------------+------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------+
| id | 7f2f8db9-6462-418f-8100-62ff0a630647 |
| name | single.small |
| flavor_profile_id | 76d20140-f831-46d3-afcb-24dfbc8423f0 |
| enabled | True |
| description | single amphora, 1 vcpu, 1024 ram, 8 disk |
+-------------------+------------------------------------------+
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.single.medium --description 'single amphora, 2 vcpu, 2048 ram, 10 disk' --enable --name single.medium
+-------------------+-------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------+
| id | 0f2015b9-5298-421c-9dc6-f64a419b0955 |
| name | single.medium |
| flavor_profile_id | 42197518-d592-4656-b96b-caf8b0f1e862 |
| enabled | True |
| description | single amphora, 2 vcpu, 2048 ram, 10 disk |
+-------------------+-------------------------------------------+
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.single.large --description 'single amphora, 4 vcpu, 4096 ram, 20 disk' --enable --name single.large
+-------------------+-------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------+
| id | 3dc7a4c0-965b-4e8f-8983-3cbf9fcae04a |
| name | single.large |
| flavor_profile_id | ad5b9975-44b4-4274-966f-e33fb075a2d4 |
| enabled | True |
| description | single amphora, 4 vcpu, 4096 ram, 20 disk |
+-------------------+-------------------------------------------+
Active Standby Mode
openstack loadbalancer flavor create --flavorprofile lb.active_standby.small --description 'high-availability amphora, 1 vcpu, 1024 ram, 8 disk' --enable --name active_standby.small
openstack loadbalancer flavor create --flavorprofile lb.active_standby.medium --description 'high-availability amphora, 2 vcpu, 2048 ram, 10 disk' --enable --name active_standby.medium
openstack loadbalancer flavor create --flavorprofile lb.active_standby.large --description 'high-availability amphora, 4 vcpu, 4096 ram, 20 disk' --enable --name active_standby.large
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.active_standby.small --description 'high-availability amphora, 1 vcpu, 1024 ram, 8 disk' --enable --name active_standby.small
+-------------------+-----------------------------------------------------+
| Field | Value |
+-------------------+-----------------------------------------------------+
| id | 1abddb12-9551-4001-810c-d09ab0b6e3e9 |
| name | active_standby.small |
| flavor_profile_id | c355e639-6d71-464c-9cf3-3eae1f6e80f9 |
| enabled | True |
| description | high-availability amphora, 1 vcpu, 1024 ram, 8 disk |
+-------------------+-----------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.active_standby.medium --description 'high-availability amphora, 2 vcpu, 2048 ram, 10 disk' --enable --name active_standby.medium
+-------------------+------------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------------+
| id | ee0206d0-3689-48db-97f1-c0c545faf3ed |
| name | active_standby.medium |
| flavor_profile_id | abf93cc8-6f0f-44a9-ae70-d1ae3d2f33ec |
| enabled | True |
| description | high-availability amphora, 2 vcpu, 2048 ram, 10 disk |
+-------------------+------------------------------------------------------+
root@devcon01:~# openstack loadbalancer flavor create --flavorprofile lb.active_standby.large --description 'high-availability amphora, 4 vcpu, 4096 ram, 20 disk' --enable --name active_standby.large
+-------------------+------------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------------+
| id | 0e863697-b2a5-45af-87e5-a8cae1e32c21 |
| name | active_standby.large |
| flavor_profile_id | 1b31314a-033a-44ac-9643-917662b5fe69 |
| enabled | True |
| description | high-availability amphora, 4 vcpu, 4096 ram, 20 disk |
+-------------------+------------------------------------------------------+
Flavor 목록 확인
openstack loadbalancer flavor list
root@devcon01:~# openstack loadbalancer flavor list
+--------------------------------------+-----------------------+--------------------------------------+---------+
| id | name | flavor_profile_id | enabled |
+--------------------------------------+-----------------------+--------------------------------------+---------+
| 0e863697-b2a5-45af-87e5-a8cae1e32c21 | active_standby.large | 1b31314a-033a-44ac-9643-917662b5fe69 | True |
| 0f2015b9-5298-421c-9dc6-f64a419b0955 | single.medium | 42197518-d592-4656-b96b-caf8b0f1e862 | True |
| 1abddb12-9551-4001-810c-d09ab0b6e3e9 | active_standby.small | c355e639-6d71-464c-9cf3-3eae1f6e80f9 | True |
| 3dc7a4c0-965b-4e8f-8983-3cbf9fcae04a | single.large | ad5b9975-44b4-4274-966f-e33fb075a2d4 | True |
| 7f2f8db9-6462-418f-8100-62ff0a630647 | single.small | 76d20140-f831-46d3-afcb-24dfbc8423f0 | True |
| ee0206d0-3689-48db-97f1-c0c545faf3ed | active_standby.medium | abf93cc8-6f0f-44a9-ae70-d1ae3d2f33ec | True |
+--------------------------------------+-----------------------+--------------------------------------+---------+
참고 : https://github.com/prastamaha/btechbicara/blob/master/scenarios/flavor.md
728x90
'Development > Cloud, Openstack' 카테고리의 다른 글
Telegraf + InfluxDB 1.8.x 설치 (0) | 2024.11.26 |
---|---|
OpenStack 이란 (0) | 2024.11.24 |
Openstack(Antelope) Multi-Node 설치하기 with Kolla-ansible & NFS #2/2 (2) | 2024.11.16 |
Openstack(Antelope) Multi-Node 설치하기 with Kolla-ansible & NFS #1/2 (2) | 2024.11.15 |
Openstack(Antelope) All-in-one Node Installation with Kolla-ansible (0) | 2024.04.08 |