Disk Image - Restore To Amazon AWS

Creating a Virtual Machine in the AWS cloud from a Magnus Box Disk Image Backup

All example commands executed in Windows Powershell


You will need:

<code>A future version of Magnus Box will automate many of the following steps.


Perform restore in Magnus Box to create VMDK files

  • Note: The restored files will be the same size as the original disk size, so ensure you have enough space in your restore location.

  • Produces files as shown below

Concatenate Individual Files

  • To restore all partitions of a particular drive, the individual image files must be combined. Do not include 1 KB disk.vmdk since it does not contain necessary binary information.
    • To combine files on Windows:  cmd /c copy /b .\disk_f0000.vmdk+.\disk_f0001.vmdk+.\disk_f0002.vmdk diskname.vmdk
    • To combine files on Linux or Mac: cat disk_f0000.vmdk disk_f0001.vmdk disk_f0002.vmdk > diskname.vmdk
    • Note: These are only example commands and may differ if more or less partitions exist
  • After combining, the following file should be present:

Upload the VMDK file to the AWS folder

  • Example command: aws s3 cp .\diskname.vmdk s3://bucketname/subfolder/
  • Verify the contents of the storage folder: aws s3 ls bucketname/subfolder/
  • (note the trailing '/')
  • Create a local file.json file for importing the image into AWS Example:

Run the AWS import-image command with file.json as parameter

  • Example command: aws ec2 import-image --region <yourregionname> --disk-containers "file://C:\path\to\file.json"
  • Initial response similar to:

Note the 'ImportTaskId' in the form of: “import-ami-XXXX”

  • Example command to show ongoing progress: aws ec2 describe-import-image-tasks --import-task-ids import-ami-XXXX --region <yourregionname>
  • Ongoing progress similar to:

When the command to show ongoing progress returns “Status”: “completed”, note down the AMI ID

Connect via RDP

  • Log in to AWS website
  • Select ‘Services’ drop-down
  • Select ‘EC2’

  • Select 'AMIs'
  • Tick to select the AMI ID from the previous step
  • Actions
  • Launch

  • Configure and launch

  • Select the launched instance
  • Select Connect
  • Download remote connection details
  • Use your preferred Remote Desktop program to connect using the downloaded details
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us