diff --git a/api/holodeck/v1alpha1/types.go b/api/holodeck/v1alpha1/types.go index 081e0928d..0a9e695e8 100644 --- a/api/holodeck/v1alpha1/types.go +++ b/api/holodeck/v1alpha1/types.go @@ -68,6 +68,9 @@ type Instance struct { IngressIpRanges []string `json:"ingressIpRanges"` // +optional HostUrl string `json:"hostUrl"` + // +optional + // if not set, the default size is 64GB + RootVolumeSizeGB *int32 `json:"rootVolumeSizeGB"` } // Describes an image or vm template. diff --git a/api/holodeck/v1alpha1/zz_generated.deepcopy.go b/api/holodeck/v1alpha1/zz_generated.deepcopy.go index d84e431f2..5fbe04519 100644 --- a/api/holodeck/v1alpha1/zz_generated.deepcopy.go +++ b/api/holodeck/v1alpha1/zz_generated.deepcopy.go @@ -232,6 +232,11 @@ func (in *Instance) DeepCopyInto(out *Instance) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.RootVolumeSizeGB != nil { + in, out := &in.RootVolumeSizeGB, &out.RootVolumeSizeGB + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance. diff --git a/pkg/provider/aws/create.go b/pkg/provider/aws/create.go index 289585bc1..116469002 100644 --- a/pkg/provider/aws/create.go +++ b/pkg/provider/aws/create.go @@ -320,6 +320,11 @@ func (p *Provider) createEC2Instance(cache *AWS) error { return fmt.Errorf("error getting AMI: %w", err) } + // if the root volume size is not set, use the default size + if p.Spec.RootVolumeSizeGB != nil { + storageSizeGB = *p.Spec.RootVolumeSizeGB + } + instanceIn := &ec2.RunInstancesInput{ ImageId: p.Spec.Image.ImageId, InstanceType: types.InstanceType(p.Spec.Type),