# AWS Version Upgrade

### Procedure Overview

<table data-header-hidden><thead><tr><th width="91"></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>#</strong></td><td><strong>Step</strong></td><td><strong>Executed by</strong></td><td><strong>Comments</strong></td><td><strong>Estimated duration</strong></td></tr><tr><td>1.</td><td>Console creation</td><td>Reblaze</td><td>Configuration migration</td><td>1 Day</td></tr><tr><td>2.</td><td>Create new deployment</td><td>Customer</td><td>Creating a new instance group</td><td>30 minutes</td></tr><tr><td>3.</td><td>Setup canary instance</td><td>Reblaze<br>&#x26; Customer</td><td>Adding a new template</td><td>15 minutes</td></tr><tr><td>4.</td><td>Verify traffic monitoring</td><td>Reblaze<br>&#x26; Customer</td><td>Verifying that there are no issues with site performance, and making changes to security profiles, if necessary.</td><td>1 Hour</td></tr><tr><td>5.</td><td>Rеmove old template</td><td>Customer</td><td>Replace all instances</td><td>15 minutes</td></tr></tbody></table>

### Procedure Details

#### Step 1: Console Creation by Reblaze

The Reblaze team will set up a new 2.x console for you. Once this is done, proceed to Step 2.

Redis settings: If you already have a Redis server installed (which is usually true for Reblaze installations of v2.14 and later), you do not need to create a new one. If you do not have a Redis server setup, you will need to create one.

**Step 2: Create New Deployment**

Go to EC2 > Auto Scaling groups, see **Launch template configuration** ( zone , capacity, type, etc.)

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FjsixonuZKpeZokAwa0Aa%2Fimage.png?alt=media\&token=69993be8-943f-40ba-a4ac-9d9783efaef5)

Now go to EC2 > Launch Template Select your template. To create a new launch template version with a new image, click **Actions > Modify template**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FYvDy83HqUauQM5Cq9iS6%2Fimage.png?alt=media\&token=aa7053fd-22c7-4bb7-9044-dc38ad3bb973)

On the screen that appears (below), provide a description of the image (version 2.18.0 was used as an example below):

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FwOQ3Bkax6NrQh4aS6poi%2Fimage.png?alt=media\&token=c45b513a-eccd-40b6-9ca7-3b2894a854ee)

Scroll further down the page and see the AMI details listed in the **AMI from catalog** tab:

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FeiVyMLAJcUXkdVqbWbxA%2Fimage.png?alt=media\&token=a980f8bb-6d5f-4b73-be59-ad9de6e34393)

Next, Reblaze deployment in the AWS marketplace must be set up.

Search for Reblaze and click on the first option.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FD6n22DVwxcJfOdsYtCLf%2Fimage.png?alt=media\&token=3b000b17-ab51-4f57-9efb-d07abb3d66a7)

Scroll down the page and click **View CloudFormation Template.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2Fs2MPVZaVeC0AmoCXc28K%2Fimage.png?alt=media\&token=0cbd9cfd-67ae-46ce-9835-c1be1e806b6c)

Now click **View Template in CloudFormation Designer**.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FkG851ZRqMUcr2bm23AkU%2Fimage.png?alt=media\&token=5774d82c-25a1-48fd-b223-947863195b3f)

In this template (below) you can see each region and its AM&#x49;**.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FQFb6SabjvVKQShn8kvsq%2Fimage.png?alt=media\&token=a02a607d-e5c6-4c75-8523-93d363a2479a)

Copy the AMI compatible with your region. (In our example we used the “us-east-1” AMI.)

Now, return  to the Modify template window. Under AMI from catalog, select Browse more AMI&#x73;**.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FTUDhD4TNOp0ANrWAeNVP%2Fimage.png?alt=media\&token=cdaad605-8537-45a2-afcc-d2d2ef290ac6)

Paste the AMI in the search box. Choose the Reblaze image from among the search results.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2F4vryz9xMSoExGtD9AAZT%2Fimage.png?alt=media\&token=39768304-ef35-4a04-aea1-e23ed309f650)

Find and select the Reblaze image.\
Click **Select.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FKZkD5Us3fD55ctEVFngn%2Fimage.png?alt=media\&token=dcab585b-d663-4ffa-af40-627fd08c020a)

In the Modify template window, add the new version to your catalog.&#x20;

Click **Create template version** on the bottom right of the screen.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FDwVveWxUCHAfPH6UuXXZ%2Fimage.png?alt=media\&token=33337821-05e1-4d46-8ae1-8c083cc75ac5)

Your new version now appears under **Launch template details.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2Fg4vLhayTsRQcixuqEltY%2Fimage.png?alt=media\&token=de5d6cae-b5a6-4eb9-a8c6-8175d5f26303)

#### **Step 3: Set Up Canary Instance**

Go to EC2 > Launch template and change the Default to the new version (2) Click Update.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FPS6Rq5vUDvbYu1nJYupn%2Fimage.png?alt=media\&token=5225db73-56ac-4d3f-8e68-701ecf1a9de6)

Go to your AutoScaling group. In the **Details** tab, find Group details and click **Edit.**

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2F1HsSm51bW8oedznMPFcT%2Fimage.png?alt=media\&token=34a5d54e-d8c6-4f55-8b2d-f3764b99229c)

**Desired capacity** must be increased by 100% . For example, if you have 2 servers, Desired capacity must be set to 4. Ensure that this amount does not exceed the Maximum capacity or it too will need to be increased.

Click **Update** (below).

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FX4zZXtFQYGMe8OyDb8Xq%2Fimage.png?alt=media\&token=f809e93b-6eb7-4016-ad3d-f96da3d1ef08)

#### **Step 4: Verify Traffic Monitoring**

On the EC2 > Auto Scaling groups screen, check the **Instance management** tab for the number of servers. Alternatively, you can check the number of servers on your console.&#x20;

You should be able to see new servers being added with the new version.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FwKEvdJTz8T71o81K7tg9%2Fimage.png?alt=media\&token=5b1bb860-8be4-4ccd-aebc-2e326b564e54)

Go to your Reblaze dashboard and confirm that you see the new instances and that traffic is routing through them and your sites are working as expected.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FkePJn2OiYgKAkGlbukvj%2Fimage.png?alt=media\&token=4b4b9cae-8f94-418b-8e6b-469df96a6251)

#### **Step 5: Remove Old Servers**

Once we verify the new servers are receiving traffic, the old version and its servers must be terminated.

Under the Auto Scaling group, **Details** tab, there is an Advanced configurations window.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FRbwYHx2MZfhLqEqQbnPD%2Fimage.png?alt=media\&token=dc1bdee8-3ad2-44c7-815c-cfa64b49cfd1)

Make sure Termination policies is set to Oldest Launch Template; if not, click Edit and             change the policy.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FWF0svgJ1rEQ4EhWQIw2i%2Fimage.png?alt=media\&token=d88c7dca-9834-4f8a-bc5f-a5a04f0b93ad)

Under the Details tab on the EC2 > Auto Scaling groups screen, locate the **Group size** options.  Reduce the number of desired servers in group to the original amount.

![](https://1443104804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYa27AYz47cZTEzJZB1vy%2Fuploads%2FS5xXk6U14aDCftC1y8vJ%2Fimage.png?alt=media\&token=f4d21663-0f88-4253-9491-2d121ee3e666)

Click **Update**. The servers attached to the older version will terminate.
