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

Install LVMCluster resource during crc start #4114

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

anjannath
Copy link
Member

@openshift-ci openshift-ci bot requested review from cfergeau and gbraad April 9, 2024 12:30
Copy link

openshift-ci bot commented Apr 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from anjannath. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@@ -37,6 +37,7 @@ const (
EmergencyLogin = "enable-emergency-login"
PersistentVolumeSize = "persistent-volume-size"
EnableBundleQuayFallback = "enable-bundle-quay-fallback"
SecondaryDiskSize = "secondary-disk-size"
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this similar to PersistentVolumeSize?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes practically they are the same, one difference is that secondary-disk-size is at the VM level similar to cpus,memory and persistent-volume-size is at the openshift cluster level

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to expose this difference to the user?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, going to use the same config key persistent-volume-size and remove the newly added one

if crcos.FileExists(d.getSecondaryDiskPath()) {
return nil
}
_, err := diskfs.Create(d.getSecondaryDiskPath(), int64(d.SecondaryDiskSize), diskfs.Raw, diskfs.SectorSizeDefault)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is diskfs required? Could this use os.Truncate directly to create an empty disk image?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, this works, tried using os.Truncate, we have to first create an empty file and then change the size using os.Truncate

@@ -79,6 +79,7 @@ func runStart(ctx context.Context) (*types.StartResult, error) {
IngressHTTPPort: config.Get(crcConfig.IngressHTTPPort).AsUInt(),
IngressHTTPSPort: config.Get(crcConfig.IngressHTTPSPort).AsUInt(),
EnableSharedDirs: config.Get(crcConfig.EnableSharedDirs).AsBool(),
SecondaryDiskSize: config.Get(crcConfig.SecondaryDiskSize).AsInt(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we assume only a second disk could exist. But what about Disks ?

Copy link
Member Author

Choose a reason for hiding this comment

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

to make it work with more disks, we'd have to create a separate DiskConfig type maybe.. containing the path and the size then add that to the drivers, i went with this simpler approach to first take care of the requirements for installing topolvm

@anjannath
Copy link
Member Author

this PR is not needed anymore, the snc PRs:

  1. add LVMS operator to openshift cluster snc#869
  2. add LVMS operator to openshift cluster snc#869
    will take care of all the steps needed to install topolvm entirely on snc

after using topolvm as storage provisioner there's
two partitions of type xfs and its ambiguos  which
is the root partition but the root partition  also
has a label 'root' in case of the ocp bundle
@praveenkumar
Copy link
Member

/wip

@praveenkumar
Copy link
Member

/hold

this allows users to also configure the persistent volume's partition
size for the ocp preset, in case of ocp preset the default size of the
persistent volume partition (topolvm partition) is 3G
this adds code to move topolvm partition and restart
the VM which is needed to re-read the changed partition
table, after moving the topolvm partition the root partition
can be grown

since the pv storage is on a separate parition users can also
configure its size using the 'persistent-volume-size' config
this makes it a bit easier to navigate the start.go file by moving
some of the disk size and partition modification functions into  a
separate disks.go file in the same machine package
Copy link

openshift-ci bot commented Jun 3, 2024

@anjannath: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-microshift-crc 92fa114 link true /test e2e-microshift-crc
ci/prow/security 92fa114 link false /test security
ci/prow/integration-crc 92fa114 link true /test integration-crc
ci/prow/e2e-crc 92fa114 link true /test e2e-crc
ci/prow/images 92fa114 link true /test images

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

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.

create LVMCluster resource on crc start
4 participants