Import Windows AWS EC2 image into vmware using VMDK - amazon-web-services

I have to backup a windows server 2008 32bit I have on aws ec2, to my on premise vmware infrastructure.
My objectif is to keep the .vmdk files aws provided me ( 2 disks ) and being able to restore the instance in my own infrastructure if needed.
I cannot use the aws ec2 create-instance-export-task because I have more than 1 disk, and do not match command requirements.
I have converted my ec2 to an AMI to use this command :
aws ec2 export-image --image-id ami-id --disk-image-format VMDK
I had to follow this process to restore the .vmdk from the -flat.vmdk aws provided.
https://www.settlersoman.com/how-to-recover-missing-vmx-and-vmdk-descriptor-file/
If I create a new VM with same CPU/Memory as my instance on AWS (t2.small), and then attach the .VMDK, i'm not able to make it boot. I tried with differents settings in vmware but nothing works.
I tried on VMWARE ESXI 6.0, VirtualBOx and vmware workstation.
Does anyone have a procedure to export a windows ec2 to an on premise hypervisor ( not using create-instance-export-task ) ?

It's been a few years since I have done this, it is possible. I used this software: https://www.vmware.com/products/converter.html
If I remember correctly I created an extra hard disk/volume, attached it to the ec2 instance and used that as the target to hold the VM the converter creates - then I uploaded the VM to S3 and pulled it down locally (and then got rid of that temporary volume). Worked like a charm.
BTW: The convertor software is free

Related

AWS EC2 - How to create a backup locally/file system

Is it possible to backup EC2 instance locally? (Not just the data , but the installations on Linux in EC2 as well)
I found number of options that would take data backup, but is there a way where we could backup fully functional Ec2 as is to local system? If not, can we download the image may be of EC2 locally which can be restored to same/another AWS environment when needed?
can we download the image may be of EC2 locally which can be restored to same/another AWS environment when needed?
for this the easiest solution would be this
got to instances under ec2 service in your account management console.
select the instance you wish to backup/copy.
select create image.
once image is created you can view it under ec2 navigation pane -> images-> ami.
to launch instance from the image, select and launch it.
could backup fully functional Ec2 as is to local system
the possible solution what i know and have tried to use export.Exporting as a VM is useful when you want to deploy a copy of an Amazon EC2 instance in your on-site virtualization environment. You can export most EC2 instances to Citrix Xen, Microsoft Hyper-V, or VMware vSphere.
your VM which is to be exported is stored in s3 so you will be charged according to s3 rates+ EBS snapshot charge

No changes to app after redeployment to EC2 instance

I've got development and production instances in EC2. I've been updating my app in Visual Studio 2019 and redeploying it to the dev instance, then creating an AMI of that instance and using that image to update the production instance(s).
Suddenly my app no longer updates when I deploy to the dev instance. The logs all show the update was applied, but when I look at the files on the server they have not changed for days. I suspect I may be using AMIs incorrectly, but I'm not sure what I'm doing wrong.
How do I get my updates to show again?
You are facing the issue because creating an AMI from running environment isn't the right approach since EB runs several scripts under the hood to attach instances to that particular environment.
Note: Custom AMIs are ideal only when you're installing a lot of dependencies or software that you want to be baked into your AMI so subsequent deployments go through quick. Here's the documentation that walks you through the steps, and here's the summary of the steps:
The best approach would be to launch a stand alone EC2 using an EB
AMI as base (ideally an AMI with HVM virtualization).
Connect to the instance with SSH or RDP.
Perform any customizations you want.
(Windows platforms) Run the EC2Config service Sysprep. For
information about EC2Config, see Configuring a Windows Instance Using
the EC2Config Service. Ensure that Sysprep is configured to generate
a random password that can be retrieved from the AWS Management
Console.
In the Amazon EC2 console, stop the EC2 instance. Then on the
Instance Actions menu, choose Create Image (EBS AMI).

Exporting aws instance into .VMDK file

I want to migrate aws instance to vmware. How can I export aws instance into .VMDK file so that I can import it in VMware.
I never did it but did you try the solution from AWS documentation
I have successfully used this tool:
https://my.vmware.com/web/vmware/info?slug=infrastructure_operations_management/vmware_vcenter_converter_standalone/6_2_0
to convert a running ec2 instance into a format that I could download and run locally in my vmware environment.
In my case it was a windows based ec2 instance with a single 'disk'. I added a second volume/disk to the machine that was big enough to hold the primary volume, and used the tool to make the image on that new disk.
I was then able to download it start it up locally.

Creating an iso of a RHEL instance

I have an amazon ec2 instance with RHEL 7.3 on it. I would like to convert this into an iso so that I can migrate it wherever I want. What are the best tools to create an iso of a virtual machine. Or how do I clone/backup this VM so that I can restore it anywhere I want?
You can work with VM and AWS programatically via AWS CLI commands.
You want to get familiar with import-task and export-task commands.
The best place to start is by reading an official AWS guides for:
Exporting an Instance as a VM Using VM Import/Export
Importing a VM as an Image Using VM Import/Export
The key information you need to pick up from the guide is this quote:
"You can't export an instance from Amazon EC2 unless you previously
imported it into Amazon EC2 from another virtualization environment."
Yes, there are solutions, one of them linked by #Nicholas Smith. That being said, if you go the unofficial route you might end up in a dark alley where help might not be available. I highly recommend and warn here to not proceed with trying to clone EC2 into VM at this point. You will spend a lot of time with a huge risk factor for future.
For you to be able to achieve what you want, you need to create a RHEL VM using any VM software, you need to load this VM into AWS and then you will be able to work with VM in AWS making any necessary changes and export again for local or transportation needs.
As you are running a widely-used Linux distribution - RHEL, you can attempt to recreate your EC2 environment manually by launching a VM that runs the same kernel version along with the same package versions. From there, you can tarball what files you need from your production instance and copy them over to your on-premise site by using SCP/SFTP.
Just get your RHEL environment into VM locally and import to AWS and you set.
Clonezilla provides functionality to create images. Generated images can be converted to ISO files.
It doesn't seem to be something that Amazon promote as a service however the aws cli tools have an ec2-unbundle command for extracting from an AMI. There's a guide here on how to download and run an EC2 AMI locally by using it.
Caveat is it appears the ec2-unbundle command currently only works on Linux and not OS X or Windows.

Limitations of Amazon Machine Image (AMI)

As Amazon Web Services mentions,
An Amazon Machine Image (AMI) is a special type of pre-configured
operating system and virtual application software which is used to
create a virtual machine within the Amazon Elastic Compute Cloud
(EC2). It serves as the basic unit of deployment for services
delivered using EC2.
So AMI is a kind of virtual machine which we can use as a server to host our applications. So my questions are,
What are the limitations in AMI with compared to a normal server?
Can we install any software in the AMI?
AMI is not any server running; it is like a "backup of your server" on hard disk. Using this back-up you can bring up running servers instantly.
Concept of Imaging server is used in all IT companies. Suppose an IT companies give Windows 7 to new joinees with few pre-installed software. So, instead of configuring the laptop for every joinee; they will create an image and will just dump that image on new laptop and give it to new joinee.
Same Image when created on Amazon Web services is called as AMI. AMI is just an image of any server... It is something like you firstly make your machine ready ( with any operating system and all the softwares you need on them ) and then create an image out of it which is called as AMI.
To answer your questions;
1. Not sure what limitations you are talking about; but as such there is no limitation.
2. Yes you can install any software. To make things clear; you can even install a virus on the server ; and then create an AMI.