Automation

 View Only
  • 1.  how to Mount datastore (vVOL) to additional host using powerCLI

    Posted Nov 26, 2020 08:15 PM

    i am using this commande to attach new host to existant datastore vVOL : but is not working

    $esxi | new-Datastore -Name $vVol.Name

    any help will be appreciate



  • 2.  RE: how to Mount datastore (vVOL) to additional host using powerCLI
    Best Answer

    Posted Nov 26, 2020 10:19 PM

    i found the solution!!!

     

    $vVol=Get-Cluster -name $Cluster | Get-Datastore |Where-Object{$_.name -like "*vvol*" }

    $EsxiID=$esxi| select ID
    $CodeHost=$EsxiID.id.substring($EsxiID.id.length -6, 6) #get code Host

    $DatastoreSystemID="HostDatastoreSystem-datastoreSystem-"+$CodeHost

    #---------------attachVvolDatastore---------------

    $URL=$vVol|select ExtensionData $ScId=(($URL.ExtensionData.info.url).Replace("/","")).Replace("ds:vmfsvolumes","") $spec = New-Object VMware.Vim.HostDatastoreSystemVvolDatastoreSpec $spec.Name = $vVol.Name $spec.ScId = $ScId $_this = Get-View -Id $DatastoreSystemID $_add=$_this.CreateVvolDatastore($spec)

    #----------------- End of code capture -----------------



  • 3.  RE: how to Mount datastore (vVOL) to additional host using powerCLI

    Posted Apr 05, 2022 11:16 AM

    Hi, Could you please explain what this does?