all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Stefan Hanreich <s.hanreich@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [RFC pve-network 1/1] sdn: apply changes on all nodes in parallel
Date: Fri, 18 Sep 2026 13:28:56 +0200	[thread overview]
Message-ID: <aq0gPMW5pqW2hdeg@luna.proxmox.com> (raw)
In-Reply-To: <17ce3fca-ab64-426a-b72c-2cb6b12ea4fe@proxmox.com>

On 18.09.2026 13:21, Stefan Hanreich wrote:
> >> [snip]
> >> @@ -282,6 +259,41 @@ __PACKAGE__->register_method({
> >>      },
> >>  });
> >>  
> >> +sub create_api_client {
> >> +    my ($request_timeout) = @_;
> >> +
> >> +    my $rpcenv = PVE::RPCEnvironment::get();
> >> +    my $authuser = $rpcenv->get_user();
> >> +    my $credentials = $rpcenv->get_credentials();
> >> +
> >> +    my $api_token = $credentials->{api_token};
> >> +    my $ticket = $credentials->{ticket};
> >> +    my $csrf_token = $credentials->{token};
> >> +
> >> +    my $node = PVE::INotify::nodename();
> >> +    my $fingerprint = PVE::Cluster::get_node_fingerprint($node);
> >> +
> >> +    my $conn_args = {
> >> +        protocol => 'https',
> >> +        host => 'localhost', # always call the api locally, let pveproxy handle the proxying
> >> +        port => 8006,
> >> +        username => $authuser,
> >> +        ticket => $ticket,
> >> +        apitoken => $api_token,
> >> +        timeout => $request_timeout // 25, # default slightly shorter than the proxy->daemon timeout
> >> +        cached_fingerprints => {
> >> +            $fingerprint => 1,
> >> +        },
> >> +    };
> >> +
> >> +    my $api_client = PVE::APIClient::LWP->new($conn_args->%*);
> >> +    if (defined($csrf_token)) {
> >> +        $api_client->update_csrftoken($csrf_token);
> >> +    }
> >> +
> >> +    return $api_client;
> >> +}
> >> +
> >>  __PACKAGE__->register_method({
> >>      name => 'reload',
> >>      protected => 1,
> >> @@ -291,6 +303,7 @@ __PACKAGE__->register_method({
> >>      permissions => {
> >>          check => ['perm', '/sdn', ['SDN.Allocate']],
> > 
> > Hmm this endpoint has SDN.Allocate and the PUT /network endpoint we are calling
> > (in pve-manager) needs Sys.Modify. This shouldn't be an issue, but maybe we
> > should require Sys.Modify here as well to short-circuit everything, instead of
> > making a request to every node.
> 
> Hmm, pre-existing, but what about setups where a user has Sys.Modify only on some nodes? That's
> currently possible but probably quite bad, since it allows applying the SDN configuration to 
> some nodes only. So, I agree - but a breaking change?

Aah, this is obviously a breaking change -- you're right.
Then this is fine IMO.

> >>      },
> >> +    expose_credentials => 1,
> >>      parameters => {
> >>          additionalProperties => 0,
> >>          properties => {
> >> [snip]




  reply	other threads:[~2026-09-18 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 14:06 [RFC pve-network 1/1] sdn: apply changes on all nodes in parallel Stefan Hanreich
2026-07-13  8:58 ` Daniel Herzig
2026-09-18  9:50 ` Gabriel Goller
2026-09-18 11:21   ` Stefan Hanreich
2026-09-18 11:28     ` Gabriel Goller [this message]
2026-09-21 10:56 ` DERUMIER, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aq0gPMW5pqW2hdeg@luna.proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.hanreich@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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