Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Google Driver: Enable AutoDelete of Disks for GCE #4355

Merged
merged 1 commit into from
Feb 10, 2018

Conversation

tmaier
Copy link
Contributor

@tmaier tmaier commented Jan 4, 2018

This is how currently my disk listing looks like (this are gitlab-runners, started/managed with docker-machine and using Preemptible VMs)
screen shot 2018-01-04 at 15 03 54
Note that most disks are there, but not attached to any VM.
The related VMs are gone.

This means disks are not reliably deleted. For example when using together with Preemptible VMs. It can happen that the Disk stays forever.

This Pull request enables the auto-delete feature for disks.
https://cloud.google.com/sdk/gcloud/reference/compute/instances/set-disk-auto-delete
The documentation states that this is a feature which is enabled by default usually.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "google-AutoDelete" git@github.com:tmaier/machine.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Disks are not reliably deleted.

For example when using together with Preemptible VMs. It can happen that the Disk stays there forever.

Signed-off-by: Tobias L. Maier <me@tobiasmaier.info>
@tmaier tmaier force-pushed the google-AutoDelete branch from 8e60a1b to 72c5993 Compare January 4, 2018 14:10
@tmaier tmaier changed the title Google: Enable AutoDelete of Disks for GCE Google Driver: Enable AutoDelete of Disks for GCE Jan 4, 2018
@dgageot
Copy link
Member

dgageot commented Jan 28, 2018

@tmaier The idea behind that was to be able to delete a machine and keep the disk to save money while not losing the data. That's what is done when we run docker-machine stop VM. Now, I admit that the code was written at the time where VMs couldn't be stopped on GCE.

What I'd rather see is a more important code change:

  • Disks are auto-deleted
  • docker-machine stop VM now actually stops a VM instead of deleting it.
  • docker-machine rm VM should delete the VM. The disk will then be deleted automatically
  • docker-machine start VM should start a stopped VM and complain if it's gone

Do you think it would address your issue?

@dgageot
Copy link
Member

dgageot commented Feb 10, 2018

@tmaier I changed my mind. I think you are right. I based my thinking on the old behavior of the driver. LGTM then!

@dgageot dgageot merged commit 5048437 into docker:master Feb 10, 2018
@tmaier
Copy link
Contributor Author

tmaier commented Feb 10, 2018

Thank you!

@shin- shin- added this to the 0.14.0 milestone Feb 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants