all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pve-container] setup: openeuler: use network scripts to setup network
@ 2026-07-06 12:14 Kaiyang Wu
  2026-07-13  3:15 ` Kaiyang Wu
  2026-07-14  8:09 ` David Riley
  0 siblings, 2 replies; 4+ messages in thread
From: Kaiyang Wu @ 2026-07-06 12:14 UTC (permalink / raw)
  To: pve-devel; +Cc: Kaiyang Wu

Fix the error "can't open '/etc/redhat-release' - No such file or
directory".

Fix the typo "netork" => "network".

openEuler does not provide '/etc/redhat-release', which causes an error
during network setup, as the setup script attempts to distinguishes
RedHat releases, whereas openEular never shipped this file.

openEuler defaults to use network scripts in LXC templates shipped by
linuxcontainers.org. [0]

[0] https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L239

Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
---
 src/PVE/LXC/Setup/CentOS.pm    | 4 ++--
 src/PVE/LXC/Setup/OpenEuler.pm | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
index 2469046..7e8140b 100644
--- a/src/PVE/LXC/Setup/CentOS.pm
+++ b/src/PVE/LXC/Setup/CentOS.pm
@@ -197,7 +197,7 @@ sub setup_network {
         # With CentOS/AlmaLinux/... 10 the support for network scripts got dropped.
         setup_network_with_networkmanager($self, $conf);
     } else {
-        setup_netork_with_network_scripts($self, $conf);
+        setup_network_with_network_scripts($self, $conf);
     }
 }
 
@@ -284,7 +284,7 @@ sub setup_network_with_networkmanager {
     }
 }
 
