5 Essential Tips for Maximizing Your Experience at Nutanix .NEXT for Bloggers
Yes, you can use this to get firmware information from the PTAgent. I susscessfully did it after importing the SSHSessions module. Sample below: $CvmCredentials = Get-Credential $CvmCredentials | Export-Clixml -Path "${env:\userprofile}\CVM.cred" $CvmCredentials = Import-Clixml -Path "${env:\userprofile}\CVM.cred" $CvmIP = “x.x.x.x” New-SshSession -ComputerName $CvmIP -Credential $CvmCredentials $Inventory = Invoke-SshCommand -ComputerName $CvmIP -Command "curl -s -k H 'Content-Type:application/json' -X POST 'https://192.168.5.1:8086/api/PT/v1/host/inventory' --data {} | less" $Inventory = $Inventory.result | ConvertFrom-Json Now you can dig through the $Inventory object and grab whatever you need. For example, $inventory.iDRAC will display all the properties of the iDRAC, like firmware version. Pretty much anything that LCM displays or updates is available here.
@sedwards, Hahaha! Wow, I’m a dummy. Okay, so I don’t know what I was thinking but I was connecting into the CVM instead of AHV for some reason (Using the SSHSessions module) and after connecting into AHV insteadI was able to pull the information I was looking for. Thanks! Now I wonder if I can use this on the CVM to connect to the PTAgent and pull firmware data instead of creating a cim-session directly to the iDRAC and pulling everything. Might be faster or at least use it as a backup in the event I can’t establish a cim-session.
@sedwards, okay, so this is actually getting me somewhere, sort of. I downloaded the module and was able to successfully establish an ssh session to a CVM via PowerShell. However, it looks like it only supports certain commands, like “ls” or “df -h”. If I try to run something like “genesis status” then it comes back with “[cvm ip] had an error: bash: genesis: command not found.” But running a “hostname” command will return me back the CVM name and like I said above, df -h works and ls works so I am sure other common linux commands work too but nothing specific to Nutanix seems to function, unfortunately. Similar result if I try to do a cluster status. I get “[cvm ip] had an error: bash: cluster: command not found” I don’t think I’ll be successful at getting PTagent or iSM versions if I can’t even pull a simple cluster status. I guess it is quite possible I am doing something wrong though.
These nodes are all running AHV, not Hyper-V. Don’t think this will work. Also, I need to be able to pull the information with the Nutanix PowerShell cmdlets so the results can be sent to a spreadsheet with a ton of other information I’m gathering. I’m managing hundreds of nodes and need to automate wherever I can.
@Alona some other feature requests in addition to above: It would be nice if connecting to Prism Central to pull info about clusters was fleshed out better. For example there is no easy way to connect to PC and get cluster info for clusters PC manages. If I use the get-ntnxcluterinfo cmdlet in PC it just returns details about the PC cluster. It would be nice to be able to specify which cluster I want cluster info on, like “get-ntnxclusterinfo -Name <name of cluster PC manages>”. I look at PC as Nutanix’s version of vCenter. I’d prefer to connect to that one source and pull all my data through there instead of looping through potentially dozens of individual clusters. The best I was able to do is log into PC, run the get-ntnxcluster command to retrieve a list of all the clusters it manages, disconnect from PC, then loop through the list of individual clusters and establish new connections to them. That’s really clunky. The hierarchical approach VMware uses with vCenter and the
Aaaaand it looks like Nutanix is going to quietly avoid this subject again. As @MrMike mentioned, it looks like they abandoned it after stating in the above link “Nutanix is committed to making PowerShell a first-class feature.” I don’t believe them. @Alona, any updates?
Thanks Alona. I would like to clarify that I’m not looking for Nutanix PowerShell cmdlets to integrate with ESXi CLI. I’m saying that it would be nice if Nutanix PowerShell cmdlets had their own version of the Get-EsxCLI command. For example, it would be nice if I there was a cmdlet like, Get-ACLI or Get-NCLI. I could then use that command to get any kind of data that I would from ACLI or NCLI and then take those outputs and use them in my scripts as needed. I’m not a PowerShell expert but some reasons to switch to modules over a snapin: Snapins require installation/registration. Modules don’t. You can autoload modules but not Snapins. Snapins are deprecated/legacy. Snapins lack the ability to explicitly define dependencies. The commands in a module are easier to find. The Get-Command cmdlet gets all commands in all installed modules, even if they are not yet in the session, so you can find a command and use it without importing.
If Nutanix wants to seriously challenge VMware in this space, particularly on a large enterprise level, they need to put in an effort to mature their PowerShell cmdlets a lot more. Also, they should have a module and not the snapins they currently use.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.