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:
commit
df46af5b57
|
@ -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, ".")
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue