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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(instance): support snapshot based instance #3787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tormath1
Copy link

@tormath1 tormath1 commented Apr 23, 2024

Hi,

In this PR I tried to allow the CLI to deploy an instance directly from a snapshot without calling the marketplace API.

scw instance server \
  create image=none \
  root-volume=l:11111...11 \
  cloud-init=@/tmp/config.json

Community Note

  • Please vote on this pull request by adding a 馃憤 reaction to the original pull request comment to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

NONE

@remyleone remyleone added the instance Instance issues, bugs and feature requests label Apr 23, 2024
serverType *instance.ServerType
)
if args.Image != "none" {
getImageResponse, err := apiInstance.GetImage(&instance.GetImageRequest{
Copy link
Member

Choose a reason for hiding this comment

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

getImageResponse is shadowing the one created in previous context.

Suggested change
getImageResponse, err := apiInstance.GetImage(&instance.GetImageRequest{
var err error
getImageResponse, err = apiInstance.GetImage(&instance.GetImageRequest{


serverType := getServerType(apiInstance, serverReq.Zone, serverReq.CommercialType)
serverType := getServerType(apiInstance, serverReq.Zone, serverReq.CommercialType)
Copy link
Member

Choose a reason for hiding this comment

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

serverType shadows the one created in previous context

Suggested change
serverType := getServerType(apiInstance, serverReq.Zone, serverReq.CommercialType)
serverType = getServerType(apiInstance, serverReq.Zone, serverReq.CommercialType)

Copy link
Author

Choose a reason for hiding this comment

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

Oops thanks a lot. Missed that. That should explain the failing CI.

This PR allow users to create an instance from a snapshot directly
without creating an image.
It's already supported by the APIs.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
@tormath1 tormath1 force-pushed the tormath1/instance-snapshot branch from 7f521e5 to ad04273 Compare May 21, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instance Instance issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants