Strategy for Migrating to Infrastructure as Code

There are several existing resources that document strategies for migrating infrastructure to code. This post is about my experiences based on the reality, the challenges and best practices.

The Setting

You’re in charge of the infrastructure that the entire organization relies upon. Your product is a 24/7 web application, service or destination. The internet property is secure and five nines of uptime is expected. During a meeting with Sr. Leadership, a directive comes down: “We’re moving to the cloud”.

A Daunting Task

As you absorb this information and prepare to brief your team, the relization of just how daunting the ask is. Holy shit, we have to convert all of our infrastructure. Where do we begin?

A Journey of a Thousand Miles

“A journey of a thousand miles, begins with a single step.”, -Lao Tzu

You’re obviously not moving your telephony or airgapped infra to the cloud. With that, the first thing to do is evaluate your current inventory and get a feel for what you have to do. You check your ITSM and determine you have 1,500 on-prem servers that need to move. Luckily, you were wise several years back and transitioned from bare metal to virtual machines. You whittled down your footprint to a couple of dozen hypervisors and a lot of virtual machines. Smart move. You think maybe this won’t be so bad, as you realize a challenge definitely still awaits.

Wisely, you had the foresight to name your hosts according to function and role many years ago. This enables you to group your hosts into logical types.

Digestible Chunks

Now that you’ve grouped your servers, you see that you have quite a few server groups that have several of hosts each. For example, one group, “web servers”, has 15 hosts in it. Doing some napkin math and grouping:

1,500 total VMs -> 160 groups / types: 20 web frontends here, 8 db servers there, an ElasticSearch cluster of X nodes, etc.

Things are starting to look manageable. You consider that you have a team of eight highly skilled and dedicated employees. 160 items to codify with a team of 8. This provides each staff member with 20 codified templates or state files that need to be created.

The Project

While you’re not a project manager by trade, you’re quite familiar with managing projects of significant size. You have a fleeting thought that if this were a rodent, it would be an unusual size - a digression from a movie you love. You refocus to the project. You take your grouped inventory and create a card for each in a Kanban board (Trello works great here). You allow the team to divy the workload amongst themselves, be it by consensus or delegation by the team lead. Any unassigned host types will be tackled collaboratively later on (depending on priorty).

( to be continued…)

Author

Chris Bergeron

Posted on

12-24-2020

Updated on

05-02-2021

Licensed under

Comments