Can you try like this.
As a safety measure I filter out any shared datastore that might exist.
FunctionRename-datastore{
Foreach($Itemin$CSV){
$esx=Get-VMHost-Name "$($Item.Hostname).domain.com"
$id=0
Get-Datastore-Name datastore*-RelatedObject $esx|
where{-not$_.ExtensionData.Summary.MultipleHostAccess}|
ForEach-Object-Process {
$id+=1
Set-Datastore-Datastore $_-Name "$($esx.Name.Split('.')[0])-local$($id)"-Confirm:$false
}
}
}