* [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation
@ 2025-04-23 13:28 Aaron Lauterer
2025-04-23 13:28 ` [pve-devel] [RFC manager 2/2] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
2025-05-02 11:00 ` [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Christoph Heiss
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Lauterer @ 2025-04-23 13:28 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>
---
I am not sure if we should call the new repo option "offline" or
something like "dont-set". Maybe someone else has another idea.
I am sending this as an RFC to get feedback if the approach is in the
right direction.
One TODO that is missing, is to figure out which repo would be used and
print some metadata about it, so that the admins can verify that the
right manually configured repo is the source.
PVE/CLI/pveceph.pm | 46 +++++++++++++++++++++++++++++++++-------------
1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index 488aea04..f5fde026 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,12 @@ __PACKAGE__->register_method ({
},
repository => {
type => 'string',
- enum => ['enterprise', 'no-subscription', 'test'],
+ enum => ['enterprise', 'no-subscription', 'test', 'offline'],
default => 'enterprise',
- description => "Ceph repository to use.",
+ description => "Ceph repository to use. The 'offline' repository 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 beforehand!",
optional => 1,
},
'allow-experimental' => {
@@ -166,6 +170,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 'offline') {
+ warn "\nHINT: The offline 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 +193,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 "offline") {
+ 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 +221,17 @@ __PACKAGE__->register_method ({
)
};
+ if ($repo eq "offline") {
+ # 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
--
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] 4+ messages in thread
* [pve-devel] [RFC manager 2/2] ui: CephInstallWizard: add option and hint for offline repository
2025-04-23 13:28 [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
@ 2025-04-23 13:28 ` Aaron Lauterer
2025-05-02 11:00 ` [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Christoph Heiss
1 sibling, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2025-04-23 13:28 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>
---
www/manager6/ceph/CephInstallWizard.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/www/manager6/ceph/CephInstallWizard.js b/www/manager6/ceph/CephInstallWizard.js
index ad7dac68..428ff5d8 100644
--- a/www/manager6/ceph/CephInstallWizard.js
+++ b/www/manager6/ceph/CephInstallWizard.js
@@ -173,6 +173,8 @@ Ext.define('PVE.ceph.CephInstallWizard', {
return allSub
? gettext("Cluster has active subscriptions and would be eligible for using the enterprise repository.")
: gettext("The no-subscription repository is not the best choice for production setups.");
+ } else if (repo === "offline") {
+ return gettext("The offline 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!');
}
@@ -322,6 +324,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
['enterprise', gettext('Enterprise (recommended)')],
['no-subscription', gettext('No-Subscription')],
['test', gettext('Test')],
+ ['offline', gettext('Offline (manual setup)')],
],
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] 4+ messages in thread
* Re: [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation
2025-04-23 13:28 [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
2025-04-23 13:28 ` [pve-devel] [RFC manager 2/2] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
@ 2025-05-02 11:00 ` Christoph Heiss
2025-05-05 12:12 ` Aaron Lauterer
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Heiss @ 2025-05-02 11:00 UTC (permalink / raw)
To: Aaron Lauterer; +Cc: Proxmox VE development discussion
Tested both patches on a fresh PVE 8.4 installation, setting up Ceph by
manually providing a repo in /etc/apt/sources.list.d/ and then
installing it
- through the web interface and
- with `pveceph -repository offline -version squid`
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
On Wed Apr 23, 2025 at 3:28 PM CEST, 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>
> ---
> I am not sure if we should call the new repo option "offline" or
> something like "dont-set". Maybe someone else has another idea.
Maybe just call it 'manual'?
In patch #2, the (user-facing) description is "Offline (manual setup)" -
IMHO "manual setup" for the repos fits pretty good for what the option
does.
>
> I am sending this as an RFC to get feedback if the approach is in the
> right direction.
>
> One TODO that is missing, is to figure out which repo would be used and
> print some metadata about it, so that the admins can verify that the
> right manually configured repo is the source.
>
> PVE/CLI/pveceph.pm | 46 +++++++++++++++++++++++++++++++++-------------
> 1 file changed, 33 insertions(+), 13 deletions(-)
>
> diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
> index 488aea04..f5fde026 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,12 @@ __PACKAGE__->register_method ({
> },
> repository => {
> type => 'string',
> - enum => ['enterprise', 'no-subscription', 'test'],
> + enum => ['enterprise', 'no-subscription', 'test', 'offline'],
> default => 'enterprise',
> - description => "Ceph repository to use.",
> + description => "Ceph repository to use. The 'offline' repository 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 beforehand!",
> optional => 1,
Since this parameter is optional anyway, what about only configuring
repositories when it is set? Instead of introducing another enum value
and defaulting to 'enterprise'.
Would seem a bit cleaner, but API breaking - so if, could only go in
with 9.0. Do we rely on that behaviour somewhere else?
> },
> 'allow-experimental' => {
> @@ -166,6 +170,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 'offline') {
> + warn "\nHINT: The offline 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 +193,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 "offline") {
> + 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";
tiny nit: All other messages here are started capitalized, so this one
should as well for consistency.
> + }
> }
> }
>
> @@ -212,6 +221,17 @@ __PACKAGE__->register_method ({
> )
> };
>
> + if ($repo eq "offline") {
> + # 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation
2025-05-02 11:00 ` [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Christoph Heiss
@ 2025-05-05 12:12 ` Aaron Lauterer
0 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2025-05-05 12:12 UTC (permalink / raw)
To: Christoph Heiss; +Cc: Proxmox VE development discussion
On 2025-05-02 13:00, Christoph Heiss wrote:
> Tested both patches on a fresh PVE 8.4 installation, setting up Ceph by
> manually providing a repo in /etc/apt/sources.list.d/ and then
> installing it
> - through the web interface and
> - with `pveceph -repository offline -version squid`
>
> Tested-by: Christoph Heiss <c.heiss@proxmox.com>
>
> On Wed Apr 23, 2025 at 3:28 PM CEST, 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>
>> ---
>> I am not sure if we should call the new repo option "offline" or
>> something like "dont-set". Maybe someone else has another idea.
>
> Maybe just call it 'manual'?
>
> In patch #2, the (user-facing) description is "Offline (manual setup)" -
> IMHO "manual setup" for the repos fits pretty good for what the option
> does.
yeah sounds good, just using "manual" as parameter name. Will do so in a v2.
>
>>
>> I am sending this as an RFC to get feedback if the approach is in the
>> right direction.
>>
>> One TODO that is missing, is to figure out which repo would be used and
>> print some metadata about it, so that the admins can verify that the
>> right manually configured repo is the source.
>>
>> PVE/CLI/pveceph.pm | 46 +++++++++++++++++++++++++++++++++-------------
>> 1 file changed, 33 insertions(+), 13 deletions(-)
>>
>> diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
>> index 488aea04..f5fde026 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,12 @@ __PACKAGE__->register_method ({
>> },
>> repository => {
>> type => 'string',
>> - enum => ['enterprise', 'no-subscription', 'test'],
>> + enum => ['enterprise', 'no-subscription', 'test', 'offline'],
>> default => 'enterprise',
>> - description => "Ceph repository to use.",
>> + description => "Ceph repository to use. The 'offline' repository 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 beforehand!",
>> optional => 1,
>
> Since this parameter is optional anyway, what about only configuring
> repositories when it is set? Instead of introducing another enum value
> and defaulting to 'enterprise'.
>
> Would seem a bit cleaner, but API breaking - so if, could only go in
> with 9.0. Do we rely on that behaviour somewhere else?
Hmm, AFAIK we only use it on the CLI directly and via the web UI console
when installing it via the GUI.
But that would make quite the difference when installing it directly via
the CLI pveceph install command. Therefore I would rather not make it
optional at all so that the parameter needs to be defined, or leave it
as is as in most situations that we anticipate, the enterprise repo
should be used.
>
>> },
>> 'allow-experimental' => {
>> @@ -166,6 +170,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 'offline') {
>> + warn "\nHINT: The offline 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 +193,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 "offline") {
>> + 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";
>
> tiny nit: All other messages here are started capitalized, so this one
> should as well for consistency.
I'll address that in a v2.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-05-05 12:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23 13:28 [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Aaron Lauterer
2025-04-23 13:28 ` [pve-devel] [RFC manager 2/2] ui: CephInstallWizard: add option and hint for offline repository Aaron Lauterer
2025-05-02 11:00 ` [pve-devel] [RFC manager 1/2] fix #5244 pveceph: install: add new repository for offline installation Christoph Heiss
2025-05-05 12:12 ` 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