public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 1/3] fix #5244 pveceph: install: add new repository for offline installation
@ 2025-07-14  8:38 Aaron Lauterer
  2025-07-14  8:38 ` [pve-devel] [PATCH v2 2/3] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
  2025-07-14  8:38 ` [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual Aaron Lauterer
  0 siblings, 2 replies; 5+ messages in thread
From: Aaron Lauterer @ 2025-07-14  8:38 UTC (permalink / raw)
  To: pve-devel

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
    v1:
    * rebased to new indentation
    
    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 | 60 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 18 deletions(-)

diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index c8049a0e..a949582e 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;
@@ -136,9 +137,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' => {
@@ -170,6 +175,10 @@ __PACKAGE__->register_method({
             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"
@@ -199,22 +208,24 @@ EOF
             die "Aborting installation as requested\n" if !$continue;
         }
 
-        PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.sources", $repo_source);
-
-        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";
+        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;
+
+                    die "Aborting installation as requested\n" if !$continue;
+                } else {
+                    die
+                        "Refusing to install tech-preview Ceph release ${rendered_release} without 'allow-experimental' parameter!\n";
+                }
             }
         }
 
@@ -228,6 +239,19 @@ EOF
             );
         };
 
+        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(
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH v2 2/3] ui: CephInstallWizard: add option and hint for offline repository
  2025-07-14  8:38 [pve-devel] [PATCH v2 1/3] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
