메뉴 닫기

openstack flavor에 따라서 인스턴스가 생성되는 존 지정

openstack – victoria, os – ubntu20.04  

root@lkj-con:~# openstack flavor list
+————————————–+———+——+——+———–+——-+———–+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+————————————–+———+——+——+———–+——-+———–+
| 0 | m1.nano | 64 | 1 | 0 | 1 | True |
| c4bee834-f047-45bb-8d65-a98cf3cb6918 | lkj2 | 1800 | 25 | 0 | 2 | True |
| e17e7625-d41a-4be8-bfb5-f2367ce280e0 | lkj | 1800 | 25 | 0 | 2 | True |
+————————————–+———+——+——+———–+——-+———–+

 

1. floavor에 properties flavor=lkj-test 지정해주기 

root@lkj-con:~# nova flavor-key lkj2 set flavor=lkj-test
root@lkj-con:~# openstack flavor show lkj
+—————————-+————————————–+
| Field | Value |
+—————————-+————————————–+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| access_project_ids | None |
| disk | 25 |
| id | e17e7625-d41a-4be8-bfb5-f2367ce280e0 |
| name | lkj |
| os-flavor-access:is_public | True |
| properties | flavor=’lkj-test’ |
| ram | 1800 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+—————————-+————————————–+

2. aggregate에도 flavor=lkj-test 지정해주기 

root@lkj-con:~# nova aggregate-set-metadata 1 flavor=lkj-test
Metadata has been successfully updated for aggregate 1.

+—-+—————–+——————-+———–+———————————+————————————–+
| Id | Name | Availability Zone | Hosts | Metadata | UUID |
+—-+—————–+——————-+———–+———————————+————————————–+
| 1 | test-aggregate1 | test-lkj | ‘ ‘ | ‘flavor=lkj-test’ | 36b963f9-ad0e-40fd-8665-6032fc825a0a |
+—-+—————–+——————-+———–+———————————+————————————–+
root@lkj-con:~# openstack aggregate show 2
+——————-+—————————-+
| Field | Value |
+——————-+—————————-+
| availability_zone | test-lkj |
| created_at | 2022-02-11T00:19:14.000000 |
| deleted | False |
| deleted_at | None |
| hosts | |
| id | 2 |
| name | test-aggregate2 |
| properties | flavor=’lkj-test’ |
| updated_at | None |
+——————-+—————————-+

3. aggregate에 원하는 compute-node 추가 후 서버 생성 

root@lkj-con:~# openstack aggregate add host 2 lkj-com2
+——————-+—————————-+
| Field | Value |
+——————-+—————————-+
| availability_zone | None |
| created_at | 2022-02-11T00:19:00.000000 |
| deleted | False |
| deleted_at | None |
| hosts | lkj-com2 |
| id | 1 |
| name | test-aggregate1 |
| properties | test=’ture’ |
| updated_at | None |
+——————-+—————————-+

4. flavor:extra_specs {“flavor”: “lkj-test”} 해당 flavor로 서버를 생성해서 aggregate에 지정한 컴퓨터노드에 인스턴스가 생성

root@lkj-con:~# openstack server create –image Ubuntu20.04 –flavor lkj –net provider test-lkj
+————————————-+—————————————————-+
| Field | Value |
+————————————-+—————————————————-+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | |
| OS-EXT-STS:power_state | NOSTATE |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | j57eNJCAnkdC |
| config_drive | |
| created | 2022-02-11T01:38:57Z |
| flavor | lkj (e17e7625-d41a-4be8-bfb5-f2367ce280e0) |
| hostId | |
| id | bed063d2-7660-4bda-9ce2-b5f8158d92a8 |
| image | Ubuntu20.04 (edc7a7eb-ba38-456b-8065-749e0a0989f3) |
| key_name | None |
| name | test-lkj |
| progress | 0 |
| project_id | 20dbd9db246b47d5bd7df7aac0695b99 |
| properties | |
| security_groups | name=’default’ |
| status | BUILD |
| updated | 2022-02-11T01:38:57Z |
| user_id | ee9595c908e54376867be2212ac8a898 |
| volumes_attached | |
+————————————-+—————————————————-+

root@lkj-con:~# nova show test-lkj
+————————————–+———————————————————-+
| Property | Value |
+————————————–+———————————————————-+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | test-lkj |
| OS-EXT-SRV-ATTR:host | lkj-com2 |  # aggregate 지정해준 노드 
| OS-EXT-SRV-ATTR:hostname | test-lkj |
| OS-EXT-SRV-ATTR:hypervisor_hostname | lkj-com2 |
| OS-EXT-SRV-ATTR:instance_name | instance-00000011 |
| OS-EXT-SRV-ATTR:kernel_id | |
| OS-EXT-SRV-ATTR:launch_index | 0 |
| OS-EXT-SRV-ATTR:ramdisk_id | |
| OS-EXT-SRV-ATTR:reservation_id | r-fufweg96 |
| OS-EXT-SRV-ATTR:root_device_name | /dev/vda |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | – |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2022-02-11T01:39:02.000000 |
| OS-SRV-USG:terminated_at | – |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2022-02-11T01:38:57Z |
| description | test-lkj |
| flavor:disk | 25 |
| flavor:ephemeral | 0 |
| flavor:extra_specs | {“flavor”: “lkj-test”} |
| flavor:original_name | lkj |
| flavor:ram | 1800 |
| flavor:swap | 0 |
| flavor:vcpus | 2 |
| hostId | 45ac4c8a11bfe895b4bf4c648f75c8d22d5206695c20fd1d8c54259e |
| host_status | UP |
| id | bed063d2-7660-4bda-9ce2-b5f8158d92a8 |
| image | Ubuntu20.04 (edc7a7eb-ba38-456b-8065-749e0a0989f3) |
| key_name | – |
| locked | False |
| locked_reason | – |
| metadata | {} |
| name | test-lkj |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| provider network | 115.68.192.xxx |
| security_groups | default |
| server_groups | [] |
| status | ACTIVE |
| tags | [] |
| tenant_id | 20dbd9db246b47d5bd7df7aac0695b99 |
| trusted_image_certificates | – |
| updated | 2022-02-11T01:39:02Z |
| user_id | ee9595c908e54376867be2212ac8a898 |
+————————————–+———————————————————-+

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x