VM migrations over IPv6

CTCcloud

Renowned Member
Apr 6, 2012
151
20
83
I've found that with IPv6 enabled in Proxmox 4.1 I can no longer migrate VMs within the cluster

Jan 27 11:37:51 starting migration of VM 103 to node 'PMX-node-I' (2607:xxxx:xxxx:x::35)
Jan 27 11:37:51 copying disk images
ssh: connect to host 2607 port 22: Invalid argument
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]
Jan 27 11:37:51 ERROR: Failed to sync data - command '/usr/bin/rsync --progress --sparse --whole-file /var/lib/vz/images/103/vm-103-disk-1.raw root@2607:xxxx:xxxx:x::35:/var/lib/vz/images/103/vm-103-disk-1.raw' failed: exit code 255
Jan 27 11:37:51 aborting phase 1 - cleanup resources
Jan 27 11:37:51 ERROR: found stale volume copy 'local:103/vm-103-disk-1.raw' on node 'PMX-72-I'
Jan 27 11:37:51 ERROR: migration aborted (duration 00:00:00): Failed to sync data - command '/usr/bin/rsync --progress --sparse --whole-file /var/lib/vz/images/103/vm-103-disk-1.raw root@2607:xxxx:xxxx:x::35:/var/lib/vz/images/103/vm-103-disk-1.raw' failed: exit code 255
TASK ERROR: migration aborted

I believe the error is with how the server is trying to perform it's sync with rsync. Just like scp the command should be root@[ipv6 address]:/var/lib/vz/images/vm number/vm virtual disk name.raw or .qcow2 or whatever. In other words, the ipv6 address needs brackets when you are going to add the colon at the end with the filesystem location data.

Would someone be able to tell me how to fix this if it's possible without a patch from proxmox so that my migrations can happen as they should? Is there an internal file that needs to be modified to make this work properly?
 
Hm, why didn't I run into that... nice catch.
Sorry, you'll have to use ipv4 or wait for a patch. Although it'll be a oneliner.
Code:
#/usr/share/perl5/PVE/Storage.pm
(...)
         my $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file',
-              $src, "root\@${target_host}:$dst"];
+              $src, "[root\@${target_host}]:$dst"];
(...)
(Yes, with rsync you can put it around the entire user@host portion and it accepts brackets for ipv4 and hostnames, too.)
 
  • Like
Reactions: CTCcloud
Hm, why didn't I run into that... nice catch.
Sorry, you'll have to use ipv4 or wait for a patch. Although it'll be a oneliner.
Code:
#/usr/share/perl5/PVE/Storage.pm
(...)
         my $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file',
-              $src, "root\@${target_host}:$dst"];
+              $src, "[root\@${target_host}]:$dst"];
(...)
(Yes, with rsync you can put it around the entire user@host portion and it accepts brackets for ipv4 and hostnames, too.)

Great! I'm glad it's so simple to adjust to work properly .... I'm sure that can be patched within a short time, no?

Also, I noticed for IPv6 to work in the cluster you need to add the proper address entry to the /etc/hosts file as follows

At the end of the IPv6 section put
2607:xxxx:xxxx:x::35 PM-node-I.example.com PM-node-I pvelocalhost

then restart the pveproxy service and things work over IPv6 but if you don't do this, whether or not you've added IPv6 addresses to the NICs, the host continues to use IPv4

Thanks again. This is a most excellent product. Keep up the great work you've done and are doing.
 
Yes, this is intentional. The services only listen on one ip address, to figure out which one that's supposed to be it just looks up the hostname.
 
  • Like
Reactions: CTCcloud
Cool, I get it. Anyway, I'll leave the hosts file alone and leave everything IPv4 until a patch is released to address the migration issue.

Thanks again
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!