Microsoft Virtualization Discussions

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Hello, thearle.  I understand the appeal of a cmdlet the provides access to the controller CLI.  Unfortunately, the needed API isn't officially tested or supported, so I'm afraid we can't include that in the Toolkit.  I expect the need for that will abate as the Data ONTAP APIs, and the PowerShell Toolkit, evolve.  As you say, it's not difficult to roll your own, but please exercise caution with unsupported APIs.

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

I'll throw out something that seems ridiculously difficult given mulltiple protocols, many to many relationships, multiple vendors...

Vmware to NetApp volume translation.

$ds=Get-datastore "prodvms"

$nv=convert-datastoretonavol $ds

Or how about:

get-datastore "prodvms" | convert-datastoretonavol | enable-nasis

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Hi, Ben.  What I think you're asking is how to map a VMware datastore to a Data ONTAP volume, no?  We don't envision creating cmdlets for interfacing with other vendors' products.  Instead, we aim to provide cmdlets that may be used in concert with others' offerings.  I'm not a VMware expert, but I consulted one, and you might try something along these lines:

> Get-Datastore demoData | fl


DatacenterId         : Datacenter-ha-datacenter
ParentFolderId       : Folder-ha-folder-datastore
DatastoreBrowserPath : vmstores:\10.10.10.136@443\ha-datacenter\demoData
FreeSpaceMB          : 61374
CapacityMB           : 61440
Accessible           : True
Type                 : NFS
Id                   : Datastore-10.10.10.92:/vol/demoData
Name                 : demoData

The Type is 'NFS' and the Id field appears to contain the controller address and the NFS export name.  Given that:

Connect-NaController 10.10.10.92 -Credential (Get-Credential)

Get-NaNfsExportStoragePath /vol/demoData | Get-NaVol | Enable-NaSis | Start-NaSis

(The real VMware experts are welcome to correct any of this, or better yet, post an example script on this community.)

Clinton

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Hi Clinton,

I am asking for someone to write something that can run a command against a filer because it is easier for us administrators to use a cmdlet and write scripts around that than to necessarily learn another set of API's.  I did not say i wrote a cmdlet, rather i created something that enabled me to do this.  For me as a storage administrator for NetApp kit i can really see the advantage of a commandlet that can provide the functionalities of RSH or SSH similar to that on Linux and Unix systems.

Thanks

Matthew

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Clinton,

I looked at this, and put something together.  It is very rough, as I don't have a filer in front of me, but could do the trick.

It is a little long winded, as I commented everything.

This would be done using the vSphere PowerCLI:

#Load Data ONTAP PowerShell Toolkit

Import-Module DataONTAP

#Connect to vCenter

Connect-VIServer vcenter.domain.com

#Grab all the datastores that are NFS

$datastores Get-Datastore | where {$_.type -eq "NFS"}

#Loop through the results

foreach ($datastore in $datastores) {

   #Get a specific datastore

    $objDataStore = Get-Datastore -Name $_.Name

    #Get the a view of the datastore, by the ID, so we can get extended properties

    $objDataStoreView = Get-DataStoreView -id $objDataStore.id

    #Grab the URL, as it has the filer IP address, and the export path

    #It will look something like this: netfs://10.10.10.92//vol/demodata/

    $objDataStoreURL = $objDataStoreView.info.URL

   #Split it up, using "//" as the delimiter

    $SplitURL = $objDataStoreURL.split("//")

    #Position 0 has netfs: and will not be used, Position 1 has the IP of the filer, Position 2 has the export path, without a leading / and with a trailing /

    $filer = $SplitURL[1]
    $export = "/"+$SplitURL[2].Trimend("/")

    #Connect to the filer, prompting for Credentials (this could be done beforehand in a single filer environment)

    Connect-NaController $filer -Credential (Get-Credential)

    #Get the NFS Export info...

    Get-NaNfsExportStoragePath $export |Get-NaVol

}

Again, this is pretty rough draft, and I haven't used the Get-NaNfsExportStoragePath cmdlet before.  But this is a start.

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

I would like to be able to do more with vfilers such as cifs and nfs.

Thanks,

Brian

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

I am starting to do a lot of NetApp and VMWare scripting. Currently I am finding it difficult to pull the iSCSI node name from the vmware side and nocticed a nice command-let here "Get-NAIscsiSession" that shows all iscsi information. It would be nice if I could pull the InitiatorNodename section out into a variable to make it easy to create igroups. Something like:

$iscsiname = Get-NaIscsiSession.InitiatorNodename or something along those lines. Not sure how to do it if multiple sessions are there though. Just thinking outloud, but I love this toolkit.

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Hi Clinton -

Once again, great work.

The auto-discovery is actually less important to my customer.

More important is being able to do the entire Filer setup, from "out of the cardboard box" to "ready to deploy". Someone said there isn't the ability to set up vifs or network configuration? That seems like a show-stopper. Are there any workarounds?

Jeff Baxter

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

For the NetApp Controller, you'd use get-nsiscsinodename.  For the host?

PS C:\> $HostInitiator=get-naiscsisession;$HostInitiator.InitiatorNodeName
iqn.1991-05.com.microsoft:win-cjrn2t2kse0
PS C:\>


I just put the object returned by get-naiscsisession in a variable then output the InitiatiorNodeName of that variable.  Does that work for you?

J

Re: What would YOU like to see in the Data ONTAP PowerShell Toolkit?

Hi, Jeff, thanks.  The APIs for getting / setting the persistent network configuration appear to be new in Data ONTAP 7.3.3.  I've only just begun using them, but I consider that a fairly high priority for the Toolkit.  Possible workarounds might include modifying /etc/rc via the Write-NaFile cmdlet or using ssh to get to the ONTAP CLI.

Forums