Redeploy NSX Edge Gateway Using Rest API

In this post I will demonstrate how to redeploy edge gateway in vCloud Director using Rest API

Disclaimer: This is not any fancy post and I am going to perform very simple task here. Most of you may be already aware of this. This post is for those who are new to API and also a reference post for me for future.

Lets get started.

We have to follow below steps for redeploying an edge gateway using API calls

Step 1: Generate Auth Token

# curl -sik -H “Accept:application/*+xml;version=5.6” -u “admin@system” -X POST https://vcd-b.alex.local/api/sessions | grep auth
Enter host password for user ‘admin@system’:

x-vcloud-authorization: 3fc8a5425f804c9d94eeff04e0272ed7

Step 2: Get Org UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:3fc8a5425f804c9d94eeff04e0272ed7” -X GET https://vcd-a.alex.local/api/org/

<Org href="https://vcd-a.alex.local/api/org/58d92de4-4aa5-4a14-9b39-28e1de5e9809" name="Production" type="application/vnd.vmware.vcloud.org+xml"/>

Step 3: Get vDC UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:3fc8a5425f804c9d94eeff04e0272ed7” -X GET https://vcd-a.alex.local/api/org/58d92de4-4aa5-4a14-9b39-28e1de5e9809 | grep vdc

<Link rel="down" href="https://vcd-a.alex.local/api/vdc/1c32832c-e4db-48b0-9cfc-116fbb302625" name="Prod-DC" type="application/vnd.vmware.vcloud.vdc+xml"/>

Step 4: Get Edge Gateway UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:3fc8a5425f804c9d94eeff04e0272ed7” -X GET https://vcd-a.alex.local/api/vdc/1c32832c-e4db-48b0-9cfc-116fbb302625 | grep edgeGateways

<Link rel="edgeGateways" href="https://vcd-a.alex.local/api/admin/vdc/1c32832c-e4db-48b0-9cfc-116fbb302625/edgeGateways" type="application/vnd.vmware.vcloud.query.records+xml"/>

Step 5: Get Edge Gateway UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:3fc8a5425f804c9d94eeff04e0272ed7” -X GET https://vcd-a.alex.local/api/admin/vdc/1c32832c-e4db-48b0-9cfc-116fbb302625/edgeGateways | grep GW_Name

<EdgeGatewayRecord gatewayStatus="READY" haStatus="DISABLED" isBusy="false" name="Prod-GW" numberOfExtNetworks="1" numberOfOrgNetworks="1" vdc="https://vcd-a.alex.local/api/vdc/1c32832c-e4db-48b0-9cfc-116fbb302625" href="https://vcd-a.alex.local/api/admin/edgeGateway/b37b059b-be98-4806-8535-9bbdcd4b6575" isSyslogServerSettingInSync="true"/> read more

Learning NSX-Part-11-Replacing NSX default SSL Certficates with CA Signed Certificates

I am a big advocate of not using the default SSL certs on any VMware products and I prefer using Signed certs from my CA server on my lab components. I have my CA server running in Windows Server 2012.

Earlier in my lab I had replaced the vSphere (Esxi + vCenter) SSL certs and if you want to know how to do it, you can read them from below links:

1: Replacing Esxi SSL Certificates

2: Replacing vCenter Server SSL Certs

If you are like me and new to replacing SSL certs and looking for how to setup a CA server, you can read it from Here for a step by step installation/configuration of CA server. read more

Learning NSX-Part-10-Upgrade NSX Manager From 6.2 to 6.2.4

This week I was trying my hands on upgrading NSX to version 6.2.4 which was released earlier this year in August.

I had no experience earlier with upgrading NSX manager and associated components, so I spent a lot of time in reading blogs and watching videos on how to perform the upgrade.

Before starting with upgrade process please consult the NSX 6.2.4 Release Notes and also follow VMware KB-2144295 which explains recommended minimum versions for VMware NSX for vSphere, ESXi, vCenter Server and Guest Introspection Driver (GID). read more

Troubleshooting Edge Gateway High Availability

Yesterday I was working on Edge Services Gateway in my Lab and deployed the edge gateway in HA mode. Soon after the deployment when I checked the HA status from vCenter, it reported status as Down

edge-ts-0

To counter any UI bug which might be reporting HA status as down (as this was a brand new deployment), I decided to check the HA status by logging onto edge vm’s directly.

On checking for the HA status on the VM, below message was displayed

Highavalibity healthcheck server is stopped

edge-ts1.PNG

edge-ts2

I did a search on google for this message and didn’t get much results. Then I checked the Admin guide for NSX and came to know the fact that you should have at least one vNIC configured as High availability traffic flows on one of the internal interface. read more

Learning NSX-Part-9-Edge Services Gateway

In last 2 post of the series we discussed about Distributed Logical Router. Moving forward in NSX learning series, we will look into what is Edge Service Gateway and will discuss on when to use edge gateway. We will look into deploying ESG and configuring it and then finally some touch down points on monitoring Edge gateways.

If you have missed earlier posts of this series, you can read them from below links:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

3: Deploying NSX Controllers read more

Learning NSX-Part-8-Installing Distributed Logical Router

In last post of this series we discussed about distributed logical router and went through some important terms and terminologies. In this post we will jump into lab and will deploy logical distributed router.

If you have missed earlier posts of this series, you can read them from below links:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

3: Deploying NSX Controllers

4: Preparing Esxi Hosts and Cluster read more

Learning NSX-Part-7-Distributed Logical Router Tidbits

In last post of this series we discussed about Logical Switching and understood when do we use logical switching. Also we deployed our first logical switch and moved a VM over to the newly created switch.

In this post we will discuss about Distributed Logical Router and look at the terms and terminology associated with it. We will not be diving into lab in this post as I intend to this in next post of this series

If you have missed earlier posts of this series, you can read them from below links:

1: Introduction to VMware NSX read more

Learning NSX-Part-6-Logical Switching and Transport Zones

In last post of this series we briefly looked what is VXLAN (In actual it’s an ocean of knowledge in itself) and also we configured VXLAN on our cluster/hosts.

In this post we will be talking about Logical switching and we will see how to create that and will cover prerequisites part as well.

If you have missed earlier posts of this series, you can read them from below links:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

3: Deploying NSX Controllers

4: Preparing Esxi Hosts and Cluster read more

Learning NSX-Part-5-Configure VXLAN on the ESXi Hosts

In last post of this series we saw how to prepare Esxi host and Cluster for NSX. In this post we will be talking little bit about VXLAN, what are its benefits and how to configure VXLAN on Esxi hosts.

If you have missed earlier posts of this series you can read them from here:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

3: Deploying NSX Controllers

4: Preparing Esxi Hosts and Cluster

Lets start our discussion with what is VXLAN.

Virtual Extensible LAN (VXLAN) is an encapsulation protocol for running an overlay network on existing Layer 3 infrastructure. An overlay network is a virtual network that is built on top of existing network Layer 2 and Layer 3 technologies to support elastic compute architectures. read more

Learning NSX-Part-4-Preparing Esxi Hosts and Cluster

In previous posts of this series, we talked about NSX Manager and NSX Controllers Deployment and also validated NSX Control Cluster status.

If you have missed earlier posts of this series you can read them from here:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

3: Deploying NSX Controllers

In this post we are going to learn about how to prepare Clusters and Esxi Hosts for NSX.

At this point we have NSX manager and controllers ready and established connection between control and management plane. Next step is to prepare cluster and Esxi hosts. read more

Learning NSX-Part-3-Deploying NSX Controllers

In last 2 posts of this series we understood what NSX is and how to install/configure NSX manager.

If you have missed earlier posts of this series, you can read them from below links:

1: Introduction to VMware NSX

2: Installing and Configuring NSX Manager

In this post we will be talking about NSX controllers. Before diving into lab, we will first discuss a little bit theory about NSX controllers and its importance.

NSX Controllers

NSX controllers are the control plane for NSX. They are deployed in a cluster arrangement, so as you deploy these, you can add more controllers for better performance and high availability so that if you loose one of em, you do not loose control functionality. These are important, if you loose enough of these, things stop working. read more

Learning NSX-Part-2-Installing and Configuring NSX Manager

In last post of this series we had a look into what NSX is and how it fits in a software defined datacenter. We also had a look on core NSX components and discussed in brief about them.

In this post we will be talking about basic installation and configuration options of NSX manager.

NSX manager provides a centralized management plane across your datacenter. It provides the management UI and API for NSX. NSX manager runs as a virtual appliance on an ESXi host and during installation it injects a plugin into the vSphere Web Client through which it can be managed.Each NSX Manager manages a single vCenter Server environment. read more

Learning NSX-Part-1-Introduction

VMware NSX is the network virtualization and security platform that emerged from VMware after they acquired Nicira in 2012. This acquisition launched VMware into the software-defined networking (SDN)  and network functions virtualization (NFV) world.

VMware NSX® is a software networking and security virtualization platform that delivers the operational model of a virtual machine for the network. Virtual networks reproduce the Layer2 – Layer7 network model in software, allowing complex multi-tier network topologies to be created and provisioned programmatically in seconds, without the need for additional SoftLayer Private Networks. NSX also provides a new model for network security. Security profiles are distributed to and enforced by virtual ports and move with virtual machines. read more