vzmigrate(8)
| vzmigrate(8) | System Manager's Manual | vzmigrate(8) |
NAME
vzmigrate - utility for container migration between hardware nodes.
SYNOPSIS
- vzmigrate
- [-r yes|no] [-sfvh] [--keeper[=veid] [--ssh=ssh_options] [--ssh-cipher=ssh_cipher] [--keep-dst] [--keep-images] [--online] [--noiter] [--readonly] [--require-realtime] [--dry-run] [--new-id=CTID] [--new-name=CT_name] [--new-private=CT_private] [--new-root=CT_root] [--nonsharedfs] [--whole-file] [--timeout value] [user@]dst_node {CT_list}
- {CT_list} := source_CTID[:dst_CTID[:dst_CT_private[:dst_CT_root]]] [...]
- without --new-id, --new-name, --new-private, --new-root option(s), or
- {CT List} := source_CTID
- otherwise.
DESCRIPTION
This utility is used for CT(s) migrating from one (source) node to another (destination) node. The list of containers to migrate is specified by the CT_list. A different dst_CTID can be specfied if you want to change CT ID during migration; in addition, dst_CT_private and dst_CT_root paths can also be changed.
Either stopped or running CT can be migrated. For a stopped CT, simple CT private area transfer is performed (by means of rsync(1), unless shared storage is set up). For running CTs, the migration may be slow (with a minute or more of downtime), fast (seconds of downtime) or online (zero downtime).
OPTIONS
- -s, --nostart
- Do not attempt to restore CT state (start/mount CT) after successful migration on destination node, when it was running/mounted on source node. It means that CT should be started/mounted manually on the destination node. Option doesn't affect CT that was stopped at the migration time.
- -r, --remove-area yes|no
- Whether to remove private area on source node for successfully migrated CT. Private area will be saved with .migrated suffix. This command line option overrides the REMOVEMIGRATED configuration parameter in global configuration file vz(5).
- -f, --nodeps[=opt,opt...]
- Skip some or all checks on the destination node before performing migration. The argument is comma-separated set of checks to skip. The following checks can be skipped:
- all
- all checks (this is the default if opt is not provided)
- cpu_check
- cpu capabilities
- disk_space
- required free disk space
- technologies
- technologies used
- license
- license
- rate
- container's RATE configuration parameters
- bindmount
- container's external bind mounts
- -h, --help
- Get usage info.
- --ssh=ssh_options
- Additional options that will be passed to ssh during establishing connection with destination node. Please be careful with these, make sure to NOT pass the destination hostname.
- --ssh-cipher=ssh_cipher
- Override the cipher configured in the SSH configuration file. Both the source and destination servers must support the chosen cipher. Note, passing anything but a cipher may lead to unpredictable behavior.
- --keeper=[veid]
- Keeper CT identification. The service CT ID is used if not specified. Keeper CT is needed to keep CT IP addresses during migration (it is used to e.g. show web page that CT is being migrated).
- --keep-dst
- Don't clean synced destination CT private area in case of some error. It is usefull to use this option on big CT migration to protect of syncing CT private area again in case of some error (on CT stop for example) occured during first migration attempt.
- --keep-images
- Don't remove c/r images after a successful migration.
- --online
- Perform online (zero-downtime) migration: during the migration the CT hangs for a while and after the migration it continues working as though nothing has happened. Options --keeper and --nostart are ignored if this option is set. By default iterative scheme is used for online migration, that is most of the CT memory are transfered before CT suspend. This method introduces the smallest delay in service.
- --noiter
- Do not use iterative scheme during online migration.
- --readonly
- Allows to skip locking the source container and writing any migration-related information to the source server. Use the option if the source server's filesystem is remounted as readonly (e.g., due to corruption).
- --require-realtime
- Force to use only realtime scheme for online migration. Migration fails if this method is not available for some reason. It is useful to ensure that delay in service will be minimal.
- --dry-run
- Option that will perform only checks and will not perform actual data transfer.
- --new-id=CTID
- Set destination container ID.
- --new-name=CT_name
- Set destination container name (i.e. rename the container while migrating).
- --new-private=CT_private
- Set destination CT private.
- --new-root = CT_root
- Set destination CT root.
- Force migrate of CT private from a shared partition to non-shared.
- -W, --whole-file
- Use rsync's --whole-file option.
- -t, --timeout value
- Set connection timeout, in seconds.
- --compress
- Enable ZSTD channel compression.
- -v, --verbose
- Be verbose.
NOTES
If you want to "migrate" CT within the same hardware node, you use vzmlocal(8) instead.
You can set disk IO limits for migrating Containers by configuring the VZ_TOOLS_BCID and VZ_TOOLS_IOLIMIT parameters in the global configuration file vz(5).
EXAMPLES
To migrate CT#101 as CT#1001 to 192.168.1.130 by user
"test":
vzmigrate test@192.168.1.130 101:1001
EXIT STATUS
- 0
- Command completed successfully.
- 1
- Bad command line options.
- 2
- System error.
- 3
- Can't lock CT.
- 4
- Can't connect to destination (source) node.
- 5
- CT is broken or improper.
- 6
- CT private area copying/moving failed.
- 7
- Can't start destination CT.
- 8
- Can't stop source CT.
- 9
- CT already exists on destination node.
- 10
- CT doesn't exist on source node.
- 11
- Failed package sets dependencies. Use -f options to forcedly migrate such CT, CT will not be started on destination side.
- 12
- You attempt to migrate CT which IP addresses already in use (there is running CT) on destination node. Use -f options to forcedly migrate such CT, CT will not be started on destination side.
- 13
- You attempt to migrate CT that contains mount script. Use -f options to forcedly migrate such CT, CT will not be started on destination side.
- 21
- Connection to remote host is broken.
- 22
- Connection to remote host closed due to timeout.
- 25
- Programm terminated.
- 26
- Migrate protocol error.
- 27
- Failed to access template directory.
- 29
- Clone is forbidden for suspended CT.
- 30
- License check failed.
- 31
- Disk space check failed.
- 32
- Technologies check failed for destination node.
- 33
- Rate check filed.
- 34
- Source and destination CTs are equals.
- 35
- UUID-collision, directory already exits.
- 36
- CT config contains bind mount.
- 37
- This CT layout is not supported on destination node.
- 38
- This CT format is not supported on destination node.
- 39
- Can't get source CT format.
- 40
- Can't migrate vzcache2 area (old protocol).
- 41
- Can't migrate suspended CT (old protocol).
- 43
- libvzctl error.
- 45
- This name already used by other CT.
- 46
- CT private directory on the destination node resides on the non-shared partition, use --nonsharedfs option to force copying CT private data.
- 48
- Can not perform online migration to/from elder version.
- 49
- Too long message
- 52
- External program failed
- 56
- Insufficient cpu capabilities on destination node
- 57
- CT has unsupported features
- 61
- The IPv6 module is not loaded on the destination node.
- 62
- The SLM module is not loaded on the destination node.
- 63
- Mounting namespaces in the container is not allowed by the destination node kernel.
- 73
- Can not perform online migration via p.haul.
- 74
- Can not perform migration for container with attached backup.
- 104
- --dry-run option was used.
SEE ALSO
COPYRIGHT
Copyright (c) 2001-2017, Parallels International GmbH. All rights reserved. Copyright (c) 2017-2020 Virtuozzo International GmbH. All rights reserved.
| April 2020 | OpenVZ |
