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

Add support for discard_local_ssd when stopping an instance #621

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

rchekaluk
Copy link

Stopping an instance with local SSD throws this error:

badRequest: VM has a Local SSD attached but an undefined value for `discard-local-ssd`. If using gcloud, please add `--discard-local-ssd=false` or `--discard-local-ssd=true` to your command.

The Google API Google::Apis::Compute::stop_instance (in service.rb) supports a keyword argument discard_local_ssd, but fog-google does not. This PR adds an optional argument to allow assigning a value when stopping an instance. The default is false, both to mimic Google default, and to preserve backward compatibility with existing fog-google users.

To stop an instance containing local SSD:

async = true
discard_local_ssd = true
resp = instance.stop(async, discard_local_ssd)

References:

@Temikus
Copy link
Member

Temikus commented Apr 8, 2024

LGTM. Thank you for your contribution! Apologies that it took this long to get back to you, didn't have a lot of time for OSS in the past couple of months and am just catching up.

@Temikus Temikus self-assigned this Apr 8, 2024
@Temikus Temikus merged commit 08fc5cc into fog:master Apr 8, 2024
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.

2 participants