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

Disk resize #68

Merged
merged 5 commits into from
Oct 22, 2020
Merged

Disk resize #68

merged 5 commits into from
Oct 22, 2020

Conversation

cfergeau
Copy link

This set of commits adds disk resize support to the libvirt machine driver. It starts by adding libvirt storage pool support so that virStorageVolResize can be used.

@guillaumerose
Copy link

Would it possible to extract the storage pool code to an other file and in an other struct than the Driver? This file and struct are really too big.

Since we break previous installation, do we need to take extra precaution or just a sentence in the release notes is enough ?

@cfergeau cfergeau mentioned this pull request Oct 21, 2020
@cfergeau
Copy link
Author

Would it possible to extract the storage pool code to an other file and in an other struct than the Driver? This file and struct are really too big.

Sure I can move the storage pool code to a separate file. Not sure which struct you refer to?

Since we break previous installation, do we need to take extra precaution or just a sentence in the release notes is enough ?

We have strong ties between bundle version <-> crc version <-> machine driver version, crc releases won't start unless you use exactly the right versions. Usually we did not give much thought to backward compat with this reasoning. We should try to be more flexible than that, but I definitely did not try hard here :)

@guillaumerose
Copy link

I refer to the Driver struct. Almost all methods belong to it. func (d *Driver) getPool(). I didn't count but it starts to become huge. We can do that later perhaps.

@cfergeau cfergeau force-pushed the disk-resize branch 2 times, most recently from 77bdfe4 to e84b146 Compare October 22, 2020 12:08
This will be more consistant with what other go packages are doing,
having go files in the top-level directory is very unusual
Until now, the libvirt machine driver directly creates an image file,
and then passes this path to libvirt.
This commit adds a libvirt storage pool where this file will live, this
will enable a later commit to implement something similar to `virsh
vol-resize` in order to be able to resize disk images.
This does not change anything related to how the files used by the
libivirt machine driver are laid out, it only 'registers' the
'~/.crc/machines/crc' directory with libvirt so that it knows this
location contains disk images (see 'virsh pool-list' and 'virsh
vol-list')
With the recently added UpdateConfigRaw method and libvirt storage
pool/storage volume support, all that remains to be done is to call
`vol.Resize()` when the size changed.
The application will then need to make sure the partitions/filesystem
inside the VM are resized appropriately.
@guillaumerose
Copy link

/lgtm

@guillaumerose guillaumerose merged commit 440f234 into crc-org:master Oct 22, 2020
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