From 1b7445a6e2a17c99345d41efdaf80f89949c6c81 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 14 Dec 2015 15:44:08 +0100 Subject: [PATCH] Use SSD as default volume type. General purpose SSD ('gp2') volume type is just slighly more expensive than Magnetic ('standard' / default in AWS), while the performance gain is pretty significant. So far, the volumes were created only during testing, where the extra cost won't make any difference. In future, we plan to introduce QoS classes, where users could choose SSD/Magnetic depending on their use cases. 'gp2' is just the default volume type for (hopefuly) short period before these QoS classes are implemented. --- pkg/cloudprovider/providers/aws/aws.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 9495257f3a0..986592b8265 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -58,6 +58,11 @@ const TagNameKubernetesCluster = "KubernetesCluster" // MaxReadThenCreateRetries sets the maximum number of attempts we will make const MaxReadThenCreateRetries = 30 +// Default volume type for newly created Volumes +// TODO: Remove when user/admin can configure volume types and thus we don't +// need hardcoded defaults. +const DefaultVolumeType = "gp2" + // Abstraction over AWS, to allow mocking/other implementations type AWSServices interface { Compute(region string) (EC2, error) @@ -1219,12 +1224,12 @@ func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { // Implements Volumes.CreateVolume func (s *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error) { // TODO: Should we tag this with the cluster id (so it gets deleted when the cluster does?) - // This is only used for testing right now request := &ec2.CreateVolumeInput{} request.AvailabilityZone = &s.availabilityZone volSize := int64(volumeOptions.CapacityGB) request.Size = &volSize + request.VolumeType = aws.String(DefaultVolumeType) response, err := s.ec2.CreateVolume(request) if err != nil { return "", err