Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to omdb #4299

Merged
merged 7 commits into from
Oct 28, 2023
Merged

Updates to omdb #4299

merged 7 commits into from
Oct 28, 2023

Conversation

leftwo
Copy link
Contributor

@leftwo leftwo commented Oct 19, 2023

Some omdb updates

There is actually a bunch more I want to do here, but wanted to get these changes in
first and then build on them. I could easily add another 100 lines, but no reason all those
changes need to be together.

The changes here are:
Added a new omdb db snapshot command:

root@oxz_switch:/tmp# ./omdb db snapshots
Print information about snapshots

Usage: omdb db snapshots <COMMAND>

Commands:
  info  Get info for a specific snapshot
  list  Summarize current snapshots
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

A example snapshot listing:

root@oxz_switch:/tmp# ./omdb db snapshots list
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
SNAP_NAME                            ID                                   STATE SIZE    SOURCE_DISK_ID                       SOURCE_VOLUME_ID                     DESTINATION_VOLUME_ID                
jsnap                                29f67dc2-b9fd-452c-bce0-bb869ec07693 ready 3 GiB   c2a88dea-0b4d-49cb-8d6f-24545a8cc929 3d335365-32e1-43d6-8b1c-55a392e9c734 5658c2d8-60f1-4c34-81ee-c4c83bacfc81 
helios-1696861750                    34c19256-18a6-4941-a966-f43d492be3ea ready 8 GiB   2fdc7099-f46f-45ca-ad46-a25b73cd2064 e0098ccc-2aa8-4e1d-a1aa-75f91bd8c6ae 66873e5c-9f2e-47c4-8324-f12b6685be48 
jammy-snapshot                       3ee7f6fd-08dd-40e7-ae4f-89e9c2851259 ready 3 GiB   9300d416-c850-417d-8d1a-ad9b201bf320 2b857801-c592-4b74-995b-ddda938982d5 92144ad0-085f-4064-881d-2fb0b20e8629 
from-rocky8-snapshot-c80e20          4028c94f-f021-439b-af78-b5c8f5a670d6 ready 240 GiB 653a4bee-90e8-4908-b7bc-79c710ab234b 5d5b19d3-0b9e-4247-8fe2-a53bd07a0711 1d5619ca-3331-496d-ae98-a804cf58df82 
bookworm-snapshot                    4650aa6c-72e4-49b3-9236-72b59e776369 ready 2 GiB   6bb06959-449e-4621-9254-f15188a728b2 574c3980-edbf-4ae1-8d9b-e395405b7436 a00d8712-3664-4c6c-a9a8-74fbdff155a8 
sysbench-mysql-10-eeab88             50d484e0-27b8-496d-b028-1d0a907e41f9 ready 100 GiB 545c928e-ce05-4ff2-b5b4-4839465f870b cb51f933-ffae-4217-807c-3c74aed9acb2 683a63d5-45b1-479c-88c9-9822b598a299 
bsnap                                546e43f8-2cb5-4072-96ab-03119239b025 ready 64 GiB  02229289-2506-44e7-9fb8-4b9b8b96f005 95b47a13-530e-4224-b33e-0df1ad60e42b e6bca8db-43b9-45c7-be01-a33224219cc0 
jammy-snapshot                       5a5e7e63-f9a0-4e83-bb3d-ec17bef63864 ready 3 GiB   aee8503f-44c8-4195-8694-bd4a011784d4 9a7e3283-b077-46a9-b7c6-899fa82c6c52 c3fd8d3a-c8c9-4d91-ac9d-37c238698ccd 
docker-engine-1-364a97               94b1b0b5-3f8c-423b-92ba-f16ea551d47d ready 50 GiB  e1882cbd-237f-4bd2-a1de-c59325a99d2c b7e72840-bb5b-4859-a699-55d298de1a3f 5fe3e57a-bb08-4075-9f87-f655eec65e05 
bookworm-snapshot                    9cfbd233-dfa4-4469-aa0c-60b57d9da3a8 ready 2 GiB   ed40cb75-4fcc-4502-8341-c7657ec029bb 9fdb9031-9a3a-4e17-893b-47bd6b600af8 d886dfdb-76d3-4a38-a923-1663cef6b74f 
docker-engine-ubuntu22-0c11d8-59177c be045ec5-b9b0-4037-af2d-9699c6d7bc3d ready 50 GiB  94f7d776-c87f-41a8-959a-372fd7b5b1a9 162e0ca1-9025-41b0-988b-44bb8ff9f062 4f60c47b-8420-42fe-88bc-2cbb0dccef2a 

