func LoadVolumeClass(name string) (VolumeClass, error) {
	cfgs := make(VolumeClasses)
	item, err := GetItemByName("volumes", name)
	if err != nil {
		return cfgs[name], err
	}
	cfgs.Marshal([]*simpledb.Item{item})
	return cfgs[name], nil
}
LoadVolumeClass loads a Volume Class by its name
package config
import (
	"encoding/json"
	"strconv"
	"strings"
	"github.com/aws/aws-sdk-go/service/simpledb"
)
type VolumeClasses map[string]VolumeClass
type VolumeClass struct {
	DeviceName          string `json:"deviceName" awsmClass:"Device Name"`
	VolumeSize          int    `json:"volumeSize" awsmClass:"Volume Size"`
	DeleteOnTermination bool   `json:"deleteOnTermination" awsmClass:"Delete On Termination"`
	MountPoint          string `json:"mountPoint" awsmClass:"Mount Point"`
	Snapshot            string `json:"snapshot" awsmClass:"Snapshot"`
	VolumeType          string `json:"volumeType" awsmClass:"Volume Type"`
	Iops                int    `json:"iops" awsmClass:"IOPS"`
	Encrypted           bool   `json:"encrypted" awsmClass:"Encrypted"`
	AttachCommand       string `json:"attachCommand"`
	DetachCommand       string `json:"detachCommand"`
}
func DefaultVolumeClasses() VolumeClasses {
	defaultVolumes := make(VolumeClasses)
	defaultVolumes["code-init"] = VolumeClass{
		DeviceName:          "/dev/xvdf",
		VolumeSize:          30,
		DeleteOnTermination: true,
		MountPoint:          "/media/code",
		Encrypted:           true,
		Snapshot:            "",  
		VolumeType:          "standard",
	}
	defaultVolumes["code"] = VolumeClass{
		DeviceName:          "/dev/xvdf",
		VolumeSize:          30,
		DeleteOnTermination: true,
		MountPoint:          "/media/code",
		Encrypted:           true,
		Snapshot:            "code",
		VolumeType:          "standard",
	}
	defaultVolumes["mysql-data"] = VolumeClass{
		DeviceName:          "/dev/xvdh",
		VolumeSize:          100,
		DeleteOnTermination: true,
		MountPoint:          "/media/mysql-data",
		Encrypted:           false,
		Snapshot:            "mysql-data",
		VolumeType:          "standard",
	}
	return defaultVolumes
}
func SaveVolumeClass(className string, data []byte) (class VolumeClass, err error) {
	err = json.Unmarshal(data, &class)
	if err != nil {
		return
	}
	if class.VolumeType != "io1" {
		class.Iops = 0
	}
	err = Insert("volumes", VolumeClasses{className: class})
	return
}