Skip to content

Commit

Permalink
fix: Update DiskCloneValidateOperation and DiskImportOperation
Browse files Browse the repository at this point in the history
Updates the `DiskCloneValidateOperation` and `DiskImportOperation` functions in `virtual_machine_disk_subresource` to add support for SATA and IDE controllers and disks. #1189

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
  • Loading branch information
Ryan Johnson authored and appilon committed Mar 22, 2022
1 parent 2b60361 commit b48db75
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ func DiskCloneValidateOperation(d *schema.ResourceDiff, c *govmomi.Client, l obj
return fmt.Errorf("%s: error parsing device address after reading disk %q: %s", tr.Addr(), targetPath, err)
}
if ct != SubresourceControllerTypeSCSI && ct != SubresourceControllerTypeSATA && ct != SubresourceControllerTypeIDE {
return fmt.Errorf("%s: unsupported controller type %s for disk %q.", tr.Addr(), ct, targetPath)
return fmt.Errorf("%s: unsupported controller type %s for disk %q", tr.Addr(), ct, targetPath)
}
}
log.Printf("[DEBUG] DiskCloneValidateOperation: All disks in source validated successfully")
Expand Down Expand Up @@ -1092,7 +1092,7 @@ func DiskImportOperation(d *schema.ResourceData, l object.VirtualDeviceList) err
return fmt.Errorf("disk.%d: error parsing device address %s: %s", i, addr, err)
}
if ct != SubresourceControllerTypeSCSI && ct != SubresourceControllerTypeSATA && ct != SubresourceControllerTypeIDE {
return fmt.Errorf("disk.%d: unsupported controller type %s for disk %s.", i, ct, addr)
return fmt.Errorf("disk.%d: unsupported controller type %s for disk %s", i, ct, addr)
}
// As one final validation, as we are no longer reading here, validate that
// this is a VMDK-backed virtual disk to make sure we aren't importing RDM
Expand Down

0 comments on commit b48db75

Please # to comment.