@ 2025-07-14  8:38 ` Aaron Lauterer
  2025-07-14  8:38 ` [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual Aaron Lauterer
  1 sibling, 0 replies; 5+ messages in thread
From: Aaron Lauterer @ 2025-07-14  8:38 UTC (permalink / raw)
  To: pve-devel

The new 'offline' repository option will not try to configure the Ceph
repositories during installation.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
---

Notes:
    changes since
    v1:
    * rebased to new indentation
    
    RFC:
    
    * renamed option from 'offline' to 'manual' and therefore adapted the
      dropdown name and explanation text.

 www/manager6/ceph/CephInstallWizard.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/www/manager6/ceph/CephInstallWizard.js b/www/manager6/ceph/CephInstallWizard.js
index 5dcc589e..d88d6c8c 100644
--- a/www/manager6/ceph/CephInstallWizard.js
+++ b/www/manager6/ceph/CephInstallWizard.js
@@ -177,6 +177,10 @@ Ext.define('PVE.ceph.CephInstallWizard', {
                         : gettext(
                               'The no-subscription repository is not the best choice for production setups.',
                           );
+                } else if (repo === 'manual') {
+                    return gettext(
+                        'The manual repository option expects that the repository is already configured. For example, in combination with the Promox Offline Mirror.',
+                    );
                 } else {
                     return gettext(
                         'The test repository should only be used for test setups or after consulting the official Proxmox support!',
@@ -347,6 +351,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
                                 ['enterprise', gettext('Enterprise (recommended)')],
                                 ['no-subscription', gettext('No-Subscription')],
                                 ['test', gettext('Test')],
+                                ['manual', gettext('Manual')],
                             ],
                             labelWidth: 150,
                             submitValue: false,
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual
  2025-07-14  8:38 [pve-devel] [PATCH v2 1/3] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
  2025-07-14  8:38 ` [pve-devel] [PATCH v2 2/3] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
@ 2025-07-14  8:38 ` Aaron Lauterer
  2025-07-14  8:45   ` Shannon Sterz
  1 sibling, 1 reply; 5+ messages in thread
From: Aaron Lauterer @ 2025-07-14  8:38 UTC (permalink / raw)
  To: pve-devel

By printing the site and component, the person installing it manuall has
a final check to see if the correct repository is being used.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---

Notes:
    I intially tried to get the repo definition similar to how it is in the
    .list file and printed by apt-cache policy {package} but failed so far,
    getting that info via AptPkg::Cache. Therefore, I used what I found so far.
    
    changes since v1:
    * rebased to new indentation

 PVE/CLI/pveceph.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index a949582e..04c16199 100755
--- a/PVE/CLI/pveceph.pm
+++ b/PVE/CLI/pveceph.pm
@@ -240,7 +240,6 @@ EOF
         };
 
         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'};
@@ -250,6 +249,12 @@ EOF
             die
                 "Selected Ceph version '${selected_version}' does not match the available version in the repository '${latest_available}' \n"
                 if ($latest_available !~ "^$selected_version");
+
+            my $pkg_infos = $ceph_versions[0]->{'FileList'}->[0]->{'File'};
+            print "\nUsing the following manual repository:\n"
+                . "Site:\t\t $pkg_infos->{'Site'}\n"
+                . "Component:\t $pkg_infos->{'Component'}\n\n";
+
         }
 
         my @apt_install =
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual
  2025-07-14  8:38 ` [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual Aaron Lauterer
@ 2025-07-14  8:45   ` Shannon Sterz
  2025-07-14  9:05     ` Aaron Lauterer
  0 siblings, 1 reply; 5+ messages in thread
From: Shannon Sterz @ 2025-07-14  8:45 UTC (permalink / raw)
  To: Proxmox VE development discussion, Aaron Lauterer

On Mon Jul 14, 2025 at 10:38 AM CEST, Aaron Lauterer wrote:
> By printing the site and component, the person installing it manuall has
> a final check to see if the correct repository is being used.
>
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
>
> Notes:
>     I intially tried to get the repo definition similar to how it is in the
>     .list file and printed by apt-cache policy {package} but failed so far,
>     getting that info via AptPkg::Cache. Therefore, I used what I found so far.
>
>     changes since v1:
>     * rebased to new indentation
>
>  PVE/CLI/pveceph.pm | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
> index a949582e..04c16199 100755
> --- a/PVE/CLI/pveceph.pm
> +++ b/PVE/CLI/pveceph.pm
> @@ -240,7 +240,6 @@ EOF
>          };
>
>          if ($repo eq "manual") {
> -            # TODO: get used repo metadata and print it as additional info

nit: you add this comment in the first patch of the series just to
remove it again here. might want to clean that up if another version of
this series is necessary.

>              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'};
> @@ -250,6 +249,12 @@ EOF
>              die
>                  "Selected Ceph version '${selected_version}' does not match the available version in the repository '${latest_available}' \n"
>                  if ($latest_available !~ "^$selected_version");
> +
> +            my $pkg_infos = $ceph_versions[0]->{'FileList'}->[0]->{'File'};
> +            print "\nUsing the following manual repository:\n"
> +                . "Site:\t\t $pkg_infos->{'Site'}\n"
> +                . "Component:\t $pkg_infos->{'Component'}\n\n";
> +
>          }
>
>          my @apt_install =



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual
  2025-07-14  8:45   ` Shannon Sterz
@ 2025-07-14  9:05     ` Aaron Lauterer
  0 siblings, 0 replies; 5+ messages in thread
From: Aaron Lauterer @ 2025-07-14  9:05 UTC (permalink / raw)
  To: Shannon Sterz, Proxmox VE development discussion



On  2025-07-14  10:45, Shannon Sterz wrote:
> On Mon Jul 14, 2025 at 10:38 AM CEST, Aaron Lauterer wrote:
>> By printing the site and component, the person installing it manuall has
>> a final check to see if the correct repository is being used.
>>
>> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
>> ---
>>
>> Notes:
>>      I intially tried to get the repo definition similar to how it is in the
>>      .list file and printed by apt-cache policy {package} but failed so far,
>>      getting that info via AptPkg::Cache. Therefore, I used what I found so far.
>>
>>      changes since v1:
>>      * rebased to new indentation
>>
>>   PVE/CLI/pveceph.pm | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
>> index a949582e..04c16199 100755
>> --- a/PVE/CLI/pveceph.pm
>> +++ b/PVE/CLI/pveceph.pm
>> @@ -240,7 +240,6 @@ EOF
>>           };
>>
>>           if ($repo eq "manual") {
>> -            # TODO: get used repo metadata and print it as additional info
> 
> nit: you add this comment in the first patch of the series just to
> remove it again here. might want to clean that up if another version of
> this series is necessary.

My intention here was that I am not sure if we actually want to use 
patch 3, as it only adds informational output, but is not strictly 
necessary. So if we don't use patch3, we still have the TODO around :)>
>>               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'};
>> @@ -250,6 +249,12 @@ EOF
>>               die
>>                   "Selected Ceph version '${selected_version}' does not match the available version in the repository '${latest_available}' \n"
>>                   if ($latest_available !~ "^$selected_version");
>> +
>> +            my $pkg_infos = $ceph_versions[0]->{'FileList'}->[0]->{'File'};
>> +            print "\nUsing the following manual repository:\n"
>> +                . "Site:\t\t $pkg_infos->{'Site'}\n"
>> +                . "Component:\t $pkg_infos->{'Component'}\n\n";
>> +
>>           }
>>
>>           my @apt_install =
> 



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-14  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-14  8:38 [pve-devel] [PATCH v2 1/3] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
2025-07-14  8:38 ` [pve-devel] [PATCH v2 2/3] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
2025-07-14  8:38 ` [pve-devel] [PATCH v2 3/3] pveceph: print repo metadata when installing from manual Aaron Lauterer
2025-07-14  8:45   ` Shannon Sterz
2025-07-14  9:05     ` Aaron Lauterer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal