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

Add caution/info boxes for VM image virtual size #631

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

tserong
Copy link
Contributor

@tserong tserong commented Aug 27, 2024

When creating volumes from images, it's important the the volume size be greater than or equal to the size of the underlying image. If this is not the case, you'll potentially end up with a corrupt or truncated filesystem in the volume. This is particularly likely to occur with qcow2 images, which can have a virtual size larger than the physical image size.

In Harvester v1.3 and earlier, when creating VMs, the volume size just defaults to 10GiB, regardless of the size of the underyling image. When creating volumes on the volume screen, the size has no default. In both cases it's hard to know the correct size to use, because Harvester prior to v1.4 doesn't expose the virtual size of qcow2 images anywhere. Because of this, I've used "caution" boxes for the v1.3 docs.

In Harvester v1.4, the dashboard will default to setting the size of volumes so they're at least as large as the virtual size of the image, which means users are unlikely to run into trouble (unless they deliberately choose to make the volume size smaller for some reason), so I've dialed it back a bit and used the "info important" style for this version.

If this looks generally OK, I'll copy the v1.3 docs back to v1.2 as well.

Related issue: harvester/harvester#4905

When creating volumes from images, it's important the the volume size
be greater than or equal to the size of the underlying image.  If this
is not the case, you'll potentially end up with a corrupt or truncated
filesystem in the volume.  This is particularly likely to occur with
qcow2 images, which can have a virtual size larger than the physical
image size.

In Harvester v1.3 and earlier, when creating VMs, the volume size
just defaults to 10GiB, regardless of the size of the underyling image.
When creating volumes on the volume screen, the size has no default.
In both cases it's hard to know the correct size to use, because
Harvester prior to v1.4 doesn't expose the virtual size of qcow2
images anywhere.  Because of this, I've used "caution" boxes for
the v1.3 docs.

In Harvester v1.4, the dashboard will default to setting the size of
volumes so they're at least as large as the virtual size of the image,
which means users are unlikely to run into trouble (unless they
deliberately choose to make the volume size smaller for some reason),
so I've dialed it back a bit and used the "info important" style for
this version.

If this looks generally OK, I'll copy the v1.3 docs back to v1.2
as well.

Related issue: harvester/harvester#4905

Signed-off-by: Tim Serong <tserong@suse.com>
Copy link

github-actions bot commented Aug 27, 2024

Name Link
🔨 Latest commit 3e81be7
😎 Deploy Preview https://66d273cf542931831fdc6511--harvester-preview.netlify.app

@tserong
Copy link
Contributor Author

tserong commented Aug 27, 2024

Thinking about this some more, I should probably make the v1.3 VM creation note explicitly say that Harvester defaults to 10GiB, something like this:

When creating volumes from VM images, be sure the volume size is sufficient for the image. This is particularly important with qcow2 images, which can have a virtual size larger than the physical image size. If the volume size is set smaller than size of the underlying image, the volume will potentially be corrupt. By default, Harvester will set the volume size to 10GiB, but you need to verify that this is enough and change the size if necessary. You can run the command qemu-img info YOUR_IMAGE_FILE.qcow2 to determine the virtual size of a qcow2 image.

It's getting pretty wordy though :-/

Copy link
Contributor

@jillian-maroket jillian-maroket left a comment

Choose a reason for hiding this comment

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

@tserong Looks good overall, just rephrased in a few places for clarity. Let me know what you think.

docs/vm/create-vm.md Outdated Show resolved Hide resolved
versioned_docs/version-v1.3/vm/create-vm.md Outdated Show resolved Hide resolved
tserong and others added 4 commits August 30, 2024 16:48
Co-authored-by: Jillian <67180770+jillian-maroket@users.noreply.github.com>
Co-authored-by: Jillian <67180770+jillian-maroket@users.noreply.github.com>
Signed-off-by: Tim Serong <tserong@suse.com>
Signed-off-by: Tim Serong <tserong@suse.com>
@tserong
Copy link
Contributor Author

tserong commented Aug 30, 2024

Thanks @jillian-maroket that's excellent. I've also applied what you suggested to the volume creation pages, and then copied the v1.3 changes back to v1.2.

Copy link
Contributor

@jillian-maroket jillian-maroket left a comment

Choose a reason for hiding this comment

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

@tserong LGTM. The context you provided made all the difference. Massive thanks for making my job easier.

@jillian-maroket jillian-maroket merged commit 842c2be into harvester:main Sep 2, 2024
3 checks passed
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