[pve-devel] [PATCH v2 qemu-server 0/3] fix #2100 & #1807: offline migrate and restore

Mira Limbeck m.limbeck at proxmox.com
Fri Mar 29 16:32:02 CET 2019


The first patch contains the creation of the cloudinit disk if it does
not exist on startup. This patch is a prerequisite for the following 2.
As the size for the disk is fixed a sensible default for snippets files
was chosen (1MiB per file, 3 files max (meta, network, user)). This
should always be enough to still fit in the 4MiB limit.

Patch 1 fixes #1807 but there's still the issue with unmapped vmid on
restore. This is fixed in the 3rd one.

Patch 2 fixes #2100 by simply ignoring the cloudinit drive because it
always gets regenerated on vm start. For a VM to start after migration
the disk has to be created on the new host (this is done by patch 1).

Patch 3 changes the VMID of the cloudinit disk on restore and also
takes into account the targetstorage specified.

Tested with and without snippets and a Ubuntu 18.10 VM.

Additional note:

The 'create_disks' function ignores any format set in the GUI and
defaults to 'qcow2' if $scfg->{path} is defined, 'raw' otherwise. This
was kept in the commit_cloudinit_disk code for now.

v2:
 - (Patch 3) accept sata and scsi as well on restore
 - cover letter -> additional note

Mira Limbeck (3):
  cloudinit: create disk if it does not exist on start
  fix #2100: ignore cloudinit drive on offline migration
  map vmid correctly for cloudinit on restore

 PVE/API2/Qemu.pm            |  4 ++--
 PVE/QemuMigrate.pm          | 18 ++++++++++++++++--
 PVE/QemuServer.pm           | 23 ++++++++++++++++++++---
 PVE/QemuServer/Cloudinit.pm | 10 ++++++++--
 4 files changed, 46 insertions(+), 9 deletions(-)

-- 
2.11.0




More information about the pve-devel mailing list