Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

POWERCLI Script Resize VMFS Datastore

$
0
0

Hi,

 

 

I have a problem when expanding datastores in 5.0.U1, U2, U3 versions. When large disk cabin, ESXi recognizes the new size, but in "Properties" Datastorage the button "Increase" this is disabled:

1.JPG

 

I have opened a case with vmware and was told that is a workaround for versions 5.0.X and 5.1.x and  in the 5.5.x version is corrected. He sent me this link: VMware KB:    Cannot grow VMFS datastore, the Increase button is disabled  but I can not apply because it involves service stop.

I found this KB VMware KB:    Growing or expanding a VMFS volume or datastore  and following the steps sometimes allows me to do the expansion, I enable the "Increase", but  many times the button  not working, continues disabled.

 

I found thisl post "Scripted resize of VMFS datastores" but the script fails me, I can not make it work.

 

The script is this:

$ds = Get-Datastore -Name "Volume05"
$dsscsi = get-datastore $ds | get-scsilun
$dscanonical = $dsscsi.CanonicalName
$esx = Get-View $ds.ExtensionData.Host[0].Key
$storSys = Get-View $esx.ConfigManager.StorageSystem
$dsSys = Get-View $esx.ConfigManager.DatastoreSystem
$vmfsPath = $ds.ExtensionData.Host[0].MountInfo.Path
$storSys.RescanAllHba()
$extent = $dsSys.QueryVmfsDatastoreExpandOptions($ds.ExtensionData.MoRef)
$spec = New-Object VMware.Vim.HostScsiDiskPartition
$spec.diskName = $dscanonical
$spec.partition = "1"
if($extent.Count -ne 0){  $storsys.ExpandVmfsExtent($vmfspath,$spec)
}

 

The error I get is:

2.JPG

Excepción al llamar a "ExpandVmfsExtent" con los argumentos "2": "A specified parameter was not correct.
"
En E:\Resize_VMFS_01.ps1: 15 Carácter: 3
+   $storsys.ExpandVmfsExtent($vmfspath,$spec)
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException    + FullyQualifiedErrorId : VimException

 

Please can someone help me?

 

Regards

Daniel


Viewing all articles
Browse latest Browse all 9071

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>