AWS EC2 Migration Steps for 656X Upgrade

For those planning to migrate from 556X to 656X running AWS EC2 Instances, the guidance below may prove useful. At a high level, the effort can be accomplished by swapping volumes. This approach effectively serves to accomplish the same end result as building new EC instances and reusing IP addresses, with an approach that narrows the effort to only having to swap the existing EC2 volume.

 

High Level Steps

  1. Sentry Admin export and save full FSX config from existing Sentry Instance
  2. AWS Engineer to launch new instance from latest AMI (Use same size instance, same VPC and Security Group)
  3. AWS Engineer stops existing instance
  4. AWS Engineer swaps volumes (new to old)
  5. AWS Engineer starts existing instance
  6. Sentry Admin applies Sentry license to new instance
  7. Sentry Admin imports FSX from step 1
  8. Sentry Admin sets enable password via CLI (use temp password)
  9. Sentry Admin sets system name via CLI
  10. Sentry Admin validate NTP (sync time) via CLI
  11. Sentry Admin upgrades product version (if necessary)
  12. Sentry Admin validates runtime API traffic

 

More detailed info about swapping volumes within AWS is below. Note: You are required to launch the new instance in the same Availability Zone as the old instance to swap volumes.

 

Steps to Move the New Instance’s Volume to the Old Instance (with the Old IP):

 

1. Stop the Old EC2 Instance (with the desired IP address for the new instance)

   - In the **EC2 Dashboard**, find your old instance (the one with the IP you want to retain) and stop it.

 

2. Detach the Root Volume from the Old Instance*

   - Go to **Volumes** in the EC2 Dashboard.

   - Find the root volume attached to the old instance (usually `/dev/xvda` or `/dev/sda1`).

   - Select the volume, click on Actions, and choose Detach Volume.

   - Wait for it to completely detach.

 

3. Detach the Root Volume from the New Instance

   - Now, find the newly initialized instance (the one whose volume you want to swap over).

   - Stop the new instance.

   - Go to Volumes, find the root volume attached to this instance, and click Actions ->Detach Volume.

 

4. Attach the New Volume to the Old Instance

   - Now, select the root volume from the **new instance** that you just detached.

   - Click Actions -> Attach Volume.

   - In the dialog, choose the old instance as the target.

   - Attach it as the root device (usually `/dev/xvda` or `/dev/sda1`).

 

5. Start the Old EC2 Instance (with the New Volume)

   - Once the volume from the new instance is attached to the old instance, you can start the old instance.

   - The old instance will now boot using the volume of the new instance while retaining its original IP address.

 

6. Test and Verify

   - After the old instance starts, SSH into it.

   - Verify that it has booted with the contents of the new volume.

   - Check that the instance has retained its original IP address.

 

7. Terminate the New Instance 

   - Terminate the new instance to save resources.

 

Optional Considerations:

- Elastic IPs: If the old instance uses an Elastic IP, you don’t need to worry about losing the IP during this process.

- Private IP: If using private IPs, the old instance will retain its internal IP.

 

This process will swap the volumes and allow you to keep the old instance’s IP address while booting with the new instance’s data.

 

Rollback Process

Steps to Roll Back to the Original State

  1. Stop the Old EC2 Instance

    • If the old instance is running after you've swapped the volume, stop it first. This ensures a clean rollback.
  2. Detach the New Volume from the Old EC2 Instance

    • Go to the Volumes section in the EC2 Dashboard.
    • Find the new volume that you attached to the old instance.
    • Select it, click Actions, and choose Detach Volume.
  3. Reattach the Original Volume to the Old EC2 Instance

    • Locate the original root volume of the old instance (the one you detached earlier).
    • Select it, click Actions, and choose Attach Volume.
    • Select the old instance in the Instance field and ensure that it’s attached as the root device (e.g., /dev/xvda or /dev/sda1).
  4. Start the Old EC2 Instance

    • Once the original volume is reattached, start the old EC2 instance.
    • The instance should now boot with its original root volume, restoring its previous state.
  5. Test and Verify

    • SSH into the instance to ensure it’s running correctly with the original data and configuration.
    • Verify that all services and applications are running as expected.

Additional Rollback Precautions

  • Snapshot Backups: Before detaching any volume, it’s a good idea to create a snapshot of the existing root volume. This snapshot serves as a backup and allows you to restore the volume to its previous state even if something goes wrong during the process.

    To create a snapshot:

    • Go to Volumes, select the volume you want to back up, click Actions > Create Snapshot.
    • You can use this snapshot to create a new volume if you need to restore the state later.
  • Monitor Logs and Services: After rolling back, check the instance logs and monitor services to ensure everything is functioning correctly. This will help identify any issues that may have arisen during the process.

This rollback process will restore your old instance to its original configuration, effectively undoing the volume swap.

 

Additional links you may find useful related to this effort are below:

 

Forum Sentry 556X EOL Notice

The Latest Forum Sentry AMI

 

0 Comments

Article is closed for comments.