Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EXAMPLES:
scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-111111111111

Import a QCOW file as an Instance snapshot
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=b_ssd bucket=my-bucket key=my-qcow2-file-name
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=l_ssd bucket=my-bucket key=my-qcow2-file-name

ARGS:
[name=<generated>] Name of the snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.

A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`).
Volumes can be created from snapshots of their own type.

USAGE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@ EXAMPLES:
List all volumes
scw instance volume list

List all block storage volumes
scw instance volume list volume-type=b_ssd

List all local storage volumes
scw instance volume list volume-type=l_ssd

List all volumes that match a name
scw instance volume list name=foobar

List all block storage volumes that match a name
scw instance volume list volume-type=b_ssd name=foobar

ARGS:
[volume-type] Filter by volume type (l_ssd | b_ssd | unified | scratch | sbs_volume | sbs_snapshot)
[project-id] Filter volume by Project ID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). Any volume name can be changed, however only `b_ssd` volumes can currently be increased in size.
Replace the name and/or size properties of a volume specified by its ID, with the specified value(s).

USAGE:
scw instance volume update <volume-id ...> [arg=value ...]
Expand Down
14 changes: 3 additions & 11 deletions cmd/scw/testdata/test-all-usage-instance-volume-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ A volume is where you store your data inside your Instance. It
appears as a block device on Linux that you can use to create
a filesystem and mount it.

Two different types of volume (`volume_type`) are available:
- `l_ssd` is a local block storage: your data is downloaded on
the hypervisor and you need to power off your Instance to attach
or detach a volume.
- `b_ssd` is a remote block storage: your data is stored on a
centralized cluster. You can plug and unplug a volume while
your Instance is running.
The Instance API only supports local (`l_ssd`) and `scratch` volume types.
Block storage volumes can also be attached to Instances, these volumes are
managed by the SBS API (https://www.scaleway.com/en/developers/api/block/).

Minimum and maximum volume sizes for each volume types can be queried
from the zone `/products/volumes` API endpoint. _I.e_ for:
Expand All @@ -21,10 +17,6 @@ Each type of volume is also subject to a global quota for the sum of all the
volumes. This quota depends of the level of support and may be
changed on demand.

Be wary that when terminating an Instance, if you want to keep
your block storage volume, **you must** detach it before you
issue the `terminate` call.

When using multiple block devices, it's advised to mount them by
using their UUID instead of their device name. A device name is
subject to change depending on the volumes order. Block devices
Expand Down
34 changes: 5 additions & 29 deletions docs/commands/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,6 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.

A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`).
Volumes can be created from snapshots of their own type.


Expand Down Expand Up @@ -2559,7 +2558,7 @@ scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-11111

Import a QCOW file as an Instance snapshot
```
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=b_ssd bucket=my-bucket key=my-qcow2-file-name
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=l_ssd bucket=my-bucket key=my-qcow2-file-name
```


Expand Down Expand Up @@ -3010,13 +3009,9 @@ A volume is where you store your data inside your Instance. It
appears as a block device on Linux that you can use to create
a filesystem and mount it.

