Skip to content

Commit 826ecf5

Browse files
committed
fix: restore logic for applying storage policy using SDRS API
Signed-off-by: Stoyan Zhelyazkov <stoyan.zhelyazkov@broadcom.com>
1 parent 47fd8a6 commit 826ecf5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,14 @@ func DiskCloneRelocateOperation(resourceData *schema.ResourceData, client *govmo
953953
}
954954
r := NewDiskSubresource(client, resourceData, diskDataMap, nil, i)
955955

956+
// A disk locator is only useful if a target datastore is available. If we
957+
// don't have a datastore specified (ie: when Storage DRS is in use), then
958+
// we just need to skip this disk. The disk will be migrated properly
959+
// through the SDRS API.
960+
if dsID := r.Get("datastore_id"); dsID == "" || dsID == diskDatastoreComputedName {
961+
continue
962+
}
963+
956964
shouldRelocate := shouldAddRelocateSpec(resourceData, device.(*types.VirtualDisk), i)
957965
if !shouldRelocate {
958966
continue

0 commit comments

Comments
 (0)