-sub setup_netork_with_network_scripts {
+sub setup_network_with_network_scripts {
     my ($self, $conf) = @_;
 
     my ($gw, $gw6);
diff --git a/src/PVE/LXC/Setup/OpenEuler.pm b/src/PVE/LXC/Setup/OpenEuler.pm
index 9bfd5c4..185ff5a 100644
--- a/src/PVE/LXC/Setup/OpenEuler.pm
+++ b/src/PVE/LXC/Setup/OpenEuler.pm
@@ -33,4 +33,10 @@ sub setup_init {
     $self->setup_systemd_preset();
 }
 
+sub setup_network {
+    my ($self, $conf) = @_;
+
+    $self->setup_network_with_network_scripts($self, $conf);
+}
+
 1;
-- 
2.52.0




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

* Re: [PATCH pve-container] setup: openeuler: use network scripts to setup network
  2026-07-06 12:14 [PATCH pve-container] setup: openeuler: use network scripts to setup network Kaiyang Wu
@ 2026-07-13  3:15 ` Kaiyang Wu
  2026-07-14  8:09 ` David Riley
  1 sibling, 0 replies; 4+ messages in thread
From: Kaiyang Wu @ 2026-07-13  3:15 UTC (permalink / raw)
  To: pve-devel; +Cc: Kaiyang Wu

Gentle ping, can anyone please take a look?

Kaiyang

On 2026-07-06 20:14, Kaiyang Wu wrote:
> Fix the error "can't open '/etc/redhat-release' - No such file or
> directory".
> 
> Fix the typo "netork" => "network".
> 
> openEuler does not provide '/etc/redhat-release', which causes an error
> during network setup, as the setup script attempts to distinguishes
> RedHat releases, whereas openEular never shipped this file.
> 
> openEuler defaults to use network scripts in LXC templates shipped by
> linuxcontainers.org. [0]
> 
> [0] https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L239
> 
> Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
> ---
>   src/PVE/LXC/Setup/CentOS.pm    | 4 ++--
>   src/PVE/LXC/Setup/OpenEuler.pm | 6 ++++++
>   2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
> index 2469046..7e8140b 100644
> --- a/src/PVE/LXC/Setup/CentOS.pm
> +++ b/src/PVE/LXC/Setup/CentOS.pm
> @@ -197,7 +197,7 @@ sub setup_network {
>           # With CentOS/AlmaLinux/... 10 the support for network scripts got dropped.
>           setup_network_with_networkmanager($self, $conf);
>       } else {
> -        setup_netork_with_network_scripts($self, $conf);
> +        setup_network_with_network_scripts($self, $conf);
>       }
>   }
>   
> @@ -284,7 +284,7 @@ sub setup_network_with_networkmanager {
>       }
>   }
>   
> -sub setup_netork_with_network_scripts {
> +sub setup_network_with_network_scripts {
>       my ($self, $conf) = @_;
>   
>       my ($gw, $gw6);
> diff --git a/src/PVE/LXC/Setup/OpenEuler.pm b/src/PVE/LXC/Setup/OpenEuler.pm
> index 9bfd5c4..185ff5a 100644
> --- a/src/PVE/LXC/Setup/OpenEuler.pm
> +++ b/src/PVE/LXC/Setup/OpenEuler.pm
> @@ -33,4 +33,10 @@ sub setup_init {
>       $self->setup_systemd_preset();
>   }
>   
> +sub setup_network {
> +    my ($self, $conf) = @_;
> +
> +    $self->setup_network_with_network_scripts($self, $conf);
> +}
> +
>   1;




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

* Re: [PATCH pve-container] setup: openeuler: use network scripts to setup network
  2026-07-06 12:14 [PATCH pve-container] setup: openeuler: use network scripts to setup network Kaiyang Wu
  2026-07-13  3:15 ` Kaiyang Wu
@ 2026-07-14  8:09 ` David Riley
  2026-07-15  9:04   ` Kaiyang Wu
  1 sibling, 1 reply; 4+ messages in thread
From: David Riley @ 2026-07-14  8:09 UTC (permalink / raw)
  To: Kaiyang Wu, pve-devel; +Cc: Kaiyang Wu

Thanks for sending in this patch.
Some comments inline.

On 7/6/26 2:15 PM, Kaiyang Wu wrote:
> Fix the error "can't open '/etc/redhat-release' - No such file or
> directory".
>
> Fix the typo "netork" => "network".

Please split this up into two commits one focusing on the typo and the other
one fixing the issue.

>
> openEuler does not provide '/etc/redhat-release', which causes an error
> during network setup, as the setup script attempts to distinguishes
> RedHat releases, whereas openEular never shipped this file.
>
> openEuler defaults to use network scripts in LXC templates shipped by
> linuxcontainers.org. [0]
>
> [0] https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L239
>
> Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
> ---
>   src/PVE/LXC/Setup/CentOS.pm    | 4 ++--
>   src/PVE/LXC/Setup/OpenEuler.pm | 6 ++++++
>   2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
> index 2469046..7e8140b 100644
> --- a/src/PVE/LXC/Setup/CentOS.pm
> +++ b/src/PVE/LXC/Setup/CentOS.pm
> @@ -197,7 +197,7 @@ sub setup_network {
>           # With CentOS/AlmaLinux/... 10 the support for network scripts got dropped.
>           setup_network_with_networkmanager($self, $conf);
>       } else {
> -        setup_netork_with_network_scripts($self, $conf);
> +        setup_network_with_network_scripts($self, $conf);
>       }
>   }
>   
> @@ -284,7 +284,7 @@ sub setup_network_with_networkmanager {
>       }
>   }
>   
> -sub setup_netork_with_network_scripts {
> +sub setup_network_with_network_scripts {
>       my ($self, $conf) = @_;
>   
>       my ($gw, $gw6);
> diff --git a/src/PVE/LXC/Setup/OpenEuler.pm b/src/PVE/LXC/Setup/OpenEuler.pm
> index 9bfd5c4..185ff5a 100644
> --- a/src/PVE/LXC/Setup/OpenEuler.pm
> +++ b/src/PVE/LXC/Setup/OpenEuler.pm
> @@ -33,4 +33,10 @@ sub setup_init {
>       $self->setup_systemd_preset();
>   }
>   
> +sub setup_network {
> +    my ($self, $conf) = @_;
> +
> +    $self->setup_network_with_network_scripts($self, $conf);


This does not work. It does allow the container to be created, but
it won't set a configured static IP address correctly.
I tested it with:

cat /etc/os-release
NAME="openEuler"
VERSION="24.03 (LTS-SP4)"

I think it should be:
$self->setup_network_with_network_scripts($conf);
instead.

But I think we need to take this fix in a different direction altogether.

Overriding setup_network here to force legacy network scripts
bypasses the root cause of the issue. The actual bug is that CentOS.pm crashes
when /etc/redhat-release is missing, which prevents it from choosing the
correct network setup.

Hardcoding the legacy fallback here should not be the way to go forward here.
OpenEuler already includes and prefers NetworkManager, as listed in the
linuxcontainers.org yaml you linked [0]. Forcing legacy network scripts
is not a future proof solution, as it already has been deprecated upstream
(see: RHEL 8 [1]).

So what this patch needs is something similar to the version check in CentOS.pm
using the alternative path /etc/os-release instead.

[0] https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L250
[1] https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/8.4_release_notes/deprecated_functionality#deprecated-functionality_networking

> +}
> +
>   1;




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

* Re: [PATCH pve-container] setup: openeuler: use network scripts to setup network
  2026-07-14  8:09 ` David Riley
@ 2026-07-15  9:04   ` Kaiyang Wu
  0 siblings, 0 replies; 4+ messages in thread
From: Kaiyang Wu @ 2026-07-15  9:04 UTC (permalink / raw)
  To: David Riley, pve-devel; +Cc: Kaiyang Wu

On 2026-07-14 16:09, David Riley wrote:
> Please split this up into two commits one focusing on the typo and the 
> other
> one fixing the issue.

> 
> This does not work. It does allow the container to be created, but
> it won't set a configured static IP address correctly.
> I tested it with:
> 
> cat /etc/os-release
> NAME="openEuler"
> VERSION="24.03 (LTS-SP4)"
> 
> I think it should be:
> $self->setup_network_with_network_scripts($conf);
> instead.

I will address these issues in v2.

> But I think we need to take this fix in a different direction altogether.
> 
> Overriding setup_network here to force legacy network scripts
> bypasses the root cause of the issue. The actual bug is that CentOS.pm 
> crashes
> when /etc/redhat-release is missing, which prevents it from choosing the
> correct network setup.
> 
> Hardcoding the legacy fallback here should not be the way to go forward 
> here.
> OpenEuler already includes and prefers NetworkManager, as listed in the
> linuxcontainers.org yaml you linked [0]. Forcing legacy network scripts
> is not a future proof solution, as it already has been deprecated upstream
> (see: RHEL 8 [1]).
> 
> So what this patch needs is something similar to the version check in 
> CentOS.pm
> using the alternative path /etc/os-release instead.
> 
> [0] https://github.com/lxc/lxc-ci/ 
> blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L250
> [1] https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/ 
> html/8.4_release_notes/deprecated_functionality#deprecated- 
> functionality_networking

The upstream yaml still prefers legacy network scripts on x86_64 and 
aarch64 [0], despite preferring NetworkManager on armhfp [1].

[0] 
https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L245-L247
[1] 
https://github.com/lxc/lxc-ci/blob/7a61e7539f0009ab458661628a34267cbfc288a7/images/openeuler.yaml#L256-L257

Best,
Kaiyang




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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 12:14 [PATCH pve-container] setup: openeuler: use network scripts to setup network Kaiyang Wu
2026-07-13  3:15 ` Kaiyang Wu
2026-07-14  8:09 ` David Riley
2026-07-15  9:04   ` Kaiyang Wu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal