public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH-SERIES pve-manager/qemu-server] fix#4689 autofind node with proxyto_callback
@ 2023-05-31 22:28 Alexandre Derumier
  2023-05-31 22:28 ` [pve-devel] [PATCH pve-manager 1/1] api2: add /guests path Alexandre Derumier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Derumier @ 2023-05-31 22:28 UTC (permalink / raw)
  To: pve-devel

Hi,

Currently, to manage qemu && lxc vms, we always need to specify nodename in uri.

This is a problem with automation tools like terraform, where is node is registered
in the state of terraform.
(That mean, than if we move the vm on another node, terraform don't known it, and try to create the vm
again or can't delete the vm,...)
https://github.com/Telmate/terraform-provider-proxmox/issues/168

This can also be a potential problem with race, if we need to query /cluster/ressources to find the node, then another
query on the vm.

I have some discussion with fabian about it:
https://bugzilla.proxmox.com/show_bug.cgi?id=4689


This patch series, find the nodename with proxyto_callback.

a new api endpoint /guests/  is defined:

/guests/(qemu|lxc)/vmid


This patch series currently implement callback for api2::qemu

I'm not sure how to create vm_create when vmid && nodename is not defined.
Currently the callback return localhost, so the vm is created on the called
node.

todo (if this patch serie is ok for you):
api2::qemu::agent   (/guest/qemu/vmid/agent)
api2::lxc   (/guest/lxc/vmid)
api2::lxc::config   (/guest/lxc/vmid/config)
api2::lxc::status   (/guest/lxc/vmid/status)
api2::lxc::snapshot   (/guest/lxc/vmid/snapshot)
api2::firewall:vm (/guest/(qemu|lxc)/vmid/firewall )



Alexandre Derumier (1):
  api2: add /guests path

 PVE/API2.pm        |  6 +++++
 PVE/API2/Guests.pm | 55 ++++++++++++++++++++++++++++++++++++++++++++++
 PVE/API2/Makefile  |  1 +
 3 files changed, 62 insertions(+)
 create mode 100644 PVE/API2/Guests.pm

Alexandre Derumier (1):
  api2: qemu: add proxyto_callback to find node if not defined

 PVE/API2/Qemu.pm | 157 ++++++++++++++++++++++++++++++++---------------
 1 file changed, 109 insertions(+), 48 deletions(-)

-- 
2.30.2




^ permalink raw reply	[flat|nested] 6+ messages in thread
* [pve-devel] [PATCH-SERIES v2 pve-manager/qemu-server] fix#4689 autofind node with proxyto_callback
@ 2023-06-01  6:50 Alexandre Derumier
  2023-06-01  6:50 ` [pve-devel] [PATCH qemu-server 1/1] api2: qemu: add proxyto_callback to find node if not defined Alexandre Derumier
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Derumier @ 2023-06-01  6:50 UTC (permalink / raw)
  To: pve-devel

Hi,

Currently, to manage qemu && lxc vms, we always need to specify nodename in uri.

This is a problem with automation tools like terraform, where is node is registered
in the state of terraform.
(That mean, than if we move the vm on another node, terraform don't known it, and try to create the vm
again or can't delete the vm,...)
https://github.com/Telmate/terraform-provider-proxmox/issues/168

This can also be a potential problem with race, if we need to query /cluster/ressources to find the node, then another
query on the vm.

I have some discussion with fabian about it:
https://bugzilla.proxmox.com/show_bug.cgi?id=4689


This patch series, find the nodename with proxyto_callback.

a new api endpoint /guests/  is defined:

/guests/(qemu|lxc)/vmid


This patch series currently implement callback for api2::qemu

todo (if this patch serie is ok for you):
api2::qemu::agent   (/guest/qemu/vmid/agent)
api2::lxc   (/guest/lxc/vmid)
api2::lxc::config   (/guest/lxc/vmid/config)
api2::lxc::status   (/guest/lxc/vmid/status)
api2::lxc::snapshot   (/guest/lxc/vmid/snapshot)
api2::firewall:vm (/guest/(qemu|lxc)/vmid/firewall )


changelog v2:

- fix pvesh param sending to proxyto_callback


pve-manager:

Alexandre Derumier (2):
  api2: add /guests path
  pvesh: send params to check_proxyto like httpserver

 PVE/API2.pm        |  6 +++++
 PVE/API2/Guests.pm | 55 ++++++++++++++++++++++++++++++++++++++++++++++
 PVE/API2/Makefile  |  1 +
 PVE/CLI/pvesh.pm   | 13 ++++++-----
 4 files changed, 70 insertions(+), 5 deletions(-)
 create mode 100644 PVE/API2/Guests.pm

qemu-server:

Alexandre Derumier (1):
  api2: qemu: add proxyto_callback to find node if not defined

 PVE/API2/Qemu.pm | 157 ++++++++++++++++++++++++++++++++---------------
 1 file changed, 109 insertions(+), 48 deletions(-)

-- 
2.30.2




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

end of thread, other threads:[~2023-06-04  6:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 22:28 [pve-devel] [PATCH-SERIES pve-manager/qemu-server] fix#4689 autofind node with proxyto_callback Alexandre Derumier
2023-05-31 22:28 ` [pve-devel] [PATCH pve-manager 1/1] api2: add /guests path Alexandre Derumier
2023-05-31 22:28 ` [pve-devel] [PATCH qemu-server 1/1] api2: qemu: add proxyto_callback to find node if not defined Alexandre Derumier
2023-06-03 13:57 ` [pve-devel] [PATCH-SERIES pve-manager/qemu-server] fix#4689 autofind node with proxyto_callback Thomas Lamprecht
2023-06-04  6:40   ` DERUMIER, Alexandre
2023-06-01  6:50 [pve-devel] [PATCH-SERIES v2 " Alexandre Derumier
2023-06-01  6:50 ` [pve-devel] [PATCH qemu-server 1/1] api2: qemu: add proxyto_callback to find node if not defined Alexandre Derumier

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