openstack Verified current stable Not installed? Cloud Infrastructure

Openstack / Migrate Server To Different Host

Migrate Server To Different Host

Migrates a server to a different host, either live or block migration.

$
Terminal
openstack server migrate --live <host_hostname> --shared-migration --wait <instance_id>

When To Use

During a network maintenance window when live migration is needed to minimize downtime.

Pro Tip

Use `--shared-migration` if your shared storage is properly configured; otherwise, opt for `--block-migration` to avoid I/O errors.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
openstack server migrate --live <host_hostname> --shared-migration --wait <instance_id>

Anatomy of Output

Understanding the result

Starting live migration of instance 1234-5678-90ab-cdef to host hostname.example.com Migration Status

Indicates the beginning of the migration process.

MIGRATE: live migration completed successfully Completion Notice

Confirms the successful completion of the migration.

Instance now running on hostname.example.com Current Status

Verifies the current host of the instance.

Troubleshooting

Common pitfalls

Error: Migration failed: Connection to destination host lost.

Solution: Check network connectivity and ensure destination host is accessible.

Error: Instance cannot be migrated due to disk I/O error.

Solution: Verify shared storage configuration or switch to block migration.

Error: Destination host not suitable for migration.

Solution: Ensure the destination host has adequate resources and compatibility.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.
<host_hostname>
host hostname
The host or server name supplied to this command.
--shared-migration
shared migration| block migration
The value supplied for shared migration| block migration.
<instance_id>
instance id
The value supplied for instance id.
--live
Command Option
Tool-specific option used by this command invocation.
--shared-migration
Command Option
Tool-specific option used by this command invocation.
--wait
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.