-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
data/libvirt: Resize to 16 GiB #413
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/types/config/libvirt/cache.go
Outdated
return err | ||
} | ||
|
||
err = exec.Command("qemu-img", "resize", tempPath, "16G").Run() |
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 this binary always in path?
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.
I checked on this. qemu-img is its own package, but looks like it should always be installed based on dependencies of libvirt and qemu
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.
but actually, virt-resize may be a better choice. It's a bit smarter and knows how to deal with resizing partitions within the disk image.
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.
but actually,
virt-resize
may be a better choice...
Should I try this and fall back to qemu-img
if it's not found? Or can we rely on libvirtd users having it installed?
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.
I don't think you can depend on having this one. We'd have to add "libguestfs-tools-c" as one of the dependencies to install in the libvirt howto, but I think that's the right thing to do.
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.
No, we explicitly don't want virt-resize
- RHCOS includes code to resize partitions on boot.
For similar reasons, you wouldn't want to use virt-resize
on the Fedora/RHEL "classic" cloud images that include cloud-init
, which has similar code.
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.
To elaborate on this further, the reason I prefer this is it maintains parity with how e.g. OpenStack and AWS work - they just resize the raw disk image and rely on code inside the OS to react to that (historically again, that's cloud-init
on many distributions, but not CoreOS).
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.
ACK, fair enough.
The RHCOS team needs to know how large the image needs to be though. Otherwise, the installer will need to pre-process images for every platform. |
I'm confused;
So why does this talk about resizing to 16GB? |
Is pre-processing images for every platform a problem? I think the size constraint is mostly "we need this much space for our installer stuff" and less about how much space the OS itself needs. See also #126, which I guess you'd close as
If/when this lands, you can revert openshift/os#228. |
I understand cloud-init is not in RHCOS; however, terraform-provider-libvirt just merged a PR to add the wanted size to an image. dmacvicar/terraform-provider-libvirt#416 |
/retest Exercising openshift/release#1817. |
I would prefer it if we made use of dmacvicar/terraform-provider-libvirt#416 instead of invoking an external command. I would prefer it even more if we didn't bother with it at all and just assume that the base image will always be big enough. |
I can reroll to do this.
I'm fine with this too; it's really up to the RHCOS folks. If you can talk them into closing #126 (or put your foot down and close it |
This is the size of the current RHCOS images: $ qemu-img info ~/.cache/openshift-install/libvirt/image/2454fcdc0a61a9005fbf916b54fbe332 image: /home/trking/.cache/openshift-install/libvirt/image/2454fcdc0a61a9005fbf916b54fbe332 file format: qcow2 virtual size: 16G (17179869184 bytes) disk size: 1.6G cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false Resizing here will allow the OS folks to stop guessing which size we need [1,2]. And when we need future resizes, we can update here instead of bugging the OS team. Also inline the volume in the libvirt Terraform module. The libvirt/volume module indirection was unnecessary indirection. [1]: openshift#126 [2]: openshift/os#228
I've rebased this onto master and moved to the Terraform |
@crawford is this good to go? |
@abhinavdahiya I'd rather not enforce the size requirement in the installer. RHCOS is specifically designed to run OpenShift workloads (and only OpenShift), so it seems reasonable to me that it is sized correctly. On top of that, it isn't required that the installer is used to create infrastructure, so doing the size check there seems analogous to relying on front-end validation. |
I'm going to close this out. It is not the installer's job to make sure that the OS is the correct size; that's the OS team's responsibility. /close |
@crawford: Closing this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
So close #126 as |
This is the size of the current RHCOS images, but resizing here will allow the OS folks to stop guessing which size we need (#126, openshift/os#228).
Explicitly closing the file before resizing ensures we've flushed the cache after the earlier copy. We probably should have been doing that before the
Rename
anyway. With this explict close, the deferred close call may fail, but that's fine.Dropping to
qemu-img
makes me a bit jumpy, but at least most folks with alibvirtd
running will haveqemu-img
available.Fixes #126.