Skip to content

fix(compute): adjust default disk size to template - #882

Draft
natalie-o-perret wants to merge 1 commit into
masterfrom
fix/template-disk-size-default
Draft

fix(compute): adjust default disk size to template#882
natalie-o-perret wants to merge 1 commit into
masterfrom
fix/template-disk-size-default

Conversation

@natalie-o-perret

@natalie-o-perret natalie-o-perret commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

compute instance create and compute instance-pool create default to a 50 GiB disk, but some templates require a larger disk. Using such a template without --disk-size currently sends an invalid request.

This change resolves the selected template before creation and:

  • keeps the requested disk size when it is large enough;
  • increases the implicit 50 GiB default to the template size, rounded up to GiB, and prints a warning;
  • rejects an explicitly configured disk size that is too small, preserving the user's requested value and returning an actionable error.

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block, and add the Pull Request #number for each bit you add to the CHANGELOG.md)
  • Testing

Testing

Tested from PR head in ch-dk-2 with a 10 GiB Ubuntu template and an 80 GiB Anapaya template. All instances, pools, and temporary SSH keys created for these checks were deleted afterward.

Default already large enough

The 50 GiB default is preserved without a warning for a 10 GiB template.

$ ./bin/exo compute instance create --zone ch-dk-2 \
    --instance-type standard.tiny \
    --template 5b473841-fd33-4b88-bcfe-a776abf15034 \
    pr882-instance-default-small-20260803

Creating instance "pr882-instance-default-small-20260803"... 36s

| Name      | pr882-instance-default-small-20260803 |
| Template  | Linux Ubuntu 22.04 LTS 64-bit         |
| Disk Size | 50 GiB                                |
| State     | running                               |

Default increased to template size

The implicit 50 GiB default is increased to 80 GiB and the adjustment is reported on stderr.

$ ./bin/exo compute instance create --zone ch-dk-2 \
    --template 774dd37a-287c-40f0-9e66-343e7b9c9bff \
    pr882-instance-default-large-20260803

warning: template "Anapaya Appliance v0.41.1-1" requires at least 80 GiB; increasing the default disk size from 50 GiB to 80 GiB
Creating instance "pr882-instance-default-large-20260803"... 1m31s

| Name      | pr882-instance-default-large-20260803 |
| Template  | Anapaya Appliance v0.41.1-1           |
| Disk Size | 80 GiB                                |
| State     | running                               |

Explicit sufficient size preserved

An explicit size that can contain the template is used unchanged.

$ ./bin/exo compute instance create --zone ch-dk-2 \
    --instance-type standard.tiny \
    --disk-size 20 \
    --template 5b473841-fd33-4b88-bcfe-a776abf15034 \
    pr882-instance-explicit-valid-20260803

Creating instance "pr882-instance-explicit-valid-20260803"... 21s

| Name      | pr882-instance-explicit-valid-20260803 |
| Template  | Linux Ubuntu 22.04 LTS 64-bit          |
| Disk Size | 20 GiB                                 |
| State     | running                                |

Explicit undersized value rejected

An explicit value smaller than the selected template fails before creating a resource.

$ ./bin/exo compute instance create --zone ch-dk-2 \
    --disk-size 50 \
    --template 774dd37a-287c-40f0-9e66-343e7b9c9bff \
    pr882-instance-explicit-small-20260803

error: --disk-size 50 GiB is smaller than the selected template's minimum of 80 GiB; use --disk-size 80 or larger

The instance-pool command returns the same error before creation:

$ ./bin/exo compute instance-pool create --zone ch-dk-2 \
    --disk-size 50 \
    --template 774dd37a-287c-40f0-9e66-343e7b9c9bff \
    pr882-pool-explicit-small-20260803

error: --disk-size 50 GiB is smaller than the selected template's minimum of 80 GiB; use --disk-size 80 or larger

Instance Pool default increased

The same default adjustment is applied when creating an Instance Pool.

$ ./bin/exo compute instance-pool create --zone ch-dk-2 \
    --ssh-key pr882-pool-key-20260803 \
    --template 774dd37a-287c-40f0-9e66-343e7b9c9bff \
    pr882-pool-default-large-20260803

warning: template "Anapaya Appliance v0.41.1-1" requires at least 80 GiB; increasing the default disk size from 50 GiB to 80 GiB
Creating Instance Pool "pr882-pool-default-large-20260803"... 2m7s

| Name      | pr882-pool-default-large-20260803 |
| Template  | Anapaya Appliance v0.41.1-1       |
| Size      | 1                                 |
| Disk Size | 80 GiB                            |
| State     | running                           |

Note

AI assistance: test scaffolding, PR description.

@natalie-o-perret

Copy link
Copy Markdown
Contributor Author

[SC-186913]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant