public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v3 qemu-server 0/7] cloudinit pending behaviour change
@ 2021-06-09 11:54 Alexandre Derumier
  2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 1/7] cloudinit: add vm config to cloudinit drive Alexandre Derumier
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Alexandre Derumier @ 2021-06-09 11:54 UTC (permalink / raw)
  To: pve-devel

Hi,

This is an attempt to cleanup current behaviour of cloudinit online changes.

Currently, we setup cloudinit options as pending, until we generate the config drive.

This is not 100% true, because some option like vm name, nic mac address can be changed,
without going to pending, so user can't known if it need to regenerated it.

Also custom config can be done with snippets file, without any pending state.

Also, some can are very difficult to handle, if you hotplug a nic but it's failing,so pending,
then you defined an ipconfig, and then you revert hotplug.

(This will be really usefull with ipam implementation, where ipconfig pending state is really
 needed, as we need to follow the pending state of the netX interface)

So, instead of setting cloudinit values in pending,
this patch serie extract the current config from the cloudinit drive and compare it to vm config (pending config).

(Currently the vm config is simply copied inside the iso at generation, but we could implemented
 configdrive format parsers) 

A new specific cloudinit config api is added too, merging ipaddrX && netX mac
in same field, and displaying the diff between current and generated config.
(we could implemented read config from custom snippet too later)


Changelog V1:

- use [special:cloudinit] instead [CLOUDINIT] for section
- delete config section on drive removal
- config api: move code to new PVE::QemuServer::Cloudinit::get_pending_config
- config api: add "qm cloudinit pending" cli
- add update api to regenerate drive with 1 api call
- add cloudinit hotplug option

Changelog v2:

- fix trailing whitespace in first patch
- revert previous "cloudinit" check in snapshot name (":" character is already forbidden)

Changelog v3:

- extract the current conf from cloudinit drive instead write the special cloudinit section


Alexandre Derumier (7):
  cloudinit: add vm config to cloudinit drive
  cloudinit: generate cloudinit drive on offline plug
  cloudinit: make cloudnit options fastplug
  api2: add cloudinit config api
  cloudinit : add extract_cloudinit_config
  api2: add cloudinit_update
  add cloudinit hotplug

 PVE/API2/Qemu.pm            | 118 ++++++++++++++++++++++++++++++++++
 PVE/CLI/qm.pm               |   2 +
 PVE/QemuServer.pm           |  81 ++++++++++++++---------
 PVE/QemuServer/Cloudinit.pm | 125 ++++++++++++++++++++++++++++++++++++
 4 files changed, 296 insertions(+), 30 deletions(-)

-- 
2.20.1




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

end of thread, other threads:[~2022-04-27 14:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 11:54 [pve-devel] [PATCH v3 qemu-server 0/7] cloudinit pending behaviour change Alexandre Derumier
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 1/7] cloudinit: add vm config to cloudinit drive Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 2/7] cloudinit: generate cloudinit drive on offline plug Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 3/7] cloudinit: make cloudnit options fastplug Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 4/7] api2: add cloudinit config api Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2022-04-27 14:14     ` DERUMIER, Alexandre
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 5/7] cloudinit : add extract_cloudinit_config Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 6/7] api2: add cloudinit_update Alexandre Derumier
2022-03-31 13:01   ` Fabian Ebner
2021-06-09 11:54 ` [pve-devel] [PATCH v3 qemu-server 7/7] add cloudinit hotplug Alexandre Derumier
2022-03-31 13:01 ` [pve-devel] [PATCH v3 qemu-server 0/7] cloudinit pending behaviour change Fabian Ebner
2022-03-31 13:11   ` DERUMIER, Alexandre
2022-04-20 16:22   ` DERUMIER, Alexandre

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