public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [RFC series 0/7] move disk or volume to other guests
@ 2021-06-01 16:10 Aaron Lauterer
  2021-06-01 16:10 ` [pve-devel] [RFC storage 1/7] storage: expose find_free_diskname Aaron Lauterer
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Aaron Lauterer @ 2021-06-01 16:10 UTC (permalink / raw)
  To: pve-devel

This is the continuation of 'disk-reassign' but instead of a separate
API endpoint we now follow the approach to make it part of the
'move-disk' and 'move-volume' endpoints for VMs and containers.

The main idea is to make it easy to move a disk/volume to another guest.
Currently this is a manual and error prone process that requires
knowledge of how PVE handles disks/volumes and the mapping which guest
they belong to.

With this, the 'qm move-disk' and 'pct move-volume' are changed in the
way that the storage parameter is optional as well as the new
target-vmid and target-{disk,mp}. This will keep old calls to move the
disk/volume to another storage working. To move to another guest, the
storage needs to be omitted.

Major changes since the last patches and discussions [0] are that the
storage layer only implements the renaming itself. The layer above
(qemu-server and pve-container) define the name of the new volume/disk.
Therefore it was necessary to expose the 'find_free_diskname' function.
The rename function on the storage layer handles possible template
referneces and the creation of the new volid as that is highly dependent
on the actual storage.

The following storage types are implemented at the moment:
* dir based ones
* ZFS
* (thin) LVM
* Ceph RBD


Most parts of the disk-reassign code has been taken and moved into the
'move_disk' and 'move_volume' endpoints with conditional checking if the
reassign code or the move to other storage code is meant to run
depending on the given parameters.

As this is the first iteration of this, I am happy about feedback if
this is the right direction that I am taking and what I might have
missed.

[0] https://lists.proxmox.com/pipermail/pve-devel/2021-April/047481.html
[1] https://lists.proxmox.com/pipermail/pve-devel/2021-April/047481.html

storage: Aaron Lauterer (2):
  storage: expose find_free_diskname
  add disk rename feature

 PVE/Storage.pm               | 27 +++++++++++++++++++++++++--
 PVE/Storage/LVMPlugin.pm     | 18 ++++++++++++++++++
 PVE/Storage/LvmThinPlugin.pm |  1 +
 PVE/Storage/Plugin.pm        | 29 +++++++++++++++++++++++++++++
 PVE/Storage/RBDPlugin.pm     | 16 ++++++++++++++++
 PVE/Storage/ZFSPoolPlugin.pm | 12 ++++++++++++
 6 files changed, 101 insertions(+), 2 deletions(-)


qemu-server: Aaron Lauterer (3):
  cli: qm: change move_disk to move-disk
  Drive: add valid_drive_names_with_unused
  api: move-disk: add move to other VM

 PVE/API2/Qemu.pm        | 204 +++++++++++++++++++++++++++++++++++++++-
 PVE/CLI/qm.pm           |   3 +-
 PVE/QemuServer/Drive.pm |   4 +
 3 files changed, 205 insertions(+), 6 deletions(-)



container: Aaron Lauterer (2):
  cli: pct: change move_volume to move-volume
  api: move-volume: add move to another container

 src/PVE/API2/LXC.pm | 229 ++++++++++++++++++++++++++++++++++++++++----
 src/PVE/CLI/pct.pm  |   3 +-
 2 files changed, 210 insertions(+), 22 deletions(-)





-- 
2.20.1





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

end of thread, other threads:[~2021-07-05  7:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 16:10 [pve-devel] [RFC series 0/7] move disk or volume to other guests Aaron Lauterer
2021-06-01 16:10 ` [pve-devel] [RFC storage 1/7] storage: expose find_free_diskname Aaron Lauterer
2021-06-02  8:29   ` Fabian Ebner
2021-07-02 13:38     ` Aaron Lauterer
2021-07-05  7:58       ` Fabian Ebner
2021-06-01 16:10 ` [pve-devel] [RFC storage 2/7] add disk rename feature Aaron Lauterer
2021-06-02  8:36   ` Fabian Ebner
2021-06-09 14:20     ` Aaron Lauterer
2021-06-01 16:10 ` [pve-devel] [RFC qemu-server 3/7] cli: qm: change move_disk to move-disk Aaron Lauterer
2021-06-01 16:10 ` [pve-devel] [RFC qemu-server 4/7] Drive: add valid_drive_names_with_unused Aaron Lauterer
2021-06-01 16:10 ` [pve-devel] [RFC qemu-server 5/7] api: move-disk: add move to other VM Aaron Lauterer
2021-06-02  8:52   ` Fabian Ebner
2021-06-01 16:10 ` [pve-devel] [PATCH container 6/7] cli: pct: change move_volume to move-volume Aaron Lauterer
2021-06-01 16:10 ` [pve-devel] [PATCH container 7/7] api: move-volume: add move to another container Aaron Lauterer

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