Creating and Managing AWS Snapshots in Powershell

Creating a snapshot of an Amazon Web Services EBS volume is a simple method to back up your AWS instances. For more details on AWS snapshots make sure to read this.

Below is a Powershell script I modified to

  • Create a snapshot of all EBS volumes tagged with “AWSBackupEnabled”=True
  • Tag new snapshots with the backup date (tag=BackupDate) and “AWSBackupEnabled”=True
  • Delete snapshots older than 14 days
  • Write results to a log file
  • Send an email with the log to notify the administrator(s) that the backup has completed.

The critical difference between this script and the original found here is the use of Amazon.EC2.Model.Filter, which is used to identify the assets you are working with. Somehow I could not get this code to work

so I modified it slightly

Here is the script:

 

 

Sharepoint Foundation 2010 on Amazon EC2

Amazon EC2 is a great environment when you need to set up a test server. You can do it in a matter of minutes! And, as long as you turn off the server when it is not in use, it is super cheap. But there are some gotchas.

Case in point: I recently used EC2 to set up a Sharepoint Foundation 2010 test server for a Client. All went well until I shut down the server and then the next day I started up and ran Sharepoint Products Configuration Wizard and it threw and exception similar to this one:

04/19/2011 10:38:35  13  ERR                Task adminvs has failed with an unknown exception
04/19/2011 10:38:35  13  ERR                Exception: System.IO.FileNotFoundException: Could not find file ‘C:\inetpub\wwwroot\wss\VirtualDirectories\42539\web.config’.

The solution was quite simple.

  1. If you already installed and the error above was thrown, uninstall Sharepoint Foundation 2010
  2. Open config.xml in C:\Program Files\Amazon\Ec2ConfigService\Settings
  3. Change tag <State> from “Enabled” to “Disabled”
    <Name>Ec2SetComputerName</Name>
    <State>Disabled</State>
    </Plugin>
  4. Change the computer name
  5. Reboot
  6. Install Sharepoint Foundation 2010