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

Allow for setting virtual_size per qemu variant #2041

Merged

Conversation

ashcrow
Copy link
Member

@ashcrow ashcrow commented Feb 12, 2021

Description

Add the ability to set the virtual size in the qemu variant configuration or via a switch in manual mode when using cmd-artifact-disk. This also sets the default virtual size for ibmcloud artifacts to 100G per request.

Test

Done via a local build off the main branch.

$ cosa build qemu
<snip/>
$ cosa buildextend-ibmcloud
<snip/>
$ cosa buildextend-openstack
<snip/>
[coreos-assembler]$ find . -name "*qcow2*"
./builds/.../rhcos-48...-qemu.x86_64.qcow2
./builds/.../rhcos-48...-ibmcloud.x86_64.qcow2
./builds/.../rhcos-48...-openstack.x86_64.qcow2
$ for x in `find . -name "*qcow2*"`; do echo -n `basename $x` " "; qemu-img info $x | grep "virtual size"; done
rhcos-48...-qemu.x86_64.qcow2      virtual size: 16 GiB (17179869184 bytes)
rhcos-48...-ibmcloud.x86_64.qcow2  virtual size: 100 GiB (107374182400 bytes)
rhcos-48...-openstack.x86_64.qcow2 virtual size: 16 GiB (17179869184 bytes)

When provided with a virtual_size directive we now resize the
qemu image before converting the image.
Images builds which symlink to cmd-artifact-disk can optionally
provide a virtual_size in their variant configuration. When in
manual mode the --virtual-size switch can be used directly.
Copy link
Member

@ravanelli ravanelli left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashcrow, ravanelli

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cgwalters
Copy link
Member

cgwalters commented Feb 12, 2021

In general I think we should go in the direction of defaulting to 8GB across the board and encourage people to size it how they like on the infrastructure side. It's just ultimately much more flexible and gets us out of problems like "But I need another 50GB" and confusion around newer versions using more space etc.

See this PR for example openshift/installer#2652

openshift/installer specifically as well as most infrastructure tooling is capable of booting with a desired size that can be specified by the user.

Now yes there's a bit of a downside in that the "default" is small and one has to configure it, but the problem really is that the default size is totally dependent on use case and it's just simpler in the end to really encourage everyone to pick a size for their use case.

Basically at least for OpenShift, the default IPI disk sizes are really set in openshift/installer - it isn't anything to do with the default OS disk size. And we should encourage UPI installs to follow the IPI defaults (ideally they'd be machine-readable in some form...) So it'd be more consistent if this default was applied in openshift/installer if at all possible.

@cgwalters
Copy link
Member

Now that said for FCOS the OS default is more prominent in some cases. And maybe IBMCloud has a thing where they say "disks will be 100GB by default" or something. And I could understand that.

So to be clear I'm not really objecting - I think this is OK. But I think in the future if someone comes along and says "It really should be 150GB" or whatever we should instead tell them "configure it at the infrastructure side" - the cloud should have that knob and their tooling they use to provision the cloud (Terraform/ansible/openshift-machine-api-operator/etc.) should support it.

@ashcrow
Copy link
Member Author

ashcrow commented Feb 12, 2021

Agreed @cgwalters 👍

@mpeter
Copy link

mpeter commented Feb 13, 2021

Now that said for FCOS the OS default is more prominent in some cases. And maybe IBMCloud has a thing where they say "disks will be 100GB by default" or something. And I could understand that.

Thanks @ashcrow & @cgwalters -- for reference if it comes up in the future they do document the 100GB default requirement on the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants