Hey folks,
I'm trying to bulk update the names of the scsi LUNs (datastores and RDMs) that are presented to my ESXi cluster. I can output the information I need using the following (the example lists a single device based on filtering the canonical name):
$esxName = "myserver.mydomain.com"
$esx = Get-VMHost $esxName | Get-View
$scsiLun = $esx.Config.StorageDevice.ScsiLun | where {$_.LunType -eq "disk" -AND $_.canonicalName.substring(32) -eq "3000" }
Write-Host $scsiLun.CanonicalName $scsiLun.DisplayName
I want to update the DisplayName. I've tried $scsiLun.Set_DisplayName("test"), however it does not apply properly.
Does anyone have any suggestions?
Cheers!
I was put on the wrong foot by the script in your first post.
It's not the CanonicalName you want to change but the DisplayName property.
Since you mentioned you did it through vSphere client I realised what you were trying to do.
Yes, that can be done.
Use something like this
$esxName = <esx-hostname> $esx = Get-VMHost $esxName | Get-View $storSys = Get-View $esx.ConfigManager.StorageSystem $esx.Config.StorageDevice.ScsiLun | where {$_.LunType -eq "disk"} | %{ $storSys.UpdateScsiLunDisplayName($_.Uuid, $_.DisplayName + " test") }
This script just adds the suffix "test" to the existing value.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Afaik you can't change this name.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I was afraid that might be the case. I've got over 200 to change and the vsphere client is painful because it refreshes after each name change. I'll leave the question open for a few days in case anyone knows of another method!
Cheers.
I was put on the wrong foot by the script in your first post.
It's not the CanonicalName you want to change but the DisplayName property.
Since you mentioned you did it through vSphere client I realised what you were trying to do.
Yes, that can be done.
Use something like this
$esxName = <esx-hostname> $esx = Get-VMHost $esxName | Get-View $storSys = Get-View $esx.ConfigManager.StorageSystem $esx.Config.StorageDevice.ScsiLun | where {$_.LunType -eq "disk"} | %{ $storSys.UpdateScsiLunDisplayName($_.Uuid, $_.DisplayName + " test") }
This script just adds the suffix "test" to the existing value.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's it! Thanks so much!
Hi ,
I think what you have done is very usefull for me
i did not understand if rename appears on vSphere Center or host also on ESX, so no more vml.... but LUN1_12.....
You can help and pointed the way.
Hi LucD,
i have open a discussion ,
http://communities.vmware.com/message/1578617#1578617
and i have the same needs, but on command line on esx host or vMA.
Is possible change "Device Display Name" without PowerCLI?
Thanks for your kind answer