echo ("Looking up test domain\n");
$dom = $con->get_domain_by_name("ldap");
if ($dom==false)
{
echo ("Domain not found\n");
echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
exit;
}
echo ("Domain found\n");
echo ("Migrating domain to $duri\n");
$rv=libvirt_domain_migrate_to_uri($dom,$duri, VIR_MIGRATE_PEER2PEER | VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE | VIR_MIGRATE_PERSI
ST_DEST | VIR_MIGRATE_UNDEFINE_SOURCE);
if ($rv==false)
{
echo ("Failure!");
echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
}
else
{
echo ("Success\n");
}
Here is the error message when I tried to migrate (powered off) domain
----------------------------------------------------------------------
Looking up test domain
Domain found
Failure!Libvirt last error: Requested operation is not valid: domain is not running
And here is the error message when I tried (powered on) domain
--------------------------------------------------------------
Looking up test domain
Domain found
Failure!Libvirt last error: Unsafe migration: Migration may lead to data corruption if disks use cache != none
Here is the php_error_logs
--------------------------
[17-Oct-2013 05:17:42 America/New_York] PHP Notice: Use of undefined constant VIR_MIGRATE_UNSAFE - assumed 'VIR_MIGRATE_UNSAFE' in /home/www/virtspace/inc/mig.php on line 21
[17-Oct-2013 05:17:42 America/New_York] PHP Notice: Use of undefined constant VIR_MIGRATE_OFFLINE - assumed 'VIR_MIGRATE_OFFLINE' in /home/www/virtspace/inc/mig.php on line 21
According to above php_notices, both VIR_OFFLINE AND VIR_UNSAFE options are not available.
My libvirt version on kvm hosts is (1000002), and php-libvirt version is (0.4.8)
Br.