-
Notifications
You must be signed in to change notification settings - Fork 66
Add images to resource accounting #9613
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
base: main
Are you sure you want to change the base?
Conversation
|
Maybe this is a silly question, but are images replicated the way disk volumes are? I ask because when you see virtual disk storage you can sort of mentally triple or quadruple it to reason about the physical disk size (as dubious an endeavor as that is) but if images are not replicated, then that math no longer works. Again that is probably fine because it is unwise to attempt to reason about physical capacity on the basis of these metrics anyway. |
|
Yeah, images are backed by volumes in the same way that snapshots and crucible disks are, and the same replication factor applies |
This is a good question, and kinda the crux of the discussion in RFD 624 (which we still need to resolve - I'm just trying to track all these resources consistently to start). Local disks can/will violate this property, so we will need to adapt the accounting system to cope. However, images are currently stored with triplicate redundancy, like distributed disks and snapshots. |
| .fetch() | ||
| .await; | ||
|
|
||
| if let Ok((.., authz_image, db_image)) = lookup_result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth considering the possibility that this lookup fails for a reason other than the image not existing?
| project_id | ||
| ) AS totals | ||
| WHERE | ||
| vpc.id = totals.project_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here in the migration you account for existing images in their current projects, but when these images are promoted to silo-level or demoted from silo to project there is nothing updating the accounting for that.
Adds images as a virtual provisioning resource. Images are now tracked as a fourth resource type alongside Instance, Disk, and Snapshot.
Resource Accounting
virtual_disk_bytes_provisionedat the appropriate collection levelsNew Code
ResourceTypeProvisionedandStorageTypeenumsnew_insert_silo_storage,new_delete_silo_storage) for images without a projectSPACE_ACCOUNTsaga action to bothimage_createandimage_deletesagasTesting
test_image_virtual_provisioning_collectionintegration testFixes #9602