-
Notifications
You must be signed in to change notification settings - Fork 7
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 grow root test #306
Add grow root test #306
Conversation
Set root disk to non-default size of 50GB except in OCI (TBD). And test confirms that the filesystem properly expands.
Updated the test to get root disk size and to add root partition to boot partition if it exists for comparison. This is tested against EC2, GCE, Azure and Aliyun plus regular SSD and NVME. |
Can we assume findmnt, lsblk, df and sed exist in all images? |
Get disk size in test and combine root partition size with boot partition size if it exists.
With a generic test in place this should work on all images no matter the root disk size set.
root_size = int(root_size.replace('G', '')) | ||
|
||
# Get boot partition size | ||
boot_part = host.run('findmnt -n -f -o SOURCE /boot').stdout.strip() |
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.
Sorry I didn't provide all the details, there is a wrinkle which currently falls into the rounding error category. We should at least provide a comment. But it could be coded with an if condition.
For images where we build for UEFI/EFI, GCE ATM, kiwi automatically creates an efi partition that gets mounted to /boot/efi
and as such findmnt -n -f -o SOURCE /boot
will return nothing because the mount point is /boot/efi
. If /boot/efi
grows sufficiently large then we end up with
total_size = / + /boot + /boot/efi
however, since at present the efi partition is < 1 GB the rounding error in the output of df -h
hides this. I don't think /boot/efi will grow to >= 1GB as such it is possibly not worth the effort to do the additional parsing of the output and looking for an efi partition. But a comment in the code to this effect is definitely helpful to help us in the future should the efi partition grow unexpectedly large.
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 noticed this, the problem is that it becomes a slippery slope. Azure images have I think 4 partitions. If we are adding conditionals for efi then we probably need conditionals for the other Azure partitions. IMHO it's not worth chasing all of these and only update things if necessary in the future.
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 will add a comment to cover this...
smaller partitions round to zero so they are ignored in calculation to keep things simple.
@rjschwei I added a comment to the test regarding the smaller partitions which are ignored for simplicity. |
Set root disk to non-default size of 50GB except in OCI (TBD). And test confirms that the filesystem properly expands.
I could not find info in OCI SDK docs about changing root disk parameters when launching instances. Issue opened upstream.