From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 4C63D1FF187
	for <inbox@lore.proxmox.com>; Mon, 14 Jul 2025 10:40:03 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 75E12116B8;
	Mon, 14 Jul 2025 10:41:00 +0200 (CEST)
Message-ID: <73563abc-94cd-42d2-bc3f-19569d809284@proxmox.com>
Date: Mon, 14 Jul 2025 10:40:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: pve-devel@lists.proxmox.com
References: <20250528164630.2204379-1-a.lauterer@proxmox.com>
From: Aaron Lauterer <a.lauterer@proxmox.com>
In-Reply-To: <20250528164630.2204379-1-a.lauterer@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.021 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [pveceph.pm, proxmox.com]
Subject: Re: [pve-devel] [PATCH manager v1 1/3] fix #5244 pveceph: install:
 add new repository for offline installation
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

sent a v2 rebased on current indentations 
https://lore.proxmox.com/pve-devel/20250714083838.68483-1-a.lauterer@proxmox.com/T/#t

On  2025-05-28  18:46, Aaron Lauterer wrote:
> by adding a 4th repository option called 'offline'. If set, the ceph
> installation step will not touch the repository configuration.
> 
> We add a simple version check to make sure that the latest version
> available (and to be installed) does match the selected major Ceph
> version.
> 
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> Tested-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> 
> Notes:
>      Changes since RFC [0]:
>      
>      * rename option from 'offline' to 'manual'
>      * start moved warning to begin uppercase as the others
>      
>      [0] https://lore.proxmox.com/pve-devel/20250423132825.1194271-1-a.lauterer@proxmox.com/
> 
>   PVE/CLI/pveceph.pm | 47 +++++++++++++++++++++++++++++++++-------------
>   1 file changed, 34 insertions(+), 13 deletions(-)
> 
> diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
> index 488aea04..bff7ba70 100755
> --- a/PVE/CLI/pveceph.pm
> +++ b/PVE/CLI/pveceph.pm
> @@ -3,6 +3,7 @@ package PVE::CLI::pveceph;
>   use strict;
>   use warnings;
>   
> +use AptPkg::Cache;
>   use Data::Dumper;
>   use Fcntl ':flock';
>   use File::Path;
> @@ -135,9 +136,13 @@ __PACKAGE__->register_method ({
>   	    },
>   	    repository => {
>   		type => 'string',
> -		enum => ['enterprise', 'no-subscription', 'test'],
> +		enum => ['enterprise', 'no-subscription', 'test', 'manual'],
>   		default => 'enterprise',
> -		description => "Ceph repository to use.",
> +		description => "Ceph repository to use. The 'manual' option will not configure"
> +		    ." any repositories. Use it if the host cannot access the public repositories,"
> +		    ." for example if Proxmox Offline Mirror is used. A repository that contains"
> +		    ." the Ceph packages for the version needs to be manually configured before"
> +		    ." starting the installation!",
>   		optional => 1,
>   	    },
>   	    'allow-experimental' => {
> @@ -166,6 +171,9 @@ __PACKAGE__->register_method ({
>   	} elsif ($repo eq 'no-subscription') {
>   	    warn "\nHINT: The no-subscription repository is not the best choice for production setups.\n"
>   	        ."Proxmox recommends using the enterprise repository with a valid subscription.\n";
> +	} elsif ($repo eq 'manual') {
> +	    warn "\nHINT: The manual repository option expects that the Ceph repository is already correctly configured."
> +		." For example, when used in combination with Proxmox Offline Mirror.\n";
>   	} else {
>   	    warn "\nWARN: The test repository should only be used for test setups or after consulting"
>   		." the official Proxmox support!\n\n"
> @@ -186,19 +194,21 @@ __PACKAGE__->register_method ({
>   	    die "Aborting installation as requested\n" if !$continue;
>   	}
>   
> -	PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.list", $repolist);
> +	if ($repo ne "manual") {
> +	    PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.list", $repolist);
>   
> -	if ($available_ceph_releases->{$cephver}->{unsupported}) {
> -	    if ($param->{'allow-experimental'}) {
> -		warn "NOTE: installing experimental/tech-preview Ceph release ${rendered_release}!\n";
> -	    } elsif (-t STDOUT) {
> -		print "Ceph ${rendered_release} is currently considered a technology preview for Proxmox VE - continue (y/N)? ";
> -		my $answer = <STDIN>;
> -		my $continue = defined($answer) && $answer =~ m/^\s*y(?:es)?\s*$/i;
> +	    if ($available_ceph_releases->{$cephver}->{unsupported}) {
> +		if ($param->{'allow-experimental'}) {
> +		    warn "NOTE: installing experimental/tech-preview Ceph release ${rendered_release}!\n";
> +		} elsif (-t STDOUT) {
> +		    print "Ceph ${rendered_release} is currently considered a technology preview for Proxmox VE - continue (y/N)? ";
> +		    my $answer = <STDIN>;
> +		    my $continue = defined($answer) && $answer =~ m/^\s*y(?:es)?\s*$/i;
>   
> -		die "Aborting installation as requested\n" if !$continue;
> -	    } else {
> -		die "refusing to install tech-preview Ceph release ${rendered_release} without 'allow-experimental' parameter!\n";
> +		    die "Aborting installation as requested\n" if !$continue;
> +		} else {
> +		    die "Refusing to install tech-preview Ceph release ${rendered_release} without 'allow-experimental' parameter!\n";
> +		}
>   	    }
>   	}
>   
> @@ -212,6 +222,17 @@ __PACKAGE__->register_method ({
>   	    )
>   	};
>   
> +	if ($repo eq "manual") {
> +	    # TODO: get used repo metadata and print it as additional info
> +	    my $apt_cache = AptPkg::Cache->new() || die "unable to initialize AptPkg::Cache\n";
> +	    my @ceph_versions = $apt_cache->{'ceph-common:amd64'}->{'VersionList'}->@*;
> +	    my $latest_available = $ceph_versions[0]->{'VerStr'};
> +	    my $selected_version = PVE::Ceph::Releases::get_ceph_release_info($cephver)->{'release'};
> +
> +	    die "Selected Ceph version '${selected_version}' does not match the available version in the repository '${latest_available}' \n"
> +		if ($latest_available !~ "^$selected_version");
> +	}
> +
>   	my @apt_install = qw(apt-get --no-install-recommends -o Dpkg::Options::=--force-confnew install --);
>   	my @ceph_packages = qw(
>   	    ceph



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel