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

Wipe Disks Improvements #885

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ibrokethecloud
Copy link
Contributor

Problem:

We introduced a field in Harvester config named wipeDisks which when set ran a script in the installer to iterate over all disk devices visible to the host and wipe them.

This ended up being too aggressive, not to mention not all disks may contain old Harvester installations.

Solution:

PR introduces two new fields in the harvester config wipeDisksList and wipeAllDisks and drops the old wipeDisks introduced in v1.3

There is an extra panel in disk configuration page. The extra panel contains a drop down menu which gets rendered and populated if installer finds additional disks with existing elemental based installations which are not already used in install device or additional data device.

The extra Wipe Disks panels will only be available when there are additional disks visible to the host which have a partition with COS_OEM label and such disk is not already being used in Install Device or Install Data Device.

image

User can also pass these fields via ipxe using the following two new fields

install:
  wipeAllDisks: true

or

install:
  wipeDisksList: 
     - device1
     - device2

wipeAllDisks uses the same logic as the installers Wipe Disks Panel where it will identify additional disks with COS_OEM partition which are not already being used as Install Device or Install Data Device.

Related Issue:
harvester/harvester#6304
harvester/harvester#6533

Test plan:

PR introduces two new fields in the harvester config wipeDisksList and
wipeAllDisks and drops the old wipeDisks introduced in v1.3

There is an extra panel in disk configuration page. The extra panel
contains a drop down menu which gets rendered and populated if installer
finds additional disks with existing elemental based installations which
are not already used in install device or additional data device
pkg/console/util.go Show resolved Hide resolved
pkg/console/util.go Show resolved Hide resolved
pkg/console/util_test.go Show resolved Hide resolved
@ibrokethecloud ibrokethecloud requested a review from ihcsim December 1, 2024 21:45
ForceGPT bool `json:"forceGpt,omitempty"`
Role string `json:"role,omitempty"`
WithNetImages bool `json:"withNetImages,omitempty"`
WipeDisks bool `json:"wipeDisks,omitempty"`
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 any doc to indicate that harvester.install.wipe_disks is now deprecated? Presumably, with this change, all existing references to harvester.install.wipe_disks won't work anymore, right?

Comment on lines +518 to +519
// when WipeAllDisks is enabled then find all non installation disks with COS_ prefixed labels
// and add them to a list for wiping
Copy link
Contributor

Choose a reason for hiding this comment

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

From a UX perspective, we might need to document that this setting wipe all disks except for the installation and data disks.

return err
}
if len(options) != 0 {
if slices.Contains(c.config.WipeDisksList, c.config.Device) || slices.Contains(c.config.WipeDisksList, c.config.DataDisk) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't getWipeDisksOptions() already perform this filtering?

// if there are no additional disks to wipe then it checks if MBR needs to be enabled
// else will move on to the next apge
isWipeDisksNeeded := func(g *gocui.Gui, v *gocui.View) error {
options, err := getWipeDisksOptions(c.config)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an option for the user to not select a disk, and leave this blank? Or is it required to always provide at least one disk to wipe?

Copy link

mergify bot commented Dec 27, 2024

This pull request is now in conflict. Could you fix it @ibrokethecloud? 🙏

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