Exploring vSphere 6.5 API-Part 3: Esxi Host

In last 2 post of this series, we learn about digging out info about datacenter,cluster and virtual machines.

In this post we will learn about API options available for Esxi hosts.

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

1: Exploring vSphere 6.5 API-Datacenter & Cluster

2: Exploring vSphere 6.5 API-Virtual Machines

Let’s get started with fetching info about esxi hosts.

1: List all hosts present in a vCenter

Following query will list all esxi hosts that are present across all cluster/datacenter which are there in a vcenter.

# curl -sik -H ‘Accept: application/json’ -H ‘vmware-api-session-id: 7c639fb1e988b4c59dd77adef4c5d06c’ -X GET https://vcentersrv01.alex.local/rest/vcenter/host

Output
[code]
{“host”:”host-28″,”name”:”esxi01.alex.local”,”connection_state”:”CONNECTED”,”power_state”:”POWERED_ON”}

{“host”:”host-31″,”name”:”esxi02.alex.local”,”connection_state”:”CONNECTED”,”power_state”:”POWERED_ON”}

{“host”:”host-33″,”name”:”esxi03.alex.local”,”connection_state”:”CONNECTED”,”power_state”:”POWERED_ON”}

{“host”:”host-35″,”name”:”esxi04.alex.local”,”connection_state”:”CONNECTED”,”power_state”:”POWERED_ON”}

[/code]

 

2: List all host in a specific datacenter

You can limit search of esxi host to specific datacenter by using filter.datacenters option

# curl -sik -H ‘Accept: application/json’ -H ‘vmware-api-session-id: 7c639fb1e988b4c59dd77adef4c5d06c’ -X GET
https://vcentersrv01.alex.local/rest/vcenter/host?filter.datacenters=datacenter-2

3: List all hosts in a specific cluster

# curl -sik -H ‘Accept: application/json’ -H ‘vmware-api-session-id: 7c639fb1e988b4c59dd77adef4c5d06c’ -X GET https://vcentersrv01.alex.local/rest/vcenter/host?filter.clusters=domain-c7Read More

Exploring vSphere 6.5 API-Part 2: Virtual Machines

In last post of this series we looked into some basic Rest API’s to fetch info about datacenter and cluster.

In this post we will explore API options for virtual machines. Out of all the components like host, cluster etc, max number of available API options are for virtual machines.

Let’s start with figuring out available options:

To start exploring the different API options available for virtual machine, you can use below query:

1: List all VM’s in all datacenter

Output of above query will give you VM ID, cpu/memory stats, VM name and their power status.

2: List Powered off VM’s

You can list all powered off VM’s in datacenter using the filter power_states in above query.… Read More

Exploring vSphere 6.5 API-Part 1: Datacenter & Cluster

I am using API for quite a bit now in our prod environment which is based on vCloud Director and many times API’s had proved a handy way to troubleshoot issues where GUI was not providing a way to proceed.

Inspired by vCD API’s, i decided to test that in my vSphere 6.5 lab and in this post I will try to demonstrate few queries which can be helpful in fetching info in your infrastructure.

In my lab I am exploring REST API’s using a linux tool called curl.

1: You can browse list of API’s by browsing https://vcenter-fqdn/ and clicking on “Browse vSphere Rest API’s”

 

2: To start with you can use below query to see what are the different options available

# curl -sik -H ‘Accept:application/json’ -u “vc-user” -X GET https://vcenter-fqdn/rest/

You will see below URL’s in output:

3: You can list the available components which can be explored via REST API by using below query

# curl -sik -H ‘Accept:application/json’ -u “vcadmin@alex” -X GET https://vcentersrv03.alex.local/rest/com/vmware/vapi/rest/navigation/componentRead More

Learning vSphere 6.5-Part-10-VCHA failover testing

Last 2 post of this series were revolving around the high availability feature for vCenter that is introduced in vSphere 6.5 and we discussed the VCHA architecture and also learnt how to configure VCHA.

In this post we will be testing the HA feature and will see what happens when the Active Node of VCHA cluster goes down.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

5: Installing vCenter Server on Windows

6: Deploying vCSA with embedded PSC

7: Deploying External PSC for vCSA

8: Understanding vCenter Server High Availability (VCHA)

9: Configuring vCenter Server High Availability (VCHA)

Lets jump into lab and test this awesome feature.

We will be testing failover via 2 method:

  • Automated failover (let system do the magic)
  • Manual failover (user will intentionally bring down active node of VCHA cluster)

Automated Failover Testing

1: To test the failover, login to vCenter web client and navigate to Configuration > vCenter HA and before performing a failover look at the Active/Passive node info and note which IP is active at the moment.… Read More

