Skip to content

vpc support for exo compute instance create - #947

Merged
aureliar8 merged 2 commits into
masterfrom
aureliar8/create-instance-with-vpc
Nov 3, 2026
Merged

aureliar8 merged 2 commits into
masterfrom
aureliar8/create-instance-with-vpc

Conversation

@aureliar8

@aureliar8 aureliar8 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add VPC support to exo compute instance create to be able to directly create instance attached to VPC subnets

Example usage

go run . -A pp c i create vpc-create-test2 --vpc vpc1 --vpc-subnet s1 --vpc-subnet my-second-subnet,ipv4=10.0.0.5

=> This show the two way to attach an instance to a subnet, either by specifying the ipv4 to use or by letting exoscale decide. (In a few month when ipv6 is supported you'll also be able to do my-second-subnet,ipv4=10.0.0.5,ipv6=<something> or my-second-subnet,ipv6=<something>)

[ch198689]

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

@aureliar8
aureliar8 requested review from a team November 2, 2026 15:05

@pierre-emmanuelJ pierre-emmanuelJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, the NAME|ID[,ipv4=IP] format leaves room for ipv6 later. A few nits below, nothing blocking.

Comment thread CHANGELOG.md Outdated
- kms: add `--encryption-algorithm` to `exo kms crypto encrypt` and `decrypt`, and `--source-encryption-algorithm` and `--dest-encryption-algorithm` to `reencrypt`, to use RSA keys
- kms: show the key spec in `exo kms key show` and `exo kms key list`
- dbaas: add `exo dbaas acl list` for Kafka and OpenSearch, `exo dbaas acl create` and `delete` for Kafka, and Kafka and OpenSearch support in `exo dbaas acl show` (#923)
- compute: add `--vpc` and `--vpc-subnet` to `exo compute instance create` to attach an instance to VPC Subnets at creation

@pierre-emmanuelJ pierre-emmanuelJ Nov 2, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Missing the PR number at the end, (#947).

Comment thread cmd/compute/instance/instance_create.go Outdated
}

// resolveCreateInstanceVPC builds the VPC attachment of an instance creation
// request from a VPC NAME|ID and a list of NAME|ID[:IPV4] subnet specs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment still says NAME|ID[:IPV4], the format is now NAME|ID[,ipv4=IP].

Comment thread cmd/compute/instance/instance_create.go Outdated
}
}

if c.VPC != "" || len(c.VPCSubnets) > 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

validateVPCFlags already ran at the top of CmdRun, so at this point both flags are either set or empty. if c.VPC != "" is enough, and the second validateVPCFlags call inside resolveCreateInstanceVPC (l.393) could go too. The error-case tests would then call validateVPCFlags directly.

@aureliar8
aureliar8 force-pushed the aureliar8/create-instance-with-vpc branch from 357badd to 3f1d511 Compare November 2, 2026 15:56
@aureliar8
aureliar8 merged commit 2aaf7b8 into master Nov 3, 2026
8 checks passed
@aureliar8
aureliar8 deleted the aureliar8/create-instance-with-vpc branch November 3, 2026 12:07
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.

3 participants