An example with a specific snapshot:

root@oxz_switch:/tmp# ./omdb db snapshots info 546e43f8-2cb5-4072-96ab-03119239b025
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
SNAP_NAME ID                                   STATE SIZE   SOURCE_DISK_ID                       SOURCE_VOLUME_ID                     DESTINATION_VOLUME_ID                
bsnap     546e43f8-2cb5-4072-96ab-03119239b025 ready 64 GiB 02229289-2506-44e7-9fb8-4b9b8b96f005 95b47a13-530e-4224-b33e-0df1ad60e42b e6bca8db-43b9-45c7-be01-a33224219cc0 
HOST_SERIAL REGION                               ZONE                                              PHYSICAL_DISK                        
BRM42220016 20cc7a90-acaa-4757-9ccc-743150796e4a oxz_crucible_1876cdcf-b2e7-4b79-ad2e-67df716e1860 98a0f6c6-c295-423e-a8cb-2a48b1b8b110 
BRM42220006 a1dc286c-6f6a-46c1-98ef-a1f0e33b5d3e oxz_crucible_9b8194ee-917d-4abc-a55c-94cea6cdaea1 bf1079bc-c016-409f-814a-7bf40adda20f 
BRM44220010 579998bb-7314-45ea-9bfc-b1dbb23b8da8 oxz_crucible_9c7c805a-f5ed-4e48-86e3-7aa81a718881 75afbe8b-6b80-45a7-9a0d-66aa6f1fef80 

db disk info command now includes the volume_id and disk state
A stopped instance:

root@oxz_switch:/tmp# ./omdb db disks info fb66b7da-857a-45a7-9bd1-3a61bbb77da9
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
HOST_SERIAL       DISK_NAME        INSTANCE_NAME    PROPOLIS_ZONE        VOLUME_ID                            DISK_STATE 
<not on any sled> sysbench-mysql-9 sysbench-mysql-9 <no active Propolis> 7026bb99-9b26-41a6-882f-4d09b2b7a029 attached   
HOST_SERIAL REGION                               ZONE                                              PHYSICAL_DISK                        
BRM42220006 53e4fffd-49de-4175-9841-4c8ffa393fa1 oxz_crucible_46d1afcc-cc3f-4b17-aafc-054dd4862d15 3f6ca632-29ad-41c8-86ae-13c77caf5b92 
BRM42220009 fd1752f5-fa20-45cb-8ecd-d50ab03eecd8 oxz_crucible_7d5e942b-926c-442d-937a-76cc4aa72bf3 7e34a25f-ba92-4904-b8ea-7cd32559c6fd 
BRM42220014 bdfb36ac-30c9-4aa8-8a2c-54c4a1478165 oxz_crucible_c9a367c7-64d7-48e4-b484-9ecb4e8faea7 0bd09168-ce80-4448-ba72-7d8ea129283d 

A running instance:

