-
Notifications
You must be signed in to change notification settings - Fork 605
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
Disk objects aren't deleted when the VM is deleted #927
Comments
Found the issue! Our API allows you to provide the {
name: 'image2',
machineType: 'zones/us-central1-a/machineTypes/g1-small',
// ...
disks: [
{
boot: true,
initializeParams: {
sourceImage: 'https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1504-vivid-v20150616a'
}
}
]
} The problem is that a disk is automatically created for your VM. When you delete the VM, by default, it thinks you won't want the disk to be deleted as well. Here's what we need to do to change that: disks: [
{
+ autoDelete: true,
boot: true, I'll put a PR that defaults var config = { keyFilename: '', projectId: '' } // must be provided to gceImages
var gcloud = require('gcloud')(config)
var gceImages = require('gce-images')(config)
gceImages.getLatest('ubuntu', function (err, image) {
if (err) // ...
var cfg = {
machineType: 'g1-small',
disks: [
{
autoDelete: true,
boot: true,
initializeParams: {
sourceImage: image.selfLink
}
}
]
}
zone.createVM('vm-name', cfg, function () {})
}) Good catch, by the way. I had quite a few lingering disks in my test project :) |
Sorry, my last post had some bugs I just fixed. Refresh if you have already read it to get the latest. |
I am trying it out now. |
😜 👍 🎉 Same here with the disks. :) |
Stumbling upon a new error when building the
I assume this has to do with the authentication. I am initialising
This last line is missing from your example above ( |
Sorry, try un- and re-installing gce-images (so that you get 0.2.1). Pushed a fix! |
Ok, I am further. 😄 Next one:
I try to build the VM instance using this config: var BUILDER_MACHINE_CONFIG = {
os: "ubuntu",
machineType: "g1-small",
disks: [{
autoDelete: true,
boot: true,
initializeParams: {
sourceImage: sourceImage
}
}]
}; |
Thanks for being patient with me :) Remove the |
Makes sense because the |
Ok, we're flying! 🚀 Thanks also for help. I'll bug you later. No worries! 😝 You can close this issue is you don't have anything to track further. |
Thanks again for catching this! I'll keep this open to make sure we don't forget to set |
- [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: googleapis/googleapis@4b6b01f Source-Link: googleapis/googleapis-gen@8ac83fb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9
🤖 I have created a release \*beep\* \*boop\* --- ### [2.3.6](https://www.github.com/googleapis/nodejs-vision/compare/v2.3.5...v2.3.6) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#926](https://www.github.com/googleapis/nodejs-vision/issues/926)) ([6853428](https://www.github.com/googleapis/nodejs-vision/commit/68534284ff975a3a1c950b6727358b77dac4fc83)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
There seems to be an issue with the VM instances when recycling the names. In the below example I create, delete and create again an instance using the same name. The error is shown in the output snippet below.
The operation after the 2nd
createVM
call will issue the error:Can the VM instance names be reused? (Can you please point me to the documentation, if there is smth like this specified)
Thanks!
The text was updated successfully, but these errors were encountered: