Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute: Add Block Storage #574

Merged

Conversation

pierre-emmanuelJ
Copy link
Member

@pierre-emmanuelJ pierre-emmanuelJ commented Feb 14, 2024

Description

Add all the Block Storage integration into compute command exo compute block-storage.
Some misc has been added to outputer, to make better integration with our Exoscale API resources (egoscale v3).
Compute instance can create an instance with an attached block storage volume.

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing

Block Storage create

exo compute block-storage create test-volume --size 100
 ✔ Creating block storage volume "test-volume"... 3s
┼─────────────────────────┼──────────────────────────────────────┼
│  BLOCK STORAGE VOLUME   │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ Block Storage Snapshots │ n/a                                  │
│ Blocksize               │ 4096                                 │
│ Created AT              │ 2024-02-20 16:43:32 +0000 UTC        │
│ ID                      │ e429973e-c499-4f66-a64e-a22aa673c32b │
│ Instance                │ n/a                                  │
│ Labels                  │ n/a                                  │
│ Name                    │ test-volume                          │
│ Size                    │ 100 GiB                              │
│ State                   │ detached                             │
┼─────────────────────────┼──────────────────────────────────────┼

Block Storage list

exo compute block-storage list
┼──────────────────────────────────────┼──────────────────┼──────────┼─────────┼──────────┼
│                  ID                  │       NAME       │   ZONE   │  SIZE   │  STATE   │
┼──────────────────────────────────────┼──────────────────┼──────────┼─────────┼──────────┼
│ e429973e-c499-4f66-a64e-a22aa673c32b │ test-volume      │ ch-gva-2 │ 100 GiB │ detached │
│ d441b79f-96dd-453c-8e49-6fbb8781443b │ test-volume-prod │ ch-gva-2 │ 400 GiB │ detached │
┼──────────────────────────────────────┼──────────────────┼──────────┼─────────┼──────────┼

Block Storage attach

exo compute block-storage attach test-volume test-instance
 ✔ Attaching volume "test-volume" to instance "test-instance"... 3s

Block Storage Snapshot create

exo compute block-storage snapshot create test-volume
 ✔ Snapshoting block storage volume "test-volume"... 3s
┼───────────────────────────────┼──────────────────────────────────────┼
│ BLOCK STORAGE VOLUME SNAPSHOT │                                      │
┼───────────────────────────────┼──────────────────────────────────────┼
│ Created AT                    │ 2024-02-20 16:49:37 +0000 UTC        │
│ ID                            │ 448657be-9a2d-4f58-b15d-47f2216faadd │
│ Labels                        │ n/a                                  │
│ Volume                        │ e429973e-c499-4f66-a64e-a22aa673c32b │
│ Name                          │ test-volume_20240220164937           │
│ Size                          │ 0 B                                  │
│ State                         │ created                              │
┼───────────────────────────────┼──────────────────────────────────────┼

Block Storage Snapshot list

exo compute block-storage snapshot list
┼──────────────────────────────────────┼─────────────────────────────────┼──────────┼──────────────────────────────────────┼
│                  ID                  │              NAME               │   ZONE   │                VOLUME                │
┼──────────────────────────────────────┼─────────────────────────────────┼──────────┼──────────────────────────────────────┼
│ 45b75214-29b9-4e35-99f4-09d7777f96ab │ test-volume_20240220165017      │ ch-gva-2 │ e429973e-c499-4f66-a64e-a22aa673c32b │
│ 7058af47-51b7-4ce6-b0ba-f7ccdc6ce880 │ test-volume-prod_20240220165009 │ ch-gva-2 │ d441b79f-96dd-453c-8e49-6fbb8781443b │
│ 448657be-9a2d-4f58-b15d-47f2216faadd │ test-volume_20240220164937      │ ch-gva-2 │ e429973e-c499-4f66-a64e-a22aa673c32b │
┼──────────────────────────────────────┼─────────────────────────────────┼──────────┼──────────────────────────────────────┼

Block Storage Snapshot show

exo compute block-storage snapshot show test-volume_20240220165017
┼───────────────────────────────┼──────────────────────────────────────┼
│ BLOCK STORAGE VOLUME SNAPSHOT │                                      │
┼───────────────────────────────┼──────────────────────────────────────┼
│ Created AT                    │ 2024-02-20 16:50:17 +0000 UTC        │
│ ID                            │ 45b75214-29b9-4e35-99f4-09d7777f96ab │
│ Labels                        │ n/a                                  │
│ Volume                        │ e429973e-c499-4f66-a64e-a22aa673c32b │
│ Name                          │ test-volume_20240220165017           │
│ Size                          │ 0 B                                  │
│ State                         │ created                              │
┼───────────────────────────────┼──────────────────────────────────────┼

Block Storage show

