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

vSphere provider: sparse VMDK is not completely cleaned up with vsphere_file #37

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments
Labels
enhancement Type: Enhancement

Comments

@hashibot
Copy link

This issue was originally opened by @sputnik13 as hashicorp/terraform#8058. It was migrated here as part of the provider split. The original body of the issue is below.


When a sparse VMDK is uploaded with vsphere_file and used with a vsphere_virtual_machine, additional files get generated due to the VMDK being a sparse VMDK. If I have keep_on_remove = "true" on the VM so that terraform destroy can delete the vsphere_file, the additional files generated for the sparse VMDK is not cleaned up properly. This results in subsequent runs of terrform apply failing.

Sample terraform template below...

resource "vsphere_file" "k8s-master-bootdisk" {
    datacenter = "${var.datacenter}"
    datastore = "${var.datastore}"
    source_file = "${var.linux_vmdk_source}"
    destination_file = "${var.prefix}/master-bootdisk.vmdk"
}

resource "vsphere_virtual_machine" "k8s-master" {
    name = "${var.prefix}-master"
    #folder = "${vsphere_folder.k8s_folder.path}"
    datacenter = "${var.datacenter}"
    cluster = "${var.cluster}"

    connection {
        user = "ubuntu"
        key_file = "${var.key_file}"
    }

    network_interface {
        label = "${var.network}"
    }

    cdrom {
        datastore = "${var.datastore}"
        path = "${vsphere_file.cidata.destination_file}"
    }

    disk {
        controller_type = "ide"
        datastore = "${var.datastore}"
        vmdk = "${vsphere_file.k8s-master-bootdisk.destination_file}"
        bootable = "true"
        keep_on_remove = "true"
    }
}
@hashibot hashibot added the bug Type: Bug label Jun 13, 2017
@vancluever
Copy link
Contributor

Hey all, I'm changing this one to an enhancement - I'm not too sure if this will be possible as VMDKs are possibly the only place that this magic functionality occurs and depending on if there is a way we can handle this in the API, there may not be too much we can do here.

In the meantime I would recommend using different methods to upload VMDKs.

Thanks!

@vancluever vancluever added enhancement Type: Enhancement and removed bug Type: Bug labels Dec 18, 2017
@aareet aareet added waiting-response Status: Waiting on a Response and removed waiting-response Status: Waiting on a Response labels Mar 30, 2020
@ghost
Copy link

ghost commented Oct 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants