[pve-devel] [PATCH installer 5/6] ask for renaming of existing pmg/pve VGs early
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Dec 11 16:40:55 CET 2019
On 11/29/19 11:53 AM, Stoiko Ivanov wrote:
> instead of asking the user whether they want to rename an existing VG
> named 'pve' or 'pmg' after running through the installer and partitioning
> the disks, do so directly on the hd-selection view.
Don't see real advantage there, IMO it's not a HD selection question.
IF we do this here then with a full view of all disks, and their partitions,
and FS, ... on them, so that a wipe can be done by the user - as then one
can cleanup all the disks wanting to use for data later already, e.g., ceph
OSDs extra ZFS pools, ... I'd say >99.99% we have no dual boot and users want
to use all available disks for PVE, sooner or later, in one way or the others,
thus left-overs which break boot are 99.99999% wanted to be destroyed.
(but not 100%, so no auto wipe whatever, always ask, but the option "abort" or
ignore is not an option I want, people can use Debian installer if they want to
install something without renaming their pve VG, or such changes)
>
> Additionally refactor ask_existing_vg_rename_or_abort to reuse the
> dialog generation from ask_existing_diskconfig_or_abort.
>
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> proxinstall | 19 ++++++++-----------
> 1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/proxinstall b/proxinstall
> index d2abdcd..7eddafb 100755
> --- a/proxinstall
> +++ b/proxinstall
> @@ -1042,11 +1042,8 @@ sub ask_existing_vg_rename_or_abort {
> }
> $message .= "or cancel the installation?";
>
> - my $dialog = Gtk3::MessageDialog->new($window, 'modal', 'question', 'ok-cancel', $message);
> - my $response = $dialog->run();
> - $dialog->destroy();
> + my $rename_vgs = sub {
>
> - if ($response eq 'ok') {
> for my $vg_uuid (keys %$duplicate_vgs) {
> my $vg = $duplicate_vgs->{$vg_uuid};
> my $new_vgname = $vg->{new_vgname};
> @@ -1054,11 +1051,9 @@ sub ask_existing_vg_rename_or_abort {
> syscmd("vgrename $vg_uuid $new_vgname") == 0 ||
> die "could not rename VG from '$vg->{pvs}' ($vg_uuid) to '$new_vgname'!\n";
> }
> - } else {
> - set_next("_Reboot", sub { exit (0); } );
> - display_html("fail.htm");
> - die "Cancled installation by user, due to already existing volume group '$vgname'\n";
> - }
> + };
> +
> + ask_existing_diskconfig_or_abort($message, "existing volume group '$vgname'", $rename_vgs);
> }
>
> sub create_lvm_volumes {
> @@ -1066,8 +1061,6 @@ sub create_lvm_volumes {
>
> my $vgname = $setup->{product};
>
> - ask_existing_vg_rename_or_abort($vgname);
> -
> my $rootdev = "/dev/$vgname/root";
> my $datadev = "/dev/$vgname/data";
> my $swapfile;
> @@ -3343,6 +3336,10 @@ sub create_hdsel_view {
> }
> $config_options->{target_hds} = [ $target_hd ];
> $unused = get_unused_bdevs($config_options->{target_hds});
> +
> + my $vgname = $setup->{product};
> + ask_existing_vg_rename_or_abort($vgname);
> +
> }
>
> warn_existing_esp_ignore_or_abort($unused);
>
More information about the pve-devel
mailing list