root@oxz_switch:/tmp# ./omdb db disks info fe12d10e-d652-4713-ae41-74e314a437eb
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
HOST_SERIAL DISK_NAME        INSTANCE_NAME           PROPOLIS_ZONE                                            VOLUME_ID                            DISK_STATE 
BRM42220014 data-disk-rocky9 disk-stress-test-rocky9 oxz_propolis-server_948affa3-991e-48c5-8ca3-9971c2e72921 50262ab8-5090-4cf0-b603-312684f63f7a attached   
HOST_SERIAL REGION                               ZONE                                              PHYSICAL_DISK                        
BRM42220017 896944d9-385f-4b11-9b7c-3558c0f23a17 oxz_crucible_5d0e03b2-8958-4c43-8851-bf819f102958 7281ca3b-0ec2-46a2-af85-450b5bd151d3 
BRM42220014 3c83e0d5-9f3b-42bd-baa5-623ab42df4ea oxz_crucible_bc5124d8-65e8-4879-bfac-64d59003d482 52e05f7d-b95d-4d40-9a17-bfcd92b1d542 
BRM42220016 9bb67991-ea2f-4e6f-a7ca-d430b0b86cd0 oxz_crucible_d4d9acc8-3e0b-4fab-a0a2-d21920fabd7e ef01ef55-e9cf-4aa2-a2d8-d59ed1065e13 

A disk that is not attached:

root@oxz_switch:/tmp# ./omdb db disks info ffedccab-ff5a-4225-b560-90eec17c9041
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
HOST_SERIAL DISK_NAME       INSTANCE_NAME PROPOLIS_ZONE VOLUME_ID                            DISK_STATE 
-           second-disk-115 -             -             e011fca3-82c5-4ca7-b78c-9d63fcb7c959 detached   
HOST_SERIAL REGION                               ZONE                                              PHYSICAL_DISK                        
BRM44220005 5c1d2afc-4eb1-4779-8c6d-da43cdbe6d2c oxz_crucible_9c5d88c9-8ff1-4f23-9438-7b81322eaf68 c463143f-9a4e-4ac0-8c9f-49bd07f0f7f4 
BRM42220031 db7d4663-8f14-4fa0-baef-57dc13b24eb6 oxz_crucible_cf98c4d6-4a7b-49c0-9b14-48a8adf52ce9 d25372e4-fee4-45d3-bfc9-8448b29af663 
BRM42220031 ed21053f-d486-4028-a446-ade7fbde33a9 oxz_crucible_d0eea3b2-e5ac-42bf-97b7-531b78fa06d1 7ba6dc02-c2ec-4f91-bc32-26928c111b42

db instance command was updated to show sled serial number

root@oxz_switch:/tmp# ./omdb db instances                                                                                                                                                                
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable                                                                                                         
note: database schema version matches expected (7.0.0)                                                                                                                                                   
WARN: listing instances: found 500 items (the limit).  There may be more items that were ignored.  Consider overriding with --fetch-limit.                                                               
ID                                   NAME                         STATE     PROPOLIS_ID                          SLED_ID                              HOST_SERIAL                                        
57396a9a-1daf-4aef-8331-13025b4b5435 testset-d-18                 running   13824394-eae7-416f-8697-267c0c2a3b91 87c2c4fc-b0c7-4fef-a305-78f0ed265bbc BRM42220014                                        
24052ec4-8397-42ba-a69d-49c1737d2764 testset-a-18                 running   1d07361c-d4c0-44ca-85e5-7999bed309b1 7b862eb6-7f50-4c2f-b9a6-0d12ac913d3c BRM44220010                                        
3f5f8450-d45a-4d29-abe6-2942a971c760 testset-a-5                  running   1de71cc4-e5d4-4ec1-a23e-9ddb1b56e8f8 71def415-55ad-46b4-ba88-3ca55d7fb287 BRM42220051 
25192994-b583-4ec5-9d08-6bebfb5c2749 testset-b-1                  running   22606795-fe0c-492a-83f5-006daebcb923 dd83e75a-1edf-4aa1-89a0-cd8b2091a7cd BRM42220016 
2a54c6dd-d826-49d5-828b-f4feee8b723c testset-a-3                  running   2907ec47-80c2-48ba-b861-b4b123a10f3a b886b58a-1e3f-4be1-b9f2-0c2e66c6bc88 BRM42220006 
... <snip removed many lines>

