zhhuabj

Untitled

Oct 22nd, 2026
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.79 KB | None | 0 0
  1. PR #1162 - Review Fix Validation
  2.  
  3. 1. Local checks
  4.  
  5. $ tox -e pep8,pylint,yamllint,hotyvalidate
  6. pep8: OK
  7. pylint: OK (10.00/10)
  8. yamllint: OK
  9. hotyvalidate: checked 222 scenarios and 449 tests, all OK!
  10.  
  11. $ TESTS_DIR=/bak/work/hotsos/tests/unit/ HOTSOS_ROOT=/bak/work/hotsos/hotsos .tox/py3/bin/stestr run --test-path tests/unit "(test_disks|test_storage|test_cli)"
  12. Ran: 57 tests in 1.4032 sec.
  13. - Passed: 57
  14. - Failed: 0
  15.  
  16. $ TESTS_DIR=/bak/work/hotsos/tests/unit/ HOTSOS_ROOT=/bak/work/hotsos/hotsos .tox/py3/bin/stestr run --test-path tests/unit
  17. Ran: 1030 tests in 17.4336 sec.
  18. - Passed: 1029
  19. - Skipped: 1
  20. - Failed: 0
  21.  
  22. $ tox -e functional
  23. functional: OK (all plugins full and short passed)
  24.  
  25. 2. Deploy to Ceph OSD node (ceph-osd/3)
  26.  
  27. $ juju scp ~/hotsos-review-1122-20261023.tar.gz ~/hotsos-review-1122-live.py ceph-osd/3:/tmp/
  28. $ juju ssh ceph-osd/3 "sudo -n rm -rf /tmp/hotsos-review-1122-20261021 && mkdir -p /tmp/hotsos-review-1122-20261021 && tar -xzf /tmp/hotsos-review-1122-20261023.tar.gz -C /tmp/hotsos-review-1122-20261021 && sha256sum /tmp/hotsos-review-1122-20261021/hotsos/core/host_helpers/storage.py /tmp/hotsos-review-1122-20261021/hotsos/core/plugins/storage/disks.py"
  29. 27474c2a457e6e34f67c0d74070ba7f9776b2530de33fa6cd58209c07d7be6b8 /tmp/hotsos-review-1122-20261021/hotsos/core/host_helpers/storage.py
  30. 507f42b7be427176efbbb36727835b7cd71aed20acc7a46a39234d9a99e6704c /tmp/hotsos-review-1122-20261021/hotsos/core/plugins/storage/disks.py
  31.  
  32. 3. Baseline (00-baseline)
  33.  
  34. $ vgs --noheadings -o vg_name
  35. ceph-563d82c3-59f7-48bb-aaf0-1a8e0b2c90d9
  36. ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216
  37.  
  38. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  39. {
  40. "stage": "00-baseline",
  41. "disks": {
  42. "unallocated-volume-groups": [
  43. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  44. ]
  45. }
  46. }
  47. PASS 00-baseline
  48.  
  49. 4. Entirely unused disk (01-bare-disk)
  50.  
  51. $ modprobe scsi_debug dev_size_mb=512
  52. $ udevadm settle
  53. $ blockdev --getsize64 /dev/sdd
  54. 536870912
  55. $ lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL /dev/sdd
  56. NAME SIZE TYPE FSTYPE MOUNTPOINT MODEL
  57. sdd 512M disk scsi_debug
  58.  
  59. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  60. {
  61. "stage": "01-bare-disk",
  62. "disks": {
  63. "unallocated-volume-groups": [
  64. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  65. ],
  66. "unused-disks": [
  67. "/dev/sdd (512M)"
  68. ]
  69. }
  70. }
  71. PASS 01-bare-disk
  72.  
  73. 5. GPT with no partitions (02-empty-gpt)
  74.  
  75. $ parted -s /dev/sdd mklabel gpt
  76. $ udevadm settle
  77. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  78. {
  79. "stage": "02-empty-gpt",
  80. "disks": {
  81. "unallocated-disks": [
  82. "/dev/sdd (512M)"
  83. ],
  84. "unallocated-volume-groups": [
  85. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  86. ]
  87. }
  88. }
  89. PASS 02-empty-gpt
  90.  
  91. 6. Empty partition + unallocated disk space (03-empty-partition)
  92.  
  93. $ parted -s /dev/sdd mkpart primary 1MiB 200MiB
  94. $ udevadm settle
  95. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  96. {
  97. "stage": "03-empty-partition",
  98. "disks": {
  99. "empty-partitions": [
  100. "/dev/sdd1 (199M)"
  101. ],
  102. "unallocated-disks": [
  103. "/dev/sdd (313M)"
  104. ],
  105. "unallocated-volume-groups": [
  106. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  107. ]
  108. }
  109. }
  110. PASS 03-empty-partition
  111.  
  112. 7. Format partition (04-formatted-partial)
  113.  
  114. $ mkfs.ext4 -F /dev/sdd1
  115. Creating filesystem with 50944 4k blocks and 50944 inodes
  116. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  117. {
  118. "stage": "04-formatted-partial",
  119. "disks": {
  120. "unallocated-disks": [
  121. "/dev/sdd (313M)"
  122. ],
  123. "unallocated-volume-groups": [
  124. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  125. ]
  126. }
  127. }
  128. PASS 04-formatted-partial
  129.  
  130. 8. Allocate remaining disk space (05-fully-partitioned)
  131.  
  132. $ parted -s /dev/sdd mkpart primary 200MiB 100%
  133. $ udevadm settle
  134. $ mkfs.ext4 -F /dev/sdd2
  135. Creating filesystem with 79616 4k blocks and 79632 inodes
  136. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  137. {
  138. "stage": "05-fully-partitioned",
  139. "disks": {
  140. "unallocated-volume-groups": [
  141. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  142. ]
  143. }
  144. }
  145. PASS 05-fully-partitioned
  146.  
  147. 9. LVM volume group with free space (06-lvm-free)
  148.  
  149. $ wipefs -a /dev/sdd1 /dev/sdd2
  150. $ parted -s /dev/sdd rm 2 rm 1
  151. $ wipefs -a /dev/sdd
  152. $ udevadm settle
  153. $ pvcreate /dev/sdd
  154. Physical volume "/dev/sdd" successfully created.
  155. $ vgcreate hotsos-review1122 /dev/sdd
  156. Volume group "hotsos-review1122" successfully created
  157. $ lvcreate -L 200M -n test-lv hotsos-review1122
  158. Logical volume "test-lv" created.
  159. $ vgs -v --config=global{metadata_read_only=1} --nolocking --foreign
  160. VG Attr Ext #PV #LV #SN VSize VFree VG UUID
  161. ceph-563d82c3-59f7-48bb-aaf0-1a8e0b2c90d9 wz--n- 4.00m 1 1 0 9.98g 0 Koh30S-4b0y-dTR0-0924-QvIi-HYYa-mwTi9X
  162. ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 wz--n- 4.00m 1 1 0 1004.00m 104.00m j7GUeq-d3MD-oWal-voA6-q949-1R03-B87XMF
  163. hotsos-review1122 wz--n- 4.00m 1 1 0 508.00m 308.00m eTmr2a-6E2y-0DSy-aXo9-AIcU-PkkN-bnMEJt
  164.  
  165. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  166. {
  167. "stage": "06-lvm-free",
  168. "disks": {
  169. "unallocated-volume-groups": [
  170. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)",
  171. "hotsos-review1122 (308M)"
  172. ]
  173. }
  174. }
  175. PASS 06-lvm-free
  176.  
  177. 10. Allocate remaining VG space (07-lvm-allocated)
  178.  
  179. $ lvextend -l +100%FREE /dev/hotsos-review1122/test-lv
  180. Size of logical volume hotsos-review1122/test-lv changed from 200.00 MiB (50 extents) to 508.00 MiB (127 extents).
  181. Logical volume hotsos-review1122/test-lv successfully resized.
  182. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  183. {
  184. "stage": "07-lvm-allocated",
  185. "disks": {
  186. "unallocated-volume-groups": [
  187. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  188. ]
  189. }
  190. }
  191. PASS 07-lvm-allocated
  192.  
  193. 11. Cleanup and baseline verification (08-cleaned-baseline)
  194.  
  195. $ vgremove -f hotsos-review1122
  196. Logical volume "test-lv" successfully removed
  197. Volume group "hotsos-review1122" successfully removed
  198. $ pvremove /dev/sdd
  199. Labels on physical volume "/dev/sdd" successfully wiped.
  200. $ udevadm settle
  201. $ rmmod scsi_debug
  202. $ test ! -e /sys/module/scsi_debug && test ! -e /dev/sdd
  203. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json
  204. {
  205. "stage": "08-cleaned-baseline",
  206. "disks": {
  207. "unallocated-volume-groups": [
  208. "ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)"
  209. ]
  210. }
  211. }
  212. PASS 08-cleaned-baseline
  213.  
  214. 12. Live vgs-only data-root check (no lsblk data)
  215.  
  216. $ mkdir -p /tmp/vgs-only-root/sos_commands/lvm2 /tmp/vgs-only-root/sos_commands/date
  217. $ date > /tmp/vgs-only-root/sos_commands/date/date
  218. $ cp /proc/uptime /tmp/vgs-only-root/uptime
  219. $ vgs -v --config=global{metadata_read_only=1} --nolocking --foreign > /tmp/vgs-only-root/sos_commands/lvm2/vgs_-v_-o_vg_mda_count_vg_mda_free_vg_mda_size_vg_mda_used_count_vg_tags_systemid_--config_global_metadata_read_only_1_--nolocking_--foreign 2>&1
  220. $ PYTHONPATH=/tmp/hotsos-review-1122-20261021 /usr/bin/python3 /tmp/hotsos-review-1122-20261021/hotsos/cli.py --storage --format json /tmp/vgs-only-root | tail -n +2 | python3 -c 'import json,sys; print("VGS_ONLY_DISKS:", json.load(sys.stdin)["storage"].get("disks"))'
  221. VGS_ONLY_DISKS: {'unallocated-volume-groups': ['ceph-db-c05d0c98-4b50-423b-a7c2-b1ae69bb6216 (104M)']}
  222. $ rm -rf /tmp/vgs-only-root
  223.  
  224. 13. Post-test cluster health
  225.  
  226. $ juju status ceph-osd
  227. Unit Workload Agent Machine Public address Ports Message
  228. ceph-osd/3* active idle 22 10.149.144.41 Unit is ready (1 OSD)
  229. ceph-osd/4 active idle 23 10.149.144.12 Unit is ready (1 OSD)
  230. ceph-osd/5 active idle 24 10.149.144.16 Unit is ready (1 OSD)
  231.  
  232. $ juju ssh ceph-mon/0 "sudo -n ceph -s"
  233. services:
  234. mon: 1 daemons, quorum juju-b45c2d-ceph-0 (age 8w)
  235. mgr: juju-b45c2d-ceph-0(active, since 8w)
  236. osd: 3 osds: 3 up (since 3d), 3 in (since 6w)
  237. data:
  238. pools: 4 pools, 69 pgs
  239. objects: 97 objects, 618 MiB
  240. usage: 5.0 GiB used, 28 GiB / 33 GiB avail
  241. pgs: 69 active+clean
Advertisement
Add Comment
Please, Sign In to add comment