exo compute block-storage show test-volume
┼─────────────────────────┼──────────────────────────────────────┼
│  BLOCK STORAGE VOLUME   │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ Block Storage Snapshots │ 45b75214-29b9-4e35-99f4-09d7777f96ab │
│                         │ 448657be-9a2d-4f58-b15d-47f2216faadd │
│ Blocksize               │ 4096                                 │
│ Created AT              │ 2024-02-20 16:43:32 +0000 UTC        │
│ ID                      │ e429973e-c499-4f66-a64e-a22aa673c32b │
│ Instance                │ 22ffc858-ea8b-4896-9e86-4ac1ee18afaf │
│ Labels                  │ n/a                                  │
│ Name                    │ test-volume                          │
│ Size                    │ 100 GiB                              │
│ State                   │ attached                             │
┼─────────────────────────┼──────────────────────────────────────┼

Block Storage Snapshot delete

exo compute block-storage snapshot delete test-volume_20240220165017
[+] Are you sure you want to delete block storage volume snapshot "test-volume_20240220165017"? [yN]: y
 ✔ Deleting block storage volume snapshot "test-volume_20240220165017"... 3s

Block Storage detach

exo compute block-storage detach test-volume
[+] Are you sure you want to detach block storage volume "test-volume"? [yN]: y
 ✔ Detaching block storage volume "test-volume"... 3s

Block Storage delete

exo compute block-storage delete test-volume
[+] Are you sure you want to delete block storage volume "test-volume"? [yN]: y
 ✔ Deleting block storage volume "test-volume"... 3s

Create Instance from Block Storage Volume

exo compute instance create instance-test --block-storage-volume test-volume-prod
 ✔ Creating instance "instance-test"... 16s
┼──────────────────────┼──────────────────────────────────────┼
│   COMPUTE INSTANCE   │                                      │
┼──────────────────────┼──────────────────────────────────────┼
│ ID                   │ b8fa9558-da71-41be-8007-ce41612f7294 │
│ Name                 │ instance-test                        │
│ Creation Date        │ 2024-02-20 17:17:23 +0000 UTC        │
│ Instance Type        │ standard.medium                      │
│ Template             │ Linux Ubuntu 22.04 LTS 64-bit        │
│ Zone                 │ ch-gva-2                             │
│ Anti-Affinity Groups │ n/a                                  │
│ Deploy Target        │ -                                    │
│ Security Groups      │ default                              │
│ Private Instance     │ No                                   │
│ Private Networks     │ n/a                                  │
│ Elastic IPs          │ n/a                                  │
│ IP Address           │x.x.x.x                         │
│ IPv6 Address         │ -                                    │
│ SSH Key              │ -                                    │
│ Disk Size            │ 50 GiB                               │
│ State                │ running                              │
│ Labels               │ n/a                                  │
│ Reverse DNS          │                                      │
┼──────────────────────┼──────────────────────────────────────┼

Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ added the WIP 🚧 Work in progress label Feb 14, 2024
@exoscale exoscale deleted a comment from shortcut-integration bot Feb 14, 2024
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ marked this pull request as ready for review February 20, 2024 17:26
@pierre-emmanuelJ pierre-emmanuelJ removed the WIP 🚧 Work in progress label Feb 20, 2024
@pierre-emmanuelJ pierre-emmanuelJ changed the title Add upcoming Block Storage Add Block Storage Feb 20, 2024
@pierre-emmanuelJ pierre-emmanuelJ changed the title Add Block Storage Compute: Add Block Storage Feb 20, 2024
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ force-pushed the pej/sc-78479/blockstorage-integration-on-the-cli branch from 174b838 to 30c0172 Compare February 21, 2024 11:08
Copy link
Member

@sauterp sauterp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a big PR, if you could have split it it would be easier to review. I'll review more later.

cmd/blockstorage_attach.go Outdated Show resolved Hide resolved
cmd/blockstorage_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_delete.go Outdated Show resolved Hide resolved
cmd/blockstorage_detach.go Outdated Show resolved Hide resolved
cmd/blockstorage_attach.go Outdated Show resolved Hide resolved
cmd/blockstorage_detach.go Show resolved Hide resolved
cmd/blockstorage_list.go Show resolved Hide resolved
cmd/blockstorage_show.go Show resolved Hide resolved
cmd/blockstorage_snapshot_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_delete.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_show.go Outdated Show resolved Hide resolved
cmd/blockstorage_snapshot_show.go Show resolved Hide resolved
cmd/blockstorage_update.go Outdated Show resolved Hide resolved
cmd/blockstorage_update.go Outdated Show resolved Hide resolved
cmd/blockstorage_update.go Outdated Show resolved Hide resolved
cmd/instance_create.go Outdated Show resolved Hide resolved
pierre-emmanuelJ and others added 6 commits February 22, 2024 09:47
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ requested a review from sauterp March 1, 2024 13:40
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ added the HOLD ✋ Hold, don't merge label Mar 8, 2024
…ockstorage-integration-on-the-cli

Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ removed the HOLD ✋ Hold, don't merge label Apr 2, 2024
cmd/blockstorage_create.go Outdated Show resolved Hide resolved
cmd/instance_create.go Outdated Show resolved Hide resolved
cmd/blockstorage_update.go Show resolved Hide resolved
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
@pierre-emmanuelJ pierre-emmanuelJ merged commit aadbe20 into master Apr 3, 2024
1 check passed
@pierre-emmanuelJ pierre-emmanuelJ deleted the pej/sc-78479/blockstorage-integration-on-the-cli branch April 3, 2024 09:03
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.

4 participants