File: libvirt-domain-migrate.xml

package info (click to toggle)
libvirt-php 0.5.2~30-g64dca6f-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,460 kB
  • ctags: 5,538
  • sloc: cpp: 11,159; ansic: 8,250; xml: 3,999; php: 1,604; sh: 580; makefile: 189; perl: 97
file content (122 lines) | stat: -rw-r--r-- 3,864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.28 $ -->

<refentry xml:id="function.libvirt-domain-migrate" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>libvirt_domain_migrate</refname>
  <refpurpose>Migrate the domain object from its current host to the destination host defined by a connection</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>resource</type><methodname>libvirt_domain_migrate</methodname>
   <methodparam ><type>resource</type><parameter>domain</parameter></methodparam>
   <methodparam ><type>resource</type><parameter>dconn</parameter></methodparam>
   <methodparam ><type>integer</type><parameter>flags</parameter></methodparam>
   <methodparam ><type>string</type><parameter>dname</parameter></methodparam>
   <methodparam ><type>string</type><parameter>uri</parameter></methodparam>
   <methodparam ><type>integer</type><parameter>bandwith</parameter></methodparam>
  </methodsynopsis>
  <para>
   Performs migration of the domain from one host to another. For description of parameters and flags see <link xlink:href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrate">original documentation</link>.
  </para>
  <para>
   Please note that the function returns after the migration is complete. It may take a lot of time to migrate a host. Be sure to configure PHP maximum execution time.
  </para>

 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <!-- See also &return.success; -->
  <para>
   Resource to new domain  on success and &false; on failure. Please note that the resource of the domain is in the context of dconn.
  </para>
 </refsect1>

<refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>libvirt_domain_migrate</function> example</title>
    <para>
    Live migrate domain (f13_exper) to another node
    </para>
    <programlisting role="php">
<![CDATA[
<?php
    echo ("Looking up f13_exper domain\n");
    $dom=@libvirt_domain_lookup_by_name($conn,"f13_exper");
    if ($dom==false)
    {
       echo ("Domain not found\n");
       echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
       exit;
    }
    echo ("Domain found\n");

    echo ("Connecting to libvirt (URI:$duri)\n");
    $dconn=libvirt_connect($duri,false,$credentials);
    if ($dconn==false)
    {
       echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
       exit;
    }
    echo ("Connected\n");

    echo ("Migrating domain to $duri\n");
    $ddom=libvirt_domain_migrate($dom,$dconn,VIR_MIGRATE_LIVE | VIR_MIGRATE_PEER2PEER | VIR_MIGRATE_PERSIST_DEST | VIR_MIGRATE_UNDEFINE_SOURCE);
    if ($ddom==false)
    {
       echo ("Failure!");
       echo ("Libvirt last error: ".libvirt_get_last_error()."\n");
    }
    else
    {
	echo ("Success\n");
	echo ("DDom is resource ($ddom) to migrated domain in context of destination connection\n");
    }

?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>



 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>libvirt_domain_migrate_to_uri2</function></member>
    <member><function>libvirt_domain_migrate_to_uri</function></member>
    <member><function>libvirt_domain_get_job_info</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->