Increase disk size for an EC2 instance in AWS

While using Amazon Web Services (AWS) you may find that, when using one of the Amazon Machine Images (AMIs) provided, you may run out of disk space. There does not appear to be any way to “resize” an Elastic Block Store (EBS) volume; however, you can create a new one based on an existing snapshot and replace the current drive with a larger one. I have provided the instructions for doing so below.

  1. Log into the AWS Management Console
  2. Make sure that the Instance that you wish to change is not currently running
  3. Navigate to Elastic Block Store > Volumes
  4. Check the box next to the Volume that needs more space
  5. Click the More… drop down list and select Create Snapshot
  6. Enter a Name and a Description
  7. Navigate to Elastic Block Store> Snapshots
  8. Monitor the progress of the Snapshot for completion
  9. Once complete, navigate back to Elastic Block Store > Volumes
  10. Click Create Volume
  11. Enter the desired size for the new volume
  12. Make sure that you select the same Availability Zone for your instance
  13. Select the Snapshot that you just created
  14. Click Yes, Create
  15. Monitor the progress of the Volume for completion
  16. Once complete, Check the box next to the Volume that is currently connected to the Instance
  17. Make sure that no other Volumes are selected
  18. Click the More… drop down list and select Click the More… drop down list and select Detach Volume
  19. Uncheck the box selected and check the box next to the new Volume
  20. Click the More… drop down list and select Click the More… drop down list and select Attach Volume
  21. Select the Instance that you wish to change
  22. Change the value in Device from xvdf  to /dev/sda1
  23. Click Yes, Attach
  24. Navigate to Instances and start your Instance
  25. Once you are satisfied that the volume works, feel free to delete the Snapshot and old Volume if you like

You will need to take additional steps to extend the size of your partition to use the rest of the allocated space. The process for doing so will vary depending on the operating system that you are using.

Using Powershell to export & import farm solutions

Here is a handy script that will export all farm solution .wsp and .cab files at once:

[sourcecode language=”powershell”]
Add-PSSnapin Microsoft.SharePoint.PowerShell
$farm = Get-SPFarm
$farm.Solutions | ForEach-Object{$_.SolutionFile.SaveAs(“c:\export\” + $}

Once you have moved the solutions to another machine, you can use the following script to add the solutions to the new farm:

Add-PSSnapin Microsoft.SharePoint.PowerShell
$files = Get-ChildItem “c:\install\”
ForEach ($file in $files) {Add-SPSolution $file.FullName}

Migrating a VMware VM to AWS

This document describes the steps necessary to migrate a VMWare virtual machine (.vmx and accompanying .vmdk) to the Amazon Web Services (AWS) cloud.

Setting up AWS Command Line Tools

There are many actions in AWS that can only be completed by using the AWS command line tools. This section describes the steps necessary to set up these tools (Evens, 2009).

Install Java

Download and install Java if you do not already have it:

Download APIs

  1. EC2 Command line tools:
  2. Elastic Load Balancing tools:

It is a good idea to pick somewhere to place all of your command line related items; for example: C:\AWS. Unzip both archives into this folder.

Get your AWS Certificates

  1. Go to
  2. Log in
  3. Scroll down to the X.509 section
  4. Create a new certificate (if one does not exist)
  5. Download the Private Key File (pk-.pem) and store in AWS directory
  6. Download the Certificate File (cert-.pem) and store in AWS directory
  7. KEEP THESE FILES PROTECTED – they provide access to your AWS account

Configure Environment Variables

Create a batch file in your AWS directory awsTools.bat and add the following text:
[sourcecode language=”plain”]
SET JAVA_HOME=”C:\Program Files (x86)\java\jre6″
SET EC2_PRIVATE_KEY=c:\aws\aws-pk.pem
SET EC2_CERT=c:\aws\aws-cer.pem
SET EC2_HOME=c:\aws\ec2\ec2-api-tools-
SET AWS_ELB_HOME=D:\aws\ElasticLoadBalancing-
JAVA_HOME will need to be set to the appropriate path for your machine. Find java.exe (it will be a in a folder called bin) and set JAVA_HOME to the parent directory of bin. For example with java.exe at “C:\Program Files (x86)\java\jre6\bin\java.exe” set JAVA_HOME to “C:\Program Files (x86)\java\jre6”.

EC2_HOME and AWS_ELB_HOME both point to the folders you unzipped the APIs into.

Test Command

If you run awsTools.bat you should have a command prompt that you can run the EC2 tools from.
Type ec2-describe-regions at the command prompt
Your results should look something like the following:

REGION eu-west-1
REGION us-east-1

If you get an error or nothing is returned, check your configuration.

Setting Up Your VMware Image

There are several changes that should be made (if needed) to your VMware image before it is converted and uploaded to AWS.

  1. Remove all snapshots – remove any snapshots that you may have. If you do not want to remove snapshots, create a copy of your .vmdk and create a new VMware image that points to it.
  2. Partition must be IDE – If you have any SCSI Devices, you should convert them to IDE. You may want to use a third party tool to do this such as Acronis.
  3. Uninstall VMware tools- if you have installed the VMWare tools, remove them.
  4. Enable Remote Desktop Access – you will want to enable remote desktop connections and make sure that they are permitted through the firewall (if enabled).

Convert VM to OVF

OVF (Open Virtual Format) is a universal virtual machine format that is used for distribution across organizations and products. You must convert your VMware image to this format so that AWS can convert it to its virtualization format. This process may take several hours depending on the size of the image.

    1. Download the too from:
    2. Open a command line with administrator privileges
    3. Example Syntax:
      ovftool “C:\Virtual Machines\Windows Server 2008 x64.vmx” “C:\Virtual Machines\Windows Server 2008 x64.ovf”

Import to AWS, Setup & Connect

Once the VM has been converted to OVF format, it is ready to be imported to AWS.

  1. Open awsTools.bat
  2. Get Access Key and Secret Access Key from AWS: My Account / Console > Security Credentials
  3. Create Import instance using ec2-import-instance
    1. Example Syntax:
      ec2—import—instance “C:\Documents\Virtual Machines\Windows Server 2008 x64—disk1.vmdk” -f vmdk -t ml.large —a x86_64 —o XXXXXXXXXXXXXXXXXXXX —w XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX —b my_bucket
    2. b. -o = Access Key
    3. c. -w = Secret Access Key
    4. d. -t = Instance Types (see
  4. Wait until the Instance is uploaded and converted
    1. Use ec2-describe-conversion-tasks to check status
  5.  Start Instance
  6. Open up RDP port (3389) using the AWS Security Group inbound rules
  7. Obtain an Elastic IP from AWS
  8. Under Network Interfaces in AWS, assign Elastic IP to the network interface that belongs to the instance
  9. Connect via RDP using Elastic IP address


Evens, S. (May 19, 2009). Setting up EC2 command line tools on Windows. Retrieved March 20, 2012 from

matiasimc. (June 21, 2011). Re: VMWare Workstation VM import Windows 2008 R2 failing. Retrieved March 29, 2012, from

VMware. (May 21, 20009). VMware OVF Tool. Retrieved March 29, 2012, from