Two different types of volume (`volume_type`) are available:
- `l_ssd` is a local block storage: your data is downloaded on
the hypervisor and you need to power off your Instance to attach
or detach a volume.
- `b_ssd` is a remote block storage: your data is stored on a
centralized cluster. You can plug and unplug a volume while
your Instance is running.
The Instance API only supports local (`l_ssd`) and `scratch` volume types.
Block storage volumes can also be attached to Instances, these volumes are
managed by the SBS API (https://www.scaleway.com/en/developers/api/block/).

Minimum and maximum volume sizes for each volume types can be queried
from the zone `/products/volumes` API endpoint. _I.e_ for:
Expand All @@ -3027,10 +3022,6 @@ Each type of volume is also subject to a global quota for the sum of all the
volumes. This quota depends of the level of support and may be
changed on demand.

Be wary that when terminating an Instance, if you want to keep
your block storage volume, **you must** detach it before you
issue the `terminate` call.

When using multiple block devices, it's advised to mount them by
using their UUID instead of their device name. A device name is
subject to change depending on the volumes order. Block devices
Expand Down Expand Up @@ -3190,26 +3181,11 @@ List all volumes
scw instance volume list
```

List all block storage volumes
```
scw instance volume list volume-type=b_ssd
```

List all local storage volumes
```
scw instance volume list volume-type=l_ssd
```

List all volumes that match a name
```
scw instance volume list name=foobar
```

List all block storage volumes that match a name
```
scw instance volume list volume-type=b_ssd name=foobar
```




Expand Down Expand Up @@ -3239,7 +3215,7 @@ scw instance volume plan-migration <volume-id ...> [arg=value ...]

### Update a volume

Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). Any volume name can be changed, however only `b_ssd` volumes can currently be increased in size.
Replace the name and/or size properties of a volume specified by its ID, with the specified value(s).

**Usage:**

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250612160241-cb8e35ad61c5
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666 h1:NYaPksM7wPC69Fe9VCUoYY8GYB1hplR6s5hO2PA9rSQ=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250612160241-cb8e35ad61c5 h1:c13eCwQV4J6zi5v43Xd2c2xwbkfUU8t1zxstAt6picQ=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250612160241-cb8e35ad61c5/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
31 changes: 5 additions & 26 deletions internal/namespaces/instance/v1/instance_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.

A snapshot's volume type is its original volume's type (` + "`" + `l_ssd` + "`" + ` or ` + "`" + `b_ssd` + "`" + `).
Volumes can be created from snapshots of their own type.`,
Namespace: "instance",
Resource: "snapshot",
Expand Down Expand Up @@ -243,13 +242,9 @@ func instanceVolume() *core.Command {
appears as a block device on Linux that you can use to create
a filesystem and mount it.

Two different types of volume (` + "`" + `volume_type` + "`" + `) are available:
- ` + "`" + `l_ssd` + "`" + ` is a local block storage: your data is downloaded on
the hypervisor and you need to power off your Instance to attach
or detach a volume.
- ` + "`" + `b_ssd` + "`" + ` is a remote block storage: your data is stored on a
centralized cluster. You can plug and unplug a volume while
your Instance is running.
The Instance API only supports local (` + "`" + `l_ssd` + "`" + `) and ` + "`" + `scratch` + "`" + ` volume types.
Block storage volumes can also be attached to Instances, these volumes are
managed by the SBS API (https://www.scaleway.com/en/developers/api/block/).

Minimum and maximum volume sizes for each volume types can be queried
from the zone ` + "`" + `/products/volumes` + "`" + ` API endpoint. _I.e_ for:
Expand All @@ -260,10 +255,6 @@ Each type of volume is also subject to a global quota for the sum of all the
volumes. This quota depends of the level of support and may be
changed on demand.

Be wary that when terminating an Instance, if you want to keep
your block storage volume, **you must** detach it before you
issue the ` + "`" + `terminate` + "`" + ` call.

When using multiple block devices, it's advised to mount them by
using their UUID instead of their device name. A device name is
subject to change depending on the volumes order. Block devices
Expand Down Expand Up @@ -1837,7 +1828,7 @@ func instanceSnapshotCreate() *core.Command {
},
{
Short: "Import a QCOW file as an Instance snapshot",
ArgsJSON: `{"bucket":"my-bucket","key":"my-qcow2-file-name","name":"my-imported-snapshot","volume_type":"b_ssd","zone":"fr-par-1"}`,
ArgsJSON: `{"bucket":"my-bucket","key":"my-qcow2-file-name","name":"my-imported-snapshot","volume_type":"l_ssd","zone":"fr-par-1"}`,
},
},
}
Expand Down Expand Up @@ -2152,22 +2143,10 @@ func instanceVolumeList() *core.Command {
Short: "List all volumes",
ArgsJSON: `null`,
},
{
Short: "List all block storage volumes",
ArgsJSON: `{"volume_type":"b_ssd"}`,
},
{
Short: "List all local storage volumes",
ArgsJSON: `{"volume_type":"l_ssd"}`,
},
{
Short: "List all volumes that match a name",
ArgsJSON: `{"name":"foobar"}`,
},
{
Short: "List all block storage volumes that match a name",
ArgsJSON: `{"name":"foobar","volume_type":"b_ssd"}`,
},
},
View: &core.View{Fields: []*core.ViewField{
{
Expand Down Expand Up @@ -2348,7 +2327,7 @@ func instanceVolumeGet() *core.Command {
func instanceVolumeUpdate() *core.Command {
return &core.Command{
Short: `Update a volume`,
Long: `Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). Any volume name can be changed, however only ` + "`" + `b_ssd` + "`" + ` volumes can currently be increased in size.`,
Long: `Replace the name and/or size properties of a volume specified by its ID, with the specified value(s).`,
Namespace: "instance",
Resource: "volume",
Verb: "update",
Expand Down
Loading