Merge pull request #7278 from hashicorp/vsphere-vm-migration

provider/vsphere: Add migration for `enable_disk_uuid` on `virtual_machine`
This commit is contained in:
James Nugent 2016-06-23 11:03:58 +03:00 committed by GitHub
commit df46af5b57
2 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,10 @@ func migrateVSphereVirtualMachineStateV0toV1(is *terraform.InstanceState) (*terr
is.Attributes["skip_customization"] = "false"
}
if is.Attributes["enable_disk_uuid"] == "" {
is.Attributes["enable_disk_uuid"] = "false"
}
for k, _ := range is.Attributes {
if strings.HasPrefix(k, "disk.") && strings.HasSuffix(k, ".size") {
diskParts := strings.Split(k, ".")

View File

@ -20,6 +20,13 @@ func TestVSphereVirtualMachineMigrateState(t *testing.T) {
"skip_customization": "false",
},
},
"enable_disk_uuid before 0.6.16": {
StateVersion: 0,
Attributes: map[string]string{},
Expected: map[string]string{
"enable_disk_uuid": "false",
},
},
"disk controller_type": {
StateVersion: 0,
Attributes: map[string]string{