[one-users] Custom network for VM Live-migration

Stefan Kooman stefan at bit.nl
Fri Jun 13 23:22:15 PDT 2014


Quoting Javier Fontan (jfontan at opennebula.org):
> I haven't tested this but it may work.
> 
> When you do a migration the destination host is specified. The host
> name is the same as the one configured in OpenNebula so it will use
> the same network as ssh connections. To use another network you can
> modify the script so the destination host is changed. For example,
> let's asume that the machines have 192.168.1.x for the standard
> service network (ssh) and another network for migrations at 10.0.1.x.
> The node names for these both networks can be the same but adding a
> suffix to the migration network, something like this:
> 
> 192.168.1.1 node01
> 10.0.1.1 node01-migration
> 192.168.1.2 node02
> 10.0.1.2 node02-migration
> 
> Now you can change the migration script to use the migration network
> as destination host, for example for kvm:
> 
> exec_and_log "virsh --connect $LIBVIRT_URI migrate --live $deploy_id
> $QEMU_PROTOCOL://${dest_host}-migration/system" \
>     "Could not migrate $deploy_id to $dest_host"

${dest_host}-migration results in "FQDN-migration" which doesn't work.
However with a little hack I made it work (/var/tmp/one/vmm/kvm/migrate):

-----8<-------
HOSTNAME=$(cut -f1 -d. <<< $2)
DOMAIN=$(cut -f2- -d. <<< $2)
MIGSUF="migration"
DEST_MIGR_HOST=$HOSTNAME-$MIGSUF.$DOMAIN

exec_and_log "virsh --connect $LIBVIRT_URI migrate --live $deploy_id
$QEMU_PROTOCOL://$DEST_MIGR_HOST/system --migrateuri
tcp://$DEST_MIGR_HOST" \
    "Could not migrate $deploy_id to $dest_host"
----->8-------

The "--migrateuri tcp://$DEST_MIGR_HOST" part is especially important,
because normally virsh would find out the hostname to connect to by
"virsh hostname" command, which isn't the one with the "-migration"
suffix, and only the initial communication would be done over the live-migrate
network.

Thanks,

Gr. Stefan

-- 
| BIT BV  http://www.bit.nl/        Kamer van Koophandel 09090351
| GPG: 0xD14839C6                   +31 318 648 688 / info at bit.nl


More information about the Users mailing list