glog.Errorf("Error occurred while checking datastore compatibility with storage policy id: %s, err: %+v",vmdisk.volumeOptions.StoragePolicyID,err)
returnerr
return"",err
}
if!compatible{
glog.Errorf("Datastore: %s is not compatible with Policy: %s",datastore.Name(),vmdisk.volumeOptions.StoragePolicyName)
returnfmt.Errorf("User specified datastore is not compatible with the storagePolicy: %q. Failed with faults: %+q",vmdisk.volumeOptions.StoragePolicyName,faultMessage)
return"",fmt.Errorf("User specified datastore is not compatible with the storagePolicy: %q. Failed with faults: %+q",vmdisk.volumeOptions.StoragePolicyName,faultMessage)
glog.Errorf("Failed to get canonical vsphere volume path for volume: %s with volumeOptions: %+v on datastore: %s. err: %+v",volumePath,volumeOptions,datastore,err)
return"",err
}
iffilepath.Base(datastore)!=datastore{
// If datastore is within cluster, add cluster path to the volumePath
// Example1: The canonical path for volume path - [vsanDatastore] kubevols/volume.vmdk will be [vsanDatastore] 25d8b159-948c-4b73-e499-02001ad1b044/volume.vmdk
// Example2: The canonical path for volume path - [vsanDatastore] 25d8b159-948c-4b73-e499-02001ad1b044/volume.vmdk will be same as volume Path.