db physical now shows snapshot info
A physical disk with no snapshots:

root@oxz_switch:/tmp# ./omdb db  disks physical 7ba6dc02-c2ec-4f91-bc32-26928c111b42
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
Physical disk: 7ba6dc02-c2ec-4f91-bc32-26928c111b42 found on sled: BRM42220031
DATASETS: {d0eea3b2-e5ac-42bf-97b7-531b78fa06d1}
DISK_NAME         ID                                   STATE    INSTANCE_NAME     
testset-c-10      293005e5-b918-427a-82aa-e9daabbfaa4e attached testset-c-10      
sysbench-mysql-11 7cd8e5b6-227d-478a-9ff5-fb570a12488a attached sysbench-mysql-11 
testset-a-20      7f442e20-48d8-49ec-a320-27145cce834a attached testset-a-20      
testset-a-18      9515e62e-6175-479e-be2e-93ca384e0ebf attached testset-a-18      
testset-a-10      b0d88308-c610-4c55-b74f-b6a13d74119b attached testset-a-10      
sysbench-mysql-14 d9ac9c69-4c7e-47a5-9938-faf817a58797 attached sysbench-mysql-14 
second-disk-115   ffedccab-ff5a-4225-b560-90eec17c9041 detached -                 
DATASET_ID REGION_ID SNAPSHOT_ID VOLUME_REFERENCES 
SNAP_NAME ID STATE SIZE SOURCE_DISK_ID SOURCE_VOLUME_ID DESTINATION_VOLUME_ID

A physical disk with a snapshot:

root@oxz_switch:/tmp# ./omdb db disks physical b3302104-6f60-4a05-9b1f-fbfa8f7f77b5
note: using database URL postgresql://root@[fd00:1122:3344:109::3]:32221/omicron?sslmode=disable
note: database schema version matches expected (7.0.0)
Physical disk: b3302104-6f60-4a05-9b1f-fbfa8f7f77b5 found on sled: BRM42220017
DATASETS: {4f9f2e1d-be04-4e8b-a50b-ffb18557a650}
DISK_NAME            ID                                   STATE    INSTANCE_NAME 
testset-c-5          5c6f13c1-781c-453b-863a-ab52ebc437a5 attached testset-c-5   
from-rocky8-snapshot 653a4bee-90e8-4908-b7bc-79c710ab234b detached -             
host34-disk          a5f171ea-2914-4126-ae09-f73250e2a55e detached -             
testset-c-8          d9c458de-1ebf-481a-b013-c1e98247d0ae attached testset-c-8   
DATASET_ID                           REGION_ID                            SNAPSHOT_ID                          VOLUME_REFERENCES 
4f9f2e1d-be04-4e8b-a50b-ffb18557a650 33a8016c-c1c2-4b49-9d0c-8de82469873e 4028c94f-f021-439b-af78-b5c8f5a670d6 1                 
SNAP_NAME                   ID                                   STATE SIZE    SOURCE_DISK_ID                       SOURCE_VOLUME_ID                     DESTINATION_VOLUME_ID                
from-rocky8-snapshot-c80e20 4028c94f-f021-439b-af78-b5c8f5a670d6 ready 240 GiB 653a4bee-90e8-4908-b7bc-79c710ab234b 5d5b19d3-0b9e-4247-8fe2-a53bd07a0711 1d5619ca-3331-496d-ae98-a804cf58df82 

Also, updated a bunch of load_async() calls.

Added a new omdb db snapshot command
db disk info command now includes the volume_id and disk state
db instance command was updated to show sled serial number
db physical now shows snapshot info
Updated load_async() calls.
Copy link
Contributor

@jordanhendricks jordanhendricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! hurray for omdb

@leftwo leftwo merged commit 822be6b into main Oct 28, 2023
20 checks passed
@leftwo leftwo deleted the alan/omdb-phys branch October 28, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants