reuse mtunnel to allow the migration source side to ask the
migration target side for its dedicated migration IP.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
description => "Used by VM/CT migration - do not use manually.",
parameters => {
additionalProperties => 0,
description => "Used by VM/CT migration - do not use manually.",
parameters => {
additionalProperties => 0,
+ properties => {
+ get_migration_ip => {
+ type => 'boolean',
+ default => 0,
+ description => 'return the migration IP, if configured',
+ optional => 1,
+ },
+ migration_network => {
+ type => 'string',
+ format => 'CIDR',
+ description => 'the migration network used to detect the local migration IP',
+ optional => 1,
+ },
+ },
},
returns => { type => 'null'},
code => sub {
},
returns => { type => 'null'},
code => sub {
+ if ($param->{get_migration_ip}) {
+ my $network = $param->{migration_network};
+ if (my $ip = PVE::Cluster::get_local_migration_ip($network, 1)) {
+ print "ip: '$ip'\n";
+ } else {
+ print "no ip\n"
+ }
+ # do not keep tunnel open when asked for migration ip
+ return undef;
+ }
+
print "tunnel online\n";
*STDOUT->flush();
print "tunnel online\n";
*STDOUT->flush();