Automation

 View Only
  • 1.  Dynamically get nsxt manager from vcenter

    Posted 20 days ago

    I've poked around the powercli commands quite a bit, but can't seem to quite get how to do this.

    I want to be able to dynamically get which nsxt manager a vcenter network is connected to.  Its there in the gui under Switch Details, but for the life of me, I don't see how to retrieve it from the vcenter info alone.

    ie all these details, but especially the last one:



  • 2.  RE: Dynamically get nsxt manager from vcenter

    Posted 20 days ago

    Don't you get that info when querying the services registered on the vCenter?



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 3.  RE: Dynamically get nsxt manager from vcenter

    Posted 20 days ago
    Edited by StuDuncanHPE 20 days ago

    Thanks for the pointer.
    Using this script (in answer 1), getting a list of services doesn't seem to show one clearly marked as nsx.
    https://stackoverflow.com/questions/57868636/how-to-list-vcenter-vcsa-services-in-powershell-powercli

    But its very possible I don't know the correct name to look for:

    But also, poking around in the data, I don't see any URIs for any services at all. Just the descriptors above.




  • 4.  RE: Dynamically get nsxt manager from vcenter
    Best Answer

    Posted 20 days ago

    Does this return any useful information?

    $si = Get-View ServiceInstance
    $extMgr = Get-View $si.Content.ExtensionManager
    $extMgr.ExtensionList.where{$_.Key -eq 'com.vmware.nix.management.nsxt'}
    
    


    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 5.  RE: Dynamically get nsxt manager from vcenter

    Posted 20 days ago

    That worked!

    Tweaked by adding ".Server.Url[0]" to the end of the last command, and I just get the URL to the NSXT server.

    Sweet!

    Thanks for the help, because not a chance I'd figure this out.