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 grow root test #306

Merged
merged 4 commits into from
Aug 11, 2021
Merged

Add grow root test #306

merged 4 commits into from
Aug 11, 2021

Conversation

smarlowucf
Copy link
Collaborator

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.

Set root disk to non-default size of 50GB except in OCI (TBD). And
test confirms that the filesystem properly expands.
@smarlowucf
Copy link
Collaborator Author

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.

@smarlowucf
Copy link
Collaborator Author

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()
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.
@smarlowucf
Copy link
Collaborator Author

@rjschwei I added a comment to the test regarding the smaller partitions which are ignored for simplicity.

@rjschwei rjschwei merged commit dc2d885 into master Aug 11, 2021
@smarlowucf smarlowucf deleted the grow-root branch August 11, 2021 19:56
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