summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJiri Denemark <jdenemar@redhat.com>2012-02-21 13:19:46 +0100
committerJiri Denemark <jdenemar@redhat.com>2012-02-23 14:23:26 +0100
commit0b7480e34ec8cc3e72f919765e0c0d3ba83228b1 (patch)
tree97ecb11b77dc2fee7e55389de52dbc828449b5fe /tools
parent7808844dd162007fafa2f465823ef83adf7ccd6c (diff)
downloadlibvirt-0b7480e34ec8cc3e72f919765e0c0d3ba83228b1.tar.gz
virsh: Add --unsafe option to migrate command
Diffstat (limited to 'tools')
-rw-r--r--tools/virsh.c4
-rw-r--r--tools/virsh.pod10
2 files changed, 13 insertions, 1 deletions
diff --git a/tools/virsh.c b/tools/virsh.c
index e712e53872..3be86ed97b 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -6819,6 +6819,7 @@ static const vshCmdOptDef opts_migrate[] = {
{"copy-storage-inc", VSH_OT_BOOL, 0, N_("migration with non-shared storage with incremental copy (same base image shared between source and destination)")},
{"change-protection", VSH_OT_BOOL, 0,
N_("prevent any configuration changes to domain until migration ends)")},
+ {"unsafe", VSH_OT_BOOL, 0, N_("force migration even if it may be unsafe")},
{"verbose", VSH_OT_BOOL, 0, N_("display the progress of migration")},
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
{"desturi", VSH_OT_DATA, VSH_OFLAG_REQ, N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")},
@@ -6892,6 +6893,9 @@ doMigrate (void *opaque)
if (vshCommandOptBool (cmd, "change-protection"))
flags |= VIR_MIGRATE_CHANGE_PROTECTION;
+ if (vshCommandOptBool(cmd, "unsafe"))
+ flags |= VIR_MIGRATE_UNSAFE;
+
if (xmlfile &&
virFileReadAll(xmlfile, 8192, &xml) < 0) {
vshError(ctl, _("file '%s' doesn't exist"), xmlfile);
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f35244ff94..2956c815cd 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -781,7 +781,7 @@ type attribute for the <domain> element of XML.
=item B<migrate> [I<--live>] [I<--direct>] [I<--p2p> [I<--tunnelled>]]
[I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>]
-[I<--copy-storage-inc>] [I<--change-protection>] [I<--verbose>]
+[I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>]
I<domain-id> I<desturi> [I<migrateuri>] [I<dname>]
[I<--timeout> B<seconds>] [I<--xml> B<file>]
@@ -802,6 +802,14 @@ is implicitly enabled when supported by the hypervisor, but can be explicitly
used to reject the migration if the hypervisor lacks change protection
support. I<--verbose> displays the progress of migration.
+In some cases libvirt may refuse to migrate the domain because doing so may
+lead to potential problems such as data corruption, and thus the migration is
+considered unsafe. For QEMU domain, this may happen if the domain uses disks
+without explicitly setting cache mode to "none". Migrating such domains is
+unsafe unless the disk images are stored on coherent clustered filesystem,
+such as GFS2 or GPFS. If you are sure the migration is safe or you just do not
+care, use I<--unsafe> to force the migration.
+
The I<desturi> is the connection URI of the destination host, and
I<migrateuri> is the migration URI, which usually can be omitted.
I<dname> is used for renaming the domain to new name during migration, which