- Con este script en PowerCli se pueden agregar múltiples LUNs a un hosts ESXi.
- Las pruebas se realizaron en mi lab con vCenter versión 7.0.3, Powershell 7.02 y PowerCli 13.
- Se debe definir el nombre del hosts en la variable $hostname
- Dentro de $LUNs se deben agregar las LUNs ID, todas las que se requieran como esta en el ejemplo.
<# =========================================================================== Creado por: Cecilia Checchia Blog: www.ceciliachecchia.com =========================================================================== # Agregar múltiples DS versión VMFS 6 y configurar IOPS en valor = 1 =========================================================================== #> # Primer Paso: Conéctese a su servidor vCenter o host ESXi mediante el cmdlet Connect-VIServer: Connect-VIServer -Server IP_OR_FQDN -Protocol https -User xxxxx@xxxx.xxxx -Password xxxxxxx # Variables $hostName = "HOST_NAME_WITH_FQDN" $LUNs =@( [pscustomobject]@{DatastoreName='NAME_DS';CanonicalName='LUNID'} # Example LUNID: naa.60000XXXXXXXXXXXXXXXXXXXXXXXXX [pscustomobject]@{DatastoreName='NAME_DS';CanonicalName='LUNID'} # Example LUNID: naa.60000XXXXXXXXXXXXXXXXXXXXXXXXX [pscustomobject]@{DatastoreName='NAME_DS';CanonicalName='LUNID'} # Example LUNID: naa.60000XXXXXXXXXXXXXXXXXXXXXXXXX ) # Recorre las luns y crea los nuevos datastores foreach ($LUN in $LUNs) { New-Datastore -VMHost $hostName -Name $LUN.DatastoreName -Path $LUN.CanonicalName -vmfs -FileSystemVersion 6 } # Recorre las luns y asigna los IOPS en valor 1 para las luns donde el MultipathPolicy sea igual a RoundRobin foreach ($LUN in $LUNs) { Get-VMhost $hostName | Get-ScsiLun -LunType Disk | Where-Object {$_.CanonicalName -like $LUN.CanonicalName -and $_.MultipathPolicy -like 'RoundRobin'} | Set-ScsiLun -CommandsToSwitchPath 1 }
Hi there every one, here every person is sharing these familiarity, so it’s good to read this blog, and
I used to pay a visit this website every
day.
Hi there every one, here every person is sharing these familiarity, so it’s good to read this blog, and
I used to pay a visit this website every
day.
It’s actually a nice and helpful piece of information. I am glad that you shared this helpful info with us. Please stay us informed like this. Thank you for sharing.