반응형
이전에 LVM 포스팅을 했었는데, 이를 K8s에서 적용해보자.
* 이전포스팅: https://countrymouse.tistory.com/entry/lvm
해당 과정은 파일시스템 부족으로 인한 현상을 해소하기 위해 진행한다.
1. partition 추가
controller-0:~$ source /etc/platform/openrc
[sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-add -t lvm_phys_vol controller-0 /dev/sda 100
+-------------+-------------------------------------------------------+
| Property | Value |
+-------------+-------------------------------------------------------+
| device_path | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 |
| device_node | /dev/sda8 |
| type_guid | ba5eba11-0000-1111-2222-000000000001 |
| type_name | None |
| start_mib | None |
| end_mib | None |
| size_mib | 102400 |
| uuid | 63420173-2fed-44d5-ac8e-3b62a482dbc9 |
| ihost_uuid | 885f5f39-849e-4e6b-9033-273a2af54385 |
| idisk_uuid | a7161ee5-9e84-4d6e-99b6-b5201683afc3 |
| ipv_uuid | None |
| status | Creating |
| created_at | 2021-10-26T10:50:18.074885+00:00 |
| updated_at | None |
+-------------+-------------------------------------------------------+
sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-add -t lvm_phys_vol controller-1 /dev/sda 100
+-------------+-------------------------------------------------------+
| Property | Value |
+-------------+-------------------------------------------------------+
| device_path | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 |
| device_node | /dev/sda8 |
| type_guid | ba5eba11-0000-1111-2222-000000000001 |
| type_name | None |
| start_mib | None |
| end_mib | None |
| size_mib | 102400 |
| uuid | d6e99a18-0c33-4641-a5d2-2c544487f29a |
| ihost_uuid | 9ea6efdb-87d5-407b-abd6-f6af36f2a8be |
| idisk_uuid | 52d09ff1-1811-4e72-9aa5-b0da4f75f001 |
| ipv_uuid | None |
| status | Creating |
| created_at | 2021-10-26T10:53:42.111798+00:00 |
| updated_at | None |
+-------------+-------------------------------------------------------+
2. 추가된 partition의 uuid 확인
[sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-list controller-0
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
| uuid | device_path | device_node | type_guid | type_name | size_gib | status |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
| 63420173-2fed-44d5-ac8e-3b62a482dbc9 | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 | /dev/sda8 | ba5eba11-0000-1111-2222-000000000001 | LVM Physical Volume | 100.0 | Ready |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-list controller-1
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
| uuid | device_path | device_node | type_guid | type_name | size_gib | status |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
| d6e99a18-0c33-4641-a5d2-2c544487f29a | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 | /dev/sda8 | ba5eba11-0000-1111-2222-000000000001 | None | 100.0 | Creating |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
3. 물리 볼륨(PV) 생성 및 볼륨그룹(VG)에 추가
[sysadmin@controller-0 ~(keystone_admin)]$ system host-pv-add controller-0 cgts-vg 63420173-2fed-44d5-ac8e-3b62a482dbc9
+--------------------------+-------------------------------------------------------+
| Property | Value |
+--------------------------+-------------------------------------------------------+
| uuid | fc6a243e-7bfc-4ae0-98d6-4677da33e9eb |
| pv_state | adding |
| pv_type | partition |
| disk_or_part_uuid | 63420173-2fed-44d5-ac8e-3b62a482dbc9 |
| disk_or_part_device_node | /dev/sda8 |
| disk_or_part_device_path | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 |
| lvm_pv_name | /dev/sda8 |
| lvm_vg_name | cgts-vg |
| lvm_pv_uuid | None |
| lvm_pv_size_gib | 0.0 |
| lvm_pe_total | 0 |
| lvm_pe_alloced | 0 |
| ihost_uuid | 885f5f39-849e-4e6b-9033-273a2af54385 |
| created_at | 2021-10-26T10:54:28.910208+00:00 |
| updated_at | None |
+--------------------------+-------------------------------------------------------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-pv-add controller-1 cgts-vg d6e99a18-0c33-4641-a5d2-2c544487f29a
+--------------------------+-------------------------------------------------------+
| Property | Value |
+--------------------------+-------------------------------------------------------+
| uuid | e8464fe1-a7d6-4957-b055-c57a4c1cce5b |
| pv_state | adding |
| pv_type | partition |
| disk_or_part_uuid | d6e99a18-0c33-4641-a5d2-2c544487f29a |
| disk_or_part_device_node | /dev/sda8 |
| disk_or_part_device_path | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 |
| lvm_pv_name | /dev/sda8 |
| lvm_vg_name | cgts-vg |
| lvm_pv_uuid | None |
| lvm_pv_size_gib | 0.0 |
| lvm_pe_total | 0 |
| lvm_pe_alloced | 0 |
| ihost_uuid | 9ea6efdb-87d5-407b-abd6-f6af36f2a8be |
| created_at | 2021-10-26T10:56:00.562599+00:00 |
| updated_at | None |
+--------------------------+-------------------------------------------------------+
4. PV 생성여부 확인
[sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-list controller-0
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
| uuid | device_path | device_node | type_guid | type_name | size_gib | status |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
| 63420173-2fed-44d5-ac8e-3b62a482dbc9 | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 | /dev/sda8 | ba5eba11-0000-1111-2222-000000000001 | LVM Physical Volume | 100.0 | Ready |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+---------------------+----------+--------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-disk-partition-list controller-1
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
| uuid | device_path | device_node | type_guid | type_name | size_gib | status |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
| d6e99a18-0c33-4641-a5d2-2c544487f29a | /dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:0:0-part8 | /dev/sda8 | ba5eba11-0000-1111-2222-000000000001 | None | 100.0 | Creating |
+--------------------------------------+-------------------------------------------------------+-------------+--------------------------------------+-----------+----------+----------+
5. Filesystem size 수정
[sysadmin@controller-0 ~(keystone_admin)]$ system host-fs-modify controller-0 docker=100
+--------------------------------------+---------+-------------+----------------+
| UUID | FS Name | Size in GiB | Logical Volume |
+--------------------------------------+---------+-------------+----------------+
| 6a5114e8-3d69-47cb-8e92-cef7416a2b35 | backup | 25 | backup-lv |
| d5295e55-8983-4c39-a309-10ae957e09d9 | docker | 100 | docker-lv |
| 137933c6-38b5-40c8-876f-a786b2ca63fd | kubelet | 15 | kubelet-lv |
| 1dc26b13-fd96-4974-b3b2-68af0d60a842 | scratch | 16 | scratch-lv |
+--------------------------------------+---------+-------------+----------------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-fs-modify controller-0 kubelet=100
+--------------------------------------+---------+-------------+----------------+
| UUID | FS Name | Size in GiB | Logical Volume |
+--------------------------------------+---------+-------------+----------------+
| 6a5114e8-3d69-47cb-8e92-cef7416a2b35 | backup | 25 | backup-lv |
| d5295e55-8983-4c39-a309-10ae957e09d9 | docker | 100 | docker-lv |
| 137933c6-38b5-40c8-876f-a786b2ca63fd | kubelet | 100 | kubelet-lv |
| 1dc26b13-fd96-4974-b3b2-68af0d60a842 | scratch | 16 | scratch-lv |
+--------------------------------------+---------+-------------+----------------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-fs-modify controller-1 docker=100
+--------------------------------------+---------+-------------+----------------+
| UUID | FS Name | Size in GiB | Logical Volume |
+--------------------------------------+---------+-------------+----------------+
| 0e539999-7bf0-4d93-bd6e-ab8e16fbfd96 | backup | 25 | backup-lv |
| 1eb15c7d-9fa2-4973-980e-1b410df62346 | docker | 100 | docker-lv |
| 0bc4452d-7ef8-4766-b183-cd555cee5920 | kubelet | 10 | kubelet-lv |
| 6aa1e91d-a4d0-4c58-ab9d-0a8fb0e80f76 | scratch | 16 | scratch-lv |
+--------------------------------------+---------+-------------+----------------+
[sysadmin@controller-0 ~(keystone_admin)]$ system host-fs-modify controller-1 kubelet=100
+--------------------------------------+---------+-------------+----------------+
| UUID | FS Name | Size in GiB | Logical Volume |
+--------------------------------------+---------+-------------+----------------+
| 0e539999-7bf0-4d93-bd6e-ab8e16fbfd96 | backup | 25 | backup-lv |
| 1eb15c7d-9fa2-4973-980e-1b410df62346 | docker | 100 | docker-lv |
| 0bc4452d-7ef8-4766-b183-cd555cee5920 | kubelet | 100 | kubelet-lv |
| 6aa1e91d-a4d0-4c58-ab9d-0a8fb0e80f76 | scratch | 16 | scratch-lv |
+--------------------------------------+---------+-------------+----------------+
완료!
반응형