V2V an AWS EC2 to … Vmware?

02/08/2017

Well why not, its just a VM running on Xen?

SO we know how awesome AWS is and the value it brings to the table – but what (for whatever reason, you wanted to bring a workload out of AWS and back into On Prem (Vmware for example)?

AWS (Jeff Barr, who else – legend) – wrote up an example of the CLI based export tool. You can find that here and here – at the time of writing – it would only do one volume. Most of the server architecture I work with has more than one volume, so its a bit of a limitation.

Having done P2V, V2V, V2P, P2P and christ knows what else for 10+ years, why should this shit be any different. News flash – it aint. Heres my 2 bob on how to get a W2K12 EC2 back on prem :

PS : if you want the AWS CLI for Windows its here
PPS : if you use the browser on your server to copy files, its WAY SLOW. Use the CLI. Friends don’t let friends use a browser 😉
PPPS : When you use the AWS CLI, make sure you have run aws configure and are pointing to the account you want to work in (or specify a profile)

Vmware Converter

  • Download a version of VM converter. If you are anything like me you have them all. I used 5.5.3-2183569 in this use case.
  • Create an S3 bucket to hold new V2V image of the server
  • Copy VMware-converter-en-5.5.3-2183569.exe to the s3 bucket; – if you have the CLI, then
aws s3 cp VMware-converter-en-5.5.3-2183569.exe s3://mybucket/VMware-converter-en-5.5.3-2183569.exe
  • On the server, open the AWS CLI and aws cp from the s3 bucket the converter exe;
aws s3 cp s3://mybucket/VMware-converter-en-5.5.3-2183569.exe
  • OR Use IE with Security off to DL converter exe from S3 bucket – slow
  • Rename the file to .exe as it will prolly have [1] on the end / is munged by the copy if you used a browser
  • Install converter locally onto the machine

Add a Volume to the EC2 Instance

You need a volume on the EC2 instance you’re going to image to store the image files created by Converter…..get the idea now?
Working in the AWS Console,

  • Select EC2 – take note of the EC2 instance id of what you are going to import and its AZ
  • In EC2 / Select Volumes
  • Select Create Volume,
  • Ensure its in the SAME AZ as your EC2, don’t encrypt it, Select Create
  • Locate the Volume created (you may need to refresh)
  • Right click – Select Attach Volume
  • Enter the instance id in the Instance section
  • Accept device it adds (xvdf in my case)
  • Click Attach

Mount the new volume to the OS

  • Login to the OS as Administrator
  • Start/Run/diskmgmt.msc
  • Right Click on Disk 1, Select Online
  • Right Click/Initialise Disk
  • Create a New Simple Volume – Quick Format
  • Ensure OS can see new drive (as D:\ for example)

Run the Conversion process

Pretty simple if you’ve done this before, we’re just converting to an image file, nothing special here. Use Workstation 8 as the destination type – I’ve had the most success with this in recent times.

  • Right Click on VMware converter – RUN as Administrator
  • Select Convert Machine from the top,
  • Select Local Machine, click Next
  • Select the Destination type as Vmware Workstation
  • Select Workstation 8 (compatibility works OK up to W2K12)
  • Select D:\ drive for Destination, Select Next
  • Review the conversion process, make changes, exclude any drives (like the one you are copying the image files to), click Next
  • Click Finish
  • Wait for it to complete
  • Close convertor
  • Confirm your VMDK and VMX files are on the D:\ drive (or wherever)

Upload Files to S3

  • On the server where you just performed the v2v, open the AWS CLI and aws cp from the server to the s3 bucket the VMDK and VMX files
  • OR use the browser to copy VMDK files and vmx files to S3 bucket – the browser is VERY slow, but, the CLI is not.

Import to Vmware

Almost there! To do this set of steps, I have a machine not domain joined (w2k3 ironically) with Vmware Converter install on it.

  • Copy the files from S3 down to a local machine. I normally copy them to a converter machine with large disks on it and stream them in to VC from there.  Do this by using the CLI ; eg ;
aws s3 cp s3://mybucket . --recursive
  • OR use the browser (slow)
  • Open Vmware converter
  • Import the VM from the files
  • Select source as Vmware Workstation or other VMware virtual machine
  • Browse to drive and location of Vmware files, find the VMX file, select Open
  • Select Next
  • Set your Destination Type to Vmware Virtual Machine
  • Enter details of vCenter and userID/password, Click Next
  • Give the machine a friendly name, and select a folder for it to go in, select Next,
  • Select a Host, Datastore and VM version (I used version 10) and click Next
  • Select Edit /Change Disks – change from thick to thin,
  • Select Advanced and uncheck ‘Reconfigure destination virtual machine’, select Yes when prompted, click Next
  • Click Finish
  • Wait
  • Ensure converter imports successfully

Cleanup

  • Check the machine settings, edit settings and move the memory to a rounded amount (and not the AWS setting) and change vCPU if needed.
  • Remove any un-necessary devices
  • Change NIC to VMXNET3
  • Logon to machine w/Admin rights
  • Install Vmware tools, reboot
  • Re-IP machine
  • Working in Add/Remove Programs, Remove all AWS tools, PVM drivers, bootstrap, SSM Agent etc
  • Reboot and confirm machine OK
  • Remediate any application IP specific requirements where applicable
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s