[pve-devel] [PATCH] Implement pending change

Dietmar Maurer dietmar at proxmox.com
Mon Oct 27 11:30:32 CET 2014


Hi Aleandre, comments inline:

> -----Original Message-----
> From: pve-devel [mailto:pve-devel-bounces at pve.proxmox.com] On Behalf Of
> Alexandre Derumier
> Sent: Mittwoch, 22. Oktober 2014 10:04
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] Implement pending change
> 
> This add a new section pending
> 
> [PENDING]
> 
> When we change an option, it's always write in pending section first, then
>    if the vm is not running,
>    or if the vm is running and the option|device can be change online we remove
> it from pending and update the main config
> 
> On delete,
>   -disks as marked as unused in pending
>   -options are marked as 'delete' in pending,

Wouldn't it be easier to add an 'delete' option, like:

[PENDING]
delete: ostype, net0, ide2

The also use a 'delete' property  on the CLI, for example

# qm  set VMID  --delete ostype,net0,ide2

So a 'qm commit' (see below) just translates [PENDING] into "qm set"?

> The pending changes are applied on vm_stop and vm_start.
> (maybe could we add an api to manually apply pending changes when vm is
> stopped)

yes, maybe

# qm commit VMID

> some examples:
> 
> delete option
> -------------
> [CONF]
> ostype: l26
> 
> qm set -delete ostype
> 
> [CONF]
> ostype: l26
> [PENDING]
> osdtype : delete

delete: ostype

> 
> delete disk
> -----------
> [CONF]
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> 
> qm set -delete virtio1
> 
> [CONF]
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> [PENDING]
> unused0 : local:100/vm-100-disk-1.raw,format=raw

delete: virtio1

Or why is 'unsedX' better?
 
> swap disk with unused disk
> --------------------------
> [CONF]
> unused0 : local:100/vm-100-disk-2.raw,format=raw
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> 
> qm set 100 -virtio1 local:100/vm-100-disk-2.raw
> 
> [CONF]
> unused0 : local:100/vm-100-disk-2.raw,format=raw
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> [PENDING]
> unused1 : local:100/vm-100-disk-1.raw,format=raw
> virtio1 : local:100/vm-100-disk-2.raw,format=raw
> 
> update: swap disk with new disk
> --------------------------
> [CONF]
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> 
> qm set 100 -virtio1 local:1
> 
> [CONF]
> virtio1 : local:100/vm-100-disk-1.raw,format=raw
> [PENDING]
> unused1 : local:100/vm-100-disk-1.raw,format=raw
> virtio1 : local:100/vm-100-disk-2.raw,format=raw

[CONF]
virtio1 : local:100/vm-100-disk-1.raw,format=raw
[PENDING]
virtio1: local:1

Or what is the advantage to allocate immediately? And why do you want
to maintain a list of unused disks inside [PENDING]?






More information about the pve-devel mailing list