diff --git a/.changelog/5457.txt b/.changelog/5457.txt new file mode 100644 index 0000000000..8ba3357df2 --- /dev/null +++ b/.changelog/5457.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: fixed a bug that would cause `google_instance_from_machine_image` to fail with a resourceInUseByAnotherResource error +``` diff --git a/google-beta/resource_compute_instance_from_machine_image.go b/google-beta/resource_compute_instance_from_machine_image.go index 766aef2bd2..60f9c550ae 100644 --- a/google-beta/resource_compute_instance_from_machine_image.go +++ b/google-beta/resource_compute_instance_from_machine_image.go @@ -213,7 +213,6 @@ func adjustInstanceFromMachineImageDisks(d *schema.ResourceData, config *Config, for _, disk := range mi.SourceInstanceProperties.Disks { if disk.Boot { newdisk := &compute.AttachedDisk{ - Source: disk.Source, AutoDelete: disk.AutoDelete, Type: disk.Type, DeviceName: disk.DeviceName, @@ -235,7 +234,6 @@ func adjustInstanceFromMachineImageDisks(d *schema.ResourceData, config *Config, for _, disk := range mi.SourceInstanceProperties.Disks { if disk.Type == "SCRATCH" { newdisk := &compute.AttachedDisk{ - Source: disk.Source, AutoDelete: disk.AutoDelete, Type: disk.Type, DeviceName: disk.DeviceName, @@ -261,7 +259,6 @@ func adjustInstanceFromMachineImageDisks(d *schema.ResourceData, config *Config, for _, disk := range mi.SourceInstanceProperties.Disks { if !disk.Boot && disk.Type != "SCRATCH" { newdisk := &compute.AttachedDisk{ - Source: disk.Source, AutoDelete: disk.AutoDelete, Type: disk.Type, DeviceName: disk.DeviceName,