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

0.7rc2 forces to destroy existing vsphere resources due to enable_disk_uuid #7275

Closed
shravanpn7 opened this issue Jun 22, 2016 · 7 comments · Fixed by #7278
Closed

0.7rc2 forces to destroy existing vsphere resources due to enable_disk_uuid #7275

shravanpn7 opened this issue Jun 22, 2016 · 7 comments · Fixed by #7278

Comments

@shravanpn7
Copy link

Hello,

I have few vsphere_virtual_machine resources created using 0.6.16 and I switched to 0.7rc2 to test if #6590 is fixed. When i run my plan, its destroying existing resource because the 'enable_disk_uuid' is not present in 0.6.16.

Terraform Version

Terraform v0.7.0-rc2 (46a0709)

Affected Resource(s)

  • vsphere_virtual_machine

Terraform Configuration Files

resource "vsphere_virtual_machine" "demo" {

  name   = "demo"
  folder = "${var.vsphere_folder}/Demo"
  vcpu   = 16
  memory = 32768
  datacenter = "SanJose"
  cluster = "Lab"
  skip_customization =  false

  disk {
    template = "${var.template_winrm2k12}"
    datastore = "${var.template_datastore}"
    type = "thin"
  }

  network_interface {
    label = "${var.solutionlab_vlans}"
    ipv4_address = "10.37.215.1"
    ipv4_prefix_length = 16
    ipv4_gateway = "10.37.254.254"
  }

  dns_servers = ["10.1.160.3","10.1.160.4"]
  time_zone = "004"

}

Plan output

-/+ vsphere_virtual_machine.demo
    cluster:                                                 "Lab" => "Lab"
    datacenter:                                              "SanJose" => "SanJose"
    disk.#:                                                  "1" => "1"
    disk.1397297891.bootable:                                "false" => ""
    disk.1397297891.controller_type:                         "scsi" => "scsi"
    disk.1397297891.datastore:                               "SSDCluster/guestvms" => "SSDCluster/guestvms"
    disk.1397297891.iops:                                    "0" => ""
    disk.1397297891.keep_on_remove:                          "false" => ""
    disk.1397297891.key:                                     "0" => "<computed>"
    disk.1397297891.name:                                    "" => ""
    disk.1397297891.size:                                    "0" => ""
    disk.1397297891.template:                                "Win2012R2Winrm" => "Win2012R2Winrm"
    disk.1397297891.type:                                    "thin" => "thin"
    disk.1397297891.uuid:                                    "" => "<computed>"
    disk.1397297891.vmdk:                                    "" => ""
    dns_servers.#:                                           "2" => "2"
    dns_servers.0:                                           "10.1.160.3" => "10.1.160.3"
    dns_servers.1:                                           "10.1.160.4" => "10.1.160.4"
    domain:                                                  "vsphere.local" => "vsphere.local"
    enable_disk_uuid:                                        "" => "false" (forces new resource)
    folder:                                                  "Solutions Lab/Demo" => "Solutions Lab/Demo"
    linked_clone:                                            "false" => "false"
    memory:                                                  "32768" => "32768"
    memory_reservation:                                      "0" => "0"
    name:                                                    "demo" => "demo"
    network_interface.#:                                     "1" => "1"
    network_interface.0.ip_address:                          "" => "<computed>"
    network_interface.0.ipv4_address:                        "10.37.215.1" => "10.37.215.1"
    network_interface.0.ipv4_gateway:                        "10.37.254.254" => "10.37.254.254"
    network_interface.0.ipv4_prefix_length:                  "16" => "16"
    network_interface.0.ipv6_address:                        "" => "<computed>"
    network_interface.0.ipv6_gateway:                        "" => "<computed>"
    network_interface.0.ipv6_prefix_length:                  "0" => "<computed>"
    network_interface.0.label:                               "VMGuest ENG - 37" => "VMGuest ENG - 37"
    network_interface.0.mac_address:                         "00:50:56:93:83:ed" => "<computed>"
    network_interface.0.subnet_mask:                         "" => "<computed>"
    skip_customization:                                      "false" => "false"
    time_zone:                                               "004" => "004"
    vcpu:                                                    "16" => "16"

Panic Output

N/A

Expected Behavior

Should run and apply plan with out destroying exisitng resources which doesnt have enable_disk_uuid flag

Actual Behavior

The vsphere_virtual_machine are being destroyed if the existing resources doesnt have enable_disk_uuid flag

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
  2. terraform apply
@shravanpn7
Copy link
Author

I am currently bypassing this issue by manually editing the local tfstate to add "enable_disk_uuid" = falseand pushing it to remote state.

@stack72
Copy link
Contributor

stack72 commented Jun 22, 2016

Hi @chrislovecnm

Looks like a state migration was missed here

P.

@stack72
Copy link
Contributor

stack72 commented Jun 22, 2016

hi @shravanpn7

Thanks for reporting the issue here. I am going to get this fixed before 0.7 hits

Paul

stack72 added a commit that referenced this issue Jun 22, 2016
`virtual_machine`

Fixes #7275 - a state migration was missed when `enable_disk_uuid` was
merged

```
make testacc TEST=./builtin/providers/vsphere
TESTARGS='-run=TestVSphereVirtualMachineMigrateState'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/vsphere -v
-run=TestVSphereVirtualMachineMigrateState -timeout 120m
=== RUN   TestVSphereVirtualMachineMigrateState
--- PASS: TestVSphereVirtualMachineMigrateState (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere
0.018s
```
@chrislovecnm
Copy link
Contributor

We may have another as well. Disk controllers.

@stack72
Copy link
Contributor

stack72 commented Jun 22, 2016

@chrislovecnm nah, looks like disk controller_type has already been taken care of in the migration function

@chrislovecnm
Copy link
Contributor

Awesome!!

@ghost
Copy link

ghost commented Apr 25, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants