29 Responses

  1. [VMware] news + interesting reads from the blogosphere: 19 Jan. 2015

    […] Leveraging PowerShell to Deploy Virtual Network Tiers with VMware NSX http://wahlnetwork.com/2015/01/07/leveraging-powershell-deploy-virtual-network-tiers-vmware-nsx/ […]

  2. NSX Link-O-Rama | vcdx133.com
    NSX Link-O-Rama | vcdx133.com at |

    […] Leveraging PowerShell to Deploy Virtual Network Tiers with VMware NSX by Chris Wahl – NEW! […]

  3. nkorte1
    nkorte1 at |

    Love the resources that are available to all of us on GitHub. Thanks for posting your code and your blog Chris.

    Reply
  4. Zsolt Pamuki
    Zsolt Pamuki at |

    Thanks for posting this code.

    Reply
  5. Thomas True
    Thomas True at |

    Great way for network engineers on vSphere to do funny stuff without the need for much networking hardware.

    Reply
  6. Mike Medrano
    Mike Medrano at |

    Another helpful (automation) way brought to us by Powershell and of course with Chris for sharing this article. Ty Chris!

    Reply
  7. Amit
    Amit at |

    Good Information

    Reply
  8. lalit
    lalit at |

    Nice Info

    Reply
  9. Andres Rojas
    Andres Rojas at |

    Thx for the scripts ! very helpfull

    Reply
  10. vervoortjurgen
    vervoortjurgen at |

    thx for article

    Reply
  11. Ravi Venkatasubbaiah
    Ravi Venkatasubbaiah at |

    Great post, Chris!!

    Reply
  12. Using Try and Catch with PowerShell's Invoke-WebRequest - Wahl Network

    […] To combat this, I’ve started using Try and Catch statements in my API calls, such as the line below found in my NSX script. […]

  13. Alessandro
    Alessandro at |

    Tank you Chris

    Reply
  14. ScoZell
    ScoZell at |

    Nice script. Gotta love powershell!

    Reply
  15. Mohammed Sadiq
    Mohammed Sadiq at |

    Hard Work Pays

    Reply
  16. Kevin Parker
    Kevin Parker at |

    Sweet script!

    Reply
  17. Dee Abson
    Dee Abson at |

    Great video discussion. One of these days I’ve got to get my git on…

    Reply
  18. andynashers
    andynashers at |

    More powershell for nsx cool I need to checkout your downloads link

    Reply
  19. richdowling
    richdowling at |

    Hi Chris, i’ve been trying to use your script, but have found that the switches get created and appear in the NSX GUI, but aren’t visible via the NSX API. Have you got any ideas what’s going wrong?

    Reply
    1. richdowling
      richdowling at |

      Aha, never mind, I’d reached the default limit of 20 items shown, had to add ?pagesize=30 to the url see the new items.

      Reply
  20. Rajesh Gundeti
    Rajesh Gundeti at |

    good info

    Reply
  21. richdowling
    richdowling at |

    Hi Chris, I’ve been trying to extend this scripting to update the vnic configuration of an Edge, and keep hitting a wall. There doesn’t seem to be any API way of just changing an Edge vnic, and the way the scripting works with Invoke-WebRequest -> XML it creates an object without the “CreateElement” method, so I can’t add in the extra entries – presumably this is why you’ve ended up creating raw XML. Any suggestions?

    Reply
  22. richdowling
    richdowling at |

    I’ve figured a way of casting to text and back to xml to get it as an xmldocument:
    eg:

    $edge = Invoke-WebRequest -Uri “$uri/api/4.0/edges/$routerid” -Headers $head -ContentType “application/xml” -ErrorAction:Stop
    $edgexml = $edge.Content
    $textxml = $edgexml.innerxml
    $body = $textxml

    The $body is then a fully editable xmldocument rather than the xmlelement you start with.

    Reply
    1. richdowling
      richdowling at |

      $edge = Invoke-WebRequest -Uri “$uri/api/4.0/edges/$routerid” -Headers $head -ContentType “application/xml” -ErrorAction:Stop
      [[xml]]$edgexml = $edge.Content
      $textxml = $edgexml.innerxml
      [[xml]]$body = $textxml

      Reply
  23. richdowling
    richdowling at |

    hmm… doubled the brackets and it just shows them as double. WTF? anyway, I think you get the gist!

    Reply
  24. Tackling Basic RESTful Authentication with PowerShell - Wahl Network

    […] the past, I’ve shown how to write RESTful API calls to VMware NSX and provided some sample code. However, after fielding some questions to folks, I’m taking […]

  25. Leveraging PowerShell to Deploy Virtual Network Tiers with VMware ... | Feed Master

    […] Leveraging PowerShell to Deploy Virtual Network Tiers with VMware NSX — wahlnetwork.com/… […]

Share your point of view!