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

Program to remove a boot image. #1589

Merged
merged 3 commits into from
May 16, 2024
Merged

Program to remove a boot image. #1589

merged 3 commits into from
May 16, 2024

Conversation

pykello
Copy link
Contributor

@pykello pykello commented May 13, 2024

Once we install a newer version of an image, we might want to remove the older versions. This program enables that.

To use it, an operator is expect to run the following in the REPL:

> boot_image = BootImage[... id ...]
> st = boot_image.remove_boot_image

Then it'll wait for storage volumes using that boot image to drain and after that it'll remove the image files and db records.

@pykello pykello force-pushed the pykello/remove_boot_image branch from d579784 to b9c6d2f Compare May 13, 2024 23:05
@pykello pykello force-pushed the pykello/remove_boot_image branch 2 times, most recently from a2abecb to 9359e7c Compare May 15, 2024 19:31
@pykello pykello requested a review from enescakir May 15, 2024 19:39
migrate/20240516_boot_image_size_gib.rb Outdated Show resolved Hide resolved
migrate/20240516_boot_image_size_gib.rb Outdated Show resolved Hide resolved
prog/remove_boot_image.rb Outdated Show resolved Hide resolved
@pykello pykello force-pushed the pykello/remove_boot_image branch from 9359e7c to 5557c7e Compare May 15, 2024 21:03
@pykello pykello requested a review from enescakir May 15, 2024 21:05
We need this when removing a boot image, when we want to update
available storage on the storage device.

Alternatively, we could get the size using an ssh command when removing
the boot image. But since this is also useful as a way of
double-checking approximate total used size on a storage device, where
we can just sum vm_storage_volume and boot_image sizes on it.
Once we install a newer version of an image, we might want to remove the
older versions. This program enables that.

To use it, an operator is expect to run the following in the REPL:

```
> boot_image = BootImage[... id ...]
> st = boot_image.remove_boot_image
```

Then it'll wait for storage volumes using that boot image to drain and
after that it'll remove the image files and db records.
@pykello pykello force-pushed the pykello/remove_boot_image branch from 5557c7e to 9cc01cd Compare May 15, 2024 21:19
Copy link
Member

@enescakir enescakir left a comment

Choose a reason for hiding this comment

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

LGTM

@pykello pykello merged commit ea45981 into main May 16, 2024
6 checks passed
@pykello pykello deleted the pykello/remove_boot_image branch May 16, 2024 16:32
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants