[pve-devel] [PATCH qemu-server] fix #2100: skip local cloudinit image on offline migrate
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Feb 28 07:43:54 CET 2019
On 2/27/19 9:52 AM, Mira Limbeck wrote:
> check for cdrom and 'vm-<id>-cloudinit' to see if a cloudinit drive is
> configured and delete it from local_volumes so it isn't copied.
>
> Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
oh, and I didn't got this to apply with git am, so you may want to look into
that...
> ---
> PVE/QemuMigrate.pm | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index ee605d8..aedc40f 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -353,6 +353,7 @@ sub sync_disks {
>
> $local_volumes->{$volid}->{ref} = $attr->{referenced_in_config} ? 'config' : 'snapshot';
>
> + return if ($attr->{cdrom} && ($volid =~ /vm-\d+-cloudinit/));
> die "local cdrom image\n" if $attr->{cdrom};
>
> my ($path, $owner) = PVE::Storage::path($self->{storecfg}, $volid);
> @@ -384,6 +385,13 @@ sub sync_disks {
> }
> });
>
> + foreach my $vol (keys %$local_volumes) {
> + if ($vol =~ /vm-\d+-cloudinit/) {
> + delete $local_volumes->{$vol};
> + }
> + }
> +
> foreach my $vol (sort keys %$local_volumes) {
> my $ref = $local_volumes->{$vol}->{ref};
> if ($ref eq 'storage') {
>
More information about the pve-devel
mailing list