virsh命令行migrate命令详解
Migrates a virtual server to a different host.
Syntax
where
- <destination-host>
- The libvirt connection URI of the destination host.
- Normal migration:
- Specify the address of the destination host as seen from the virtual server.
- Peer to-peer migration:
- Specify the address of the destination host as seen from the source host.
- <destination-name>
- Is the new name of the virtual server on the destination host.
- <logical-device-name>
- The logical device name of the virtual block device.
- <migrateen-address>
- The host specific URI of the destination host.
- <VS>
- Is the name, ID, or UUID of the virtual server.
- <XML-filename>
- The domain configuration-XML for the source virtual server.
Selected options
- --abort-on-error
- Causes an abort on soft errors during migration.
- --auto-converge
- Forces auto convergence during live migration.
- --change-protection
- Prevents any configuration changes to the virtual server until the migration ends
- --copy-storage-all
- Copies image files that back up virtual block devices to the destination. Make sure that an image file with the same path and filename exists on the destination host before you issue the virsh migrate command. The regarding virtual block devices are specified by the --migrate-disks option.
- --copy-storage-inc
- Incrementally copies non-readonly image files that back up virtual block devices to the destination. Make sure that an image file with the same path and filename exists on the destination host before you issue the virsh migrate command. The regarding virtual block devices are specified by the --migrate-disks option.
- --dname
- Specifies that the virtual server is renamed during migration (if supported).
- --domain
- Specifies the virtual server.
- --live
- Specifies the migration of a running or a paused virtual server.
- --migrate-disks
- Copies the files which back up the specified virtual block devices to the destination host. Use the --copy-storage-all or the --copy-storage-inc option in conjunction with this option. The regarding files must be writable. Please note that virtual DVDs are read-only disks. If in doubt, check your domain configuration-XML. If the disk device attribute of a disk element is configured as cdrom, or contains a readonly element, then the disk cannot be migrated.
- --migrateuri
- Specifies the host specific URI of the destination host.
If not specified, libvirt automatically processes the host specific URI from the libvirt connection URI. In some cases, it is useful to specify a destination network interface or port manually.
- --offline
- Specifies the migration of the virtual server in
shut off
state. A copy of the libvirt-internal configuration of the virtual server on the source host is defined on the destination host.If you specify this option, specify the --persistent option, too.
- --persistent
- Specifies to persistent the virtual server on the destination system.
- --p2p
- Specifies peer-to-peer migration:
libvirt establishes a connection from the source to the destination host and controls the migration process. The migration continues even if virsh crashes or loses the connection.
Without the --p2p option, virsh handles the communication between the source and the destination host.
- --suspend
- Specifies that the virtual server will not be restarted on the destination system.
- --timeout seconds
- The number of seconds allowed before the virtual server is suspended while live migration continues.
- --tunnelled
- Specifies a tunneled migration:
libvirt pipes the migration data through the libvirtd communication socket. Thus, no extra ports are required to be opened on the destination host. This simplifies the networking setup required for migration.
The tunneled migration has a slight performance impact, because the data is copied between the libvirt daemons of the source host and the destination host.
Nevertheless, also in a tunneled migration, disk migration requires one extra destination port per disk.
- --undefinesource
- Specifies to undefine the virtual server on the source system.
- --unsafe
- Forces a migration even if it may cause data loss or corruption on the virtual server.
- --verbose
- Displays messages which indicate the migration progress.