Oracle Cloud Infrastructure Documentation

Moving a Compute Instance to a New Host

This topic covers how to relocate a virtual machine or a bare metal instance by using reboot migration or a manual process.

Note

Dedicated virtual machine hosts do not support reboot migration. To relocate these instances use the process described in Moving an Instance with Manual Migration.

Reboot Migration

For instances with a date in the Reboot Maintenance field (available in the Console, CLI, and SDKs), you can reboot your instance to move it to new infrastructure. After you reboot the instance, the Reboot Maintenance field is cleared. This change indicates that the instance was moved successfully.

Before the reboot, detach all paravirtualized or emulated block volumes and delete all secondary VNIC attachments. Left in place, these attachments can prevent the service from moving your instance. After the reboot, you can reattach block volumes and secondary VNICs.

Limitations and Warnings for Reboot Migration

Any public IP addresses assigned to secondary VNICs from a reserved public pool are retained. Public IP addresses that were not assigned from a reserved public IP pool will change. Private IP addresses do not change.

Prerequisites for Reboot Migration

  1. Determine if your instance has any paravirtualized or emulated remote block volume attachments:

    1. Open the navigation menu. Under Core Infrastructure, go to Compute and click Instances.

    2. Click the name of the instance you want to move.
    3. On the Instance Details page, click Attached Block Volumes.
    4. Note the Attachment Type for each volume.
  2. Document any remote block volumes attached to the instance.
  3. Determine if your instance has any secondary VNIC attachments:

    1. On the Instance Details page, click Attached VNICs.
    2. Excluding the first VNIC, document all private IP addresses, names, subnets, and tags on each VNIC. Note that the instance can have multiple VNICs, and each VNIC can have multiple secondary IP addresses.
    3. Excluding the first VNIC, document any public IP addresses assigned from a reserved public pool. Note that the instance can have multiple VNICs, and each VNIC can have multiple secondary private IP addresses. Each VNIC and secondary private IP address can have an attached public IP address.
  4. Prepare the instance for reboot migration:

    • Ensure that any remote block volumes defined in /etc/fstab use the recommended options.
    • Ensure that any File Storage service (NFS) mounts use the nofail option.
    • If you have statically defined any network interfaces belonging to secondary VNICs using their MAC addresses, such as those defined in /etc/sysconfig/network-scripts/ifcfg*, those interfaces will not start due to the change in the MAC address. Remove the static mapping.
    • If you use the Oracle-provided script to configure secondary VNICs, ensure it runs automatically at startup.

Moving an Instance with Reboot Migration

After you complete the prerequisites:

  1. Stop any running applications.
  2. Ensure that those applications will not start automatically.

    Warning

    When the relocated instance starts for the first time, remote block volumes and secondary VNICs, or any resource that relies on them, will not be attached. The absence of these resources can cause application issues.

  3. Unmount any remote block volumes or File Storage service (NFS) mounts.
  4. Detach any paravirtualized or emulated remote block volumes.
  5. Delete all secondary VNICs.
  6. Back up all remote block volumes. See Backing Up a Volume for more information.
  7. Reboot the instance.
  8. Confirm that the Reboot Maintenance field no longer has a date.
  9. Reattach any remote block volumes.
  10. Recreate any secondary VNICs, including tags.
  11. Start and test any applications on the instance.
  12. Configure the applications to start automatically, as required.
  13. (Optional) After you confirm that the instance and applications are healthy, you can delete the volume backups.

Moving an Instance with Manual Migration

For instances without a date in the Reboot Maintenance field (available in the Console, CLI, and SDKs), you must move the instance manually. This method requires that you terminate the instance, and then launch a new instance from the retained boot volume. Instances that have additional VNICs, secondary IP addresses, remote attached block volumes, or that belong to a backend set of a load balancer require additional steps.

Limitations and Warnings for Manual Migration

Be aware of the following limitations and warnings when performing a manual migration:

  • Any public IP addresses assigned to your instance from a reserved public pool are retained. Any that were not assigned from a reserved public IP address pool will change. Private IP addresses do not change.
  • MAC addresses, CPUIDs, and other unique hardware identifiers do change during the move. If any applications running on the instance use these identifiers for licensing or other purposes, be sure to take note of this information before moving the instance to help you manage the change.

Prerequisites for Manual Migration

  1. Before moving the instance, document all critical details:

    • The instance's region, availability domain, and fault domain.
    • The instance's display name.
    • All private IP addresses, names, and subnets. Note that the instance can have multiple VNICs, and each VNIC can have multiple secondary IP addresses.
    • All private DNS names. The instance can have multiple VNICs, and each VNIC can have multiple secondary IP addresses. Each private IP address can have a DNS name.
    • Any public IP addresses assigned from a reserved public pool. Note that the instance can have multiple VNICs, and each VNIC can have multiple secondary private IP addresses. Each VNIC and secondary private IP address can have an attached public IP address.
    • Any remote block volumes attached to the instance.
    • Any tags on the instance or attached resources.
  2. Prepare the instance for manual migration:

    • Ensure that any remote block volumes defined in /etc/fstab use the recommended options.
    • Ensure that any File Storage service (NFS) mounts use the nofail option.
    • If you have statically defined any network interfaces belonging to secondary VNICs using their MAC addresses, such as those defined in /etc/sysconfig/network-scripts/ifcfg*, those interfaces will not start due to the change in the MAC address. Remove the static mapping.
    • If you use the Oracle-provided script to configure secondary VNICs, ensure it runs automatically at startup.

Moving an Instance Manually

After you complete the prerequisites:

  1. Stop any running applications.
  2. Ensure that those applications will not start automatically.

    Warning

    When the relocated instance starts for the first time, remote block volumes, secondary VNICs, or any resource that relies on them, will not be attached. The absence of these resources can cause application issues.

  3. If your instance has local NVMe storage (dense instances), you must back up this data:
    1. Create and attach one or more remote block volumes to the instance.
    2. Copy the data from the NVMe devices to the remote block volumes.
  4. Unmount any remote block volumes or File Storage service (NFS) mounts.
  5. Back up all remote block volumes. See Overview of Block Volume Backups for more information.
  6. Create a backup of the root volume.

    Important

    Do not generalize or specialize Windows instances.

  7. Terminate the instance:

    Using the Console
    Using the API
    Using the CLI
  8. Create a new instance using the boot volume from the terminated instance.
  9. In the launch instance flow, specify the private IP address that was attached to the primary VNIC. If the public IP address was assigned from a reserved IP address pool, be sure to assign the same IP address.
  10. When the instance state changes to RUNNING, Stop the instance.
  11. Recreate any secondary VNICs and secondary IP addresses.
  12. Attach any remote block volumes.

    Note

    This step includes any volumes used to back up local NVMe devices. Copy the data onto the NVMe storage on the new instance, and then detach the volumes.

  13. Start the instance.
  14. Start and test any applications on the instance.
  15. Configure the applications to start automatically, as required.
  16. Recreate the required tags.
  17. (Optional) After you confirm that the instance and applications are healthy, you can delete the volume backups.