AWS t1 to t2 migration: Client.InstanceInitiatedShutdown on new t2 instance

amazon-amiamazon-web-services

I've had a Linux t1.micro running a small Apache/PHP/Postgresql website for a couple of years now (referred herein as "original instance"). Works like a charm.

I wanted to migrate the site to the new (cheaper) t2.micro instance. I couldn't find any step by step instructions for how to do this, but took note of this and this.

My basic approach was

  1. Create snapshots of the two volumes (root and a data drive for the postgresql data) used by the original instance
  2. Create a new HVM AMI from the root and data snapshots just taken (ELASTIC BLOCK STORE > Snapshots > select original instance root snaphot > Actions > Create Image), with
    • Architecture = x86_64, same as the original instance
    • Root device and data volume device names = same as the original instance
    • Virtualization type = Hardware-assisted virtualization (HVM, for compatibility with the new t2 VM format)
    • Kernel ID = "Use default" (I tried to used the same Kernel ID as the original instance, but the AMI create failed saying it couldn't use that for a HVM AMI)
  3. Create and launch a new instance with the AMI just created at step 2

Problem: upon starting this new instance, it shuts down immediately with a Client.InstanceInitiatedShutdown error. How can I troubleshoot this?

Am I naive to think I can use a root snapshot that works in a PVM environment in an HVM environment? Is there an easier way to migrate from t1 to t2?

I'm hoping not to have to re-build my server in t2 from scratch and migrate data manually (I didn't use any automated build scripts).

Edit: I ended up rebuilding the t2 instance from scratch 😛

Best Answer

I was going from HVM to PV and noticing the same issue. It turned out that I (my automation) was still attaching block storage to /dev/sda1, what I needed for my HVM AMI, but needed to attached it to /dev/xvda.

Related Topic