Learning vSphere 6.5-Part-9-Configuring vCenter Server High Availability (VCHA)

In last post of this series we discussed about the High Availability feature for vCenter 6.5 and saw the architecture of VCHA and how it works. In this post we will go ahead and actually configures that in lab.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

5: Installing vCenter Server on Windows

6: Deploying vCSA with embedded PSC

7: Deploying External PSC for vCSA

8: Understanding vCenter Server High Availability (VCHA)

Before jumping into lab and start configuring VCHA, its important to understand the deployment options and prerequisites  for VCHA first.

vCenter HA Deployment Options

You can set up your vCenter HA environment with an embedded PSC or with an external PSC. If you decide to use an external Platform Services Controller, you can place it behind a load balancer for protection in case of Platform Services Controller failure.… Read More

Learning vSphere 6.5-Part-8-Understanding vCenter Server High Availability (VCHA)

In last post of this series learned how to External PSC for vCSA. In this post of vSphere 6.5 series, we will look into one of the best feature which is included in v 6.5 i.e high availability for vCenter Server.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

5: Installing vCenter Server on Windows

6: Deploying vCSA with embedded PSC

7: Deploying External PSC for vCSA

Customers were demanding a lot for high availability solution for vCenter Server for quite some time and VMware listened to customers and made this happen in version 6.5 of vSphere.

What is vCenter High Availability (VCHA)?

vCenter High Availability (vCenter HA) protects vCenter Server Appliance against host and hardware failures. The active-passive architecture of the solution can also help you reduce downtime significantly when you patch vCenter Server Appliance.… Read More

Learning vSphere 6.5-Part-7-Deploying External PSC for vCSA

This is part 7 of the vSphere 6.5 learning series and in last part of this series we learned how to install vCSA with embedded PSC and touched on some basic settings which is needed to be done post deployment.

In this post we will learn how to deploy external PSC for vCSA. The goal here is to deploy external PSC first and then install vCSA which will use the external PSC.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

5: Installing vCenter Server on Windows

6: Deploying vCSA with embedded PSC

In last post we discussed and saw how easy VMware has made deployment process of vCSA and the process has changed a bit. The steps needed to deploy external PSC is no different then what we learned in last post.… Read More

Learning vSphere 6.5-Part-6-Deploying vCSA with embedded PSC

In last post of this series we learnt how to install vCenter with embedded PSC on windows server.

In this post we will learn about deploying and configuring vCSA with embedded PSC.

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

1: Installing and Configuring ESXi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

5: Installing vCenter Server on Windows

In vSphere 6.5 VMware has made the installation of vCenter appliance a lot easier than before. Earlier, deployment of vCSA needed client integration plugin to be installed on your system and the deployment was done through a browser. Client integration plugin had multiple compatibility issues. Now with vSphere 6.5 client integration plugin is no longer required. The deployment is going to be via an ISO which would have an installation wizard that can be executed on Windows, MAC or Linux.… Read More

Learning vSphere 6.5-Part-5-Installing vCenter Server on Windows

Till now in this series we have discussed a lot of theory about vCenter Server/VCSA, deployment type etc and also we looked into system requirements for vCenter Server and PSC installation. Now its lab time where we will see the installation/configuration of the components.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

4: System Requirements for Installing vCenter Server

In my lab I am going to use an external SQL server database. My database version is SQL 2014.

1: Preparing vCenter Server Databases for Install

You can use following script to install the database and configure login,permission etc. This script will also configure the database schema for you

 

[code]
/ *** Create a SQL Server Database and User for vCenter Server *** /

use [master]
go
CREATE DATABASE [VCDB] ON PRIMARY
(NAME = ‘vcenter65’,
FILENAME = ‘C:Program FilesMicrosoft SQL ServerMSSQL12.MSSQLSERVERMSSQLDATAvcenter65.mdf’,… Read More

Learning vSphere 6.5-Part-4-System Requirements for Installing vCenter Server

In last post of this series we discussed about various deployment models available for deploying vCenter Server and PSC. In this post we will look into minimum system requirements  that must be met for installing windows based vcenter Server.

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

1: Installing and Configuring Esxi

2: VCSA Overview

3: vCenter Server and PSC Deployment Types

vCenter Server for Windows Requirements

To install vCenter Server on a windows, following hardware and software requirements must be met:

1: NTP ready environment : Clocks must be synchronized on the virtual machines where vCenter Server and PSC will be deployed. I previously wrote a blog on configuring Domain controller as NTP and you can read the article from here

2: Environment should be DNS Ready: Make sure you can successfully resolve hostnames of the servers. Also ensure Name to IP and IP to name resolution is happening fine for all the servers.… Read More