Download PDF
Download page VMware vCenter Integration.
VMware vCenter Integration
This page describes the resource requirements, compatibility with different Docker®-based software, and the specifications required to integrate VMware vCenter with Cisco Observability Platform.
VMware vSphere is a virtualization platform that transforms data centers into aggregated computing infrastructures that include CPU, storage, and networking resources. vCenter Server is a core component of VMware vSphere that allows you manage multiple hosts connected in a network and pool host resources. You can integrate VMware vCenter with Cisco Observability Platform to view the metrics data on the Cisco Observability Platform UI.
The vCenter collector collects the VMware monitoring metrics for cluster, network, host, datastore, resource_pool, storage and Virtual Machines (VM).
To monitor the VMware data, you require:
- vCenter collector: Install this collector in the required virtual machine to collect the data from that machine to the Cisco Observability Platform.
- aiopscore solution: When you subscribe to AIOps module, this solution is added by default. This solution includes the files with all the configurations that determine what all entities and their correlation gets displayed on the UI.
This document contains references to the Docker documentation. Cisco does not own any rights and assumes no responsibility for the accuracy or completeness of such third-party documentation.
Before You Begin
Before installing vCenter collector for data ingestion, ensure that you meet the following requirements:
You are connected to vCenter from the server. Run the following command to verify:
$sudo telnet vcenterserver
CODE- You have sudo privileges on the server to run the Docker commands
You have vCenter collector authentication credentials
vCenter collector is required to export the data from collector to the Cisco Observability Platform. The collector requires
client_id
,client_secret
andtoken_url
. Contact your Cisco Observability Platform administrator for the OAuth credentials.(Conditional) To use FSOC queries to validate the data ingestion, ensure that you:
- install FSOC on your device by using the instructions to Install and Configure FSOC.
- configure the profile to FSO API using auth credentials
Software Requirements
The vCenter collector can run in hybrid (Linux and Windows) or Linux-only clusters. The vCenter collector requires:
- VMware >= v6.5
- Docker >= 18.09.2
- Docker-compose with sufficient licenses
- Access to the following components:
Name | URL |
---|---|
Docker | https://docs.docker.com/engine/install/ |
docker compose | https://docs.docker.com/compose/install/ |
Install vCenter Collector
The Cisco Observability Platform uses the OpenTelemetry Protocol as its native MELT telemetry data format. It uses the Common Ingestion Services to provide the endpoints for the OTLP telemetry data ingestion. Perform the following steps to install vCenter collector on a Docker container:
- Ensure that your environment meets the Software Requirements.
- Log in to the server where you require to install the collector.
- Setup Docker and Docker compose on the server. See, Docker and Docker Compose.
Validate the Docker and Docker Compose versions.
Validate-Example
$sudo docker -v
CODE$sudo docker compose version
CODE
Following is an example output:Example-output
$sudo docker -v Docker version 23.0.1, build a5ee5b1 $sudo docker compose version Docker Compose version v2.16.0
CODEOpen JFrog and go to the location maven-releases>com>appdynamics>aiops>aiops-agt-vmware to download the latest files of vCenter collector.
- On the
collector-config-vcenter.yaml
file, update the following details. This is the yaml file where all the mandatory configuration must be updated. The yaml file contains vCenter and the platform properties. You must update the required values to connect to vCenter and send metrics to vCenter collector API.Update vCenter connection details in the configuration.
vcenter: endpoint: <endpoint> username: <user> password: <password> collection_interval: 1m tls: insecure: true
CODEUpdate the vCenter collector API endpoint for sending metrics and events to Cisco Observability Platform.
exporters: otlphttp/withauth: endpoint: https://<tenant_name>.observe.appdynamics.com/data auth: authenticator: oauth2client
CODEUpdate the Cisco Observability Platform oauth credentials in extensions
extensions: oauth2client: client_id: "***************" client_secret: "*******************" token_url: "https://<tenant_name>.observe.appdynamics.com/auth/********************/default/oauth2/token" timeout: 60s
CODEYou can update the timeout value. Consider the timeout setting based on the number of applications and resources running on the VMware cluster.
Run the docker compose command to start the container and send metrics to Cisco Observability Platform.
$sudo docker compose up -d
CODEValidate the Container status.
$ docker ps
CODEThe output is similar to the following:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cf76da77999c otel/opentelemetry-collector-contrib:0.88.0 "/otelcol-contrib --…" 11 days ago Up 11 days 0.0.0.0:5556->5556/tcp, :::5556->5556/tcp, 4317/tcp, 55678-55679/tcp, 0.0.0.0:6667->6667/tcp, :::6667->6667/tcp vcenter-collector
CODE
Validate vCenter Data
After installing the vCenter collector, you need to validate the metrics and events that are ingested into the Cisco Observability Platform. You can validate the data by using either Query Builder or fsoc.
Data Validation using Query Builder
You can validate the data by using Query Builder. Open Query Builder and enter the following query:
fetch events(aiopscore:vmware_event) { attributes} order events.desc() limits events.count(50) since -1h until now()
Data Validation using FSO CLI (FSOC)
You can validate the data by using FSOC. To use FSOC, see Install and Configure FSOC and configure the profile to vCenter collector API using authentication credentials.
Perform the following to validate if the latest data is getting included through the collector:
Setup the FSOC profile using the service principle JSON file (secret file) provided by your company administrator.
$sudo fsoc config set --profile <name-of-your-profile> --secret-file <name-of-secret-file>
CODEFor example,
$sudo fsoc config set --profile demo --secret-file ciscoitdemo-access.json
CODEUse the profile using fsoc config command.
$sudo fsoc config use --profile <name-of-your-profile>
CODEFor example,
$sudo fsoc config use --profile demo
CODERun UQL queries after successfully setting up FSOC profile.
For information about UQL queries, see the Unified Query Language User Guide.This is an example query and output:
$sudo <user> resources % fsoc uql "fetch events(aiopscore:vmware_event) { attributes} order events.desc() limits events.count(50) since -1h until now()" ✓ Platform API call (POST /monitoring/v1/query/execute) events attributes name | value ================================================================================================ aiopscore.vmware_event.alarm_name | AiOps VM CPU Usage - V1 appd.event.type | aiopscore:vmware_event aiopscore.vm.type | vm description | raw message appd.isevent | true aiopscore.vmware_event.severity | Normal reason | raw text aiopscore.vmware_event.object | aiops-lab-dev1 severity | Normal _parsing_status | false aiopscore.vm.hostname | aiops-lab-dev1 aiopscore.display_name | AiOps VM CPU Usage - V1 parsing_error_or_warnings | Missing mandatory parsing attribute _message_parser.type. namespace | aiopscore subtype | text telemetry.sdk.name | aiops-fsoc-exporter aiopscore.vmware_event.object_type | Host ------------------------------------+----------------------------------------------------------- aiopscore.vmware_event.alarm_name | AiOps VM CPU Usage - V1 appd.event.type | aiopscore:vmware_event aiopscore.vm.type | vm description | raw message appd.isevent | true aiopscore.vmware_event.severity | Critical reason | raw text aiopscore.vmware_event.object | aiops-lab-dev1 severity | Critical _parsing_status | false aiopscore.vm.hostname | aiops-lab-dev1 aiopscore.display_name | AiOps VM CPU Usage - V1 parsing_error_or_warnings | Missing mandatory parsing attribute _message_parser.type. namespace | aiopscore subtype | text telemetry.sdk.name | aiops-fsoc-exporter aiopscore.vmware_event.object_type | Host ------------------------------------+-----------------------------------------------------------
CODE
Data Ingestion
In VMware, you can use environment variables in a script and attach them to multiple alarms. See VMware Documentation.
The following table provides the mapping between the environment variables available in Cisco Observability Platform and VMware that you can use in your script:
Cisco Observability Platform Attributes | VMware Attributes | Description | Alarm Types |
---|---|---|---|
aiopscore.vmware_event.alarm_name | VMWARE_ALARM_NAME | The name of the triggered alarm. | Condition, State, and Event |
aiopscore.vmware_event.alarm_id | VMWARE_ALARM_ID | The MOID of the triggered alarm. | Condition, State, and Event |
aiopscore.vmware_event.target_name | VMWARE_ALARM_TARGET_NAME | The name of the entity on which the alarm triggered. | Condition, State, and Event |
aiopscore.vmware_event.target_id | VMWARE_ALARM_TARGET_ID | The MOID of the entity on which the alarm triggered. | Condition, State, and Event |
aiopscore.vmware_eventoldstatus | VMWARE_ALARM_OLDSTATUS | The old status of the alarm. | Condition, State, and Event |
aiopscore.vmware_event.newstatus | VMWARE_ALARM_NEWSTATUS | The new status of the alarm. | Condition, State, and Event |
aiopscore.vmware_event.triggering_summary | VMWARE_ALARM_TRIGGERINGSUMMARY | A multiline summary of the alarm. | Condition, State, and Event |
aiopscore.vmware_event.declaring_summary | VMWARE_ALARM_DECLARINGSUMMARY | A single-line declaration of the alarm expression. | Condition, State, and Event |
aiopscore.vmware_event.alarm_value | VMWARE_ALARM_ALARMVALUE | The value that triggered the alarm. | Condition and State |
aiopscore.vmware_event.event_description | VMWARE_ALARM_EVENTDESCRIPTION | A description of the alarm status change event. | Condition and State |
aiopscore.vmware_event.event_username | VMWARE_ALARM_EVENT_USERNAME | The user name associated with the event. | Event |
aiopscore.vmware_event.event_datacenter | VMWARE_ALARM_EVENT_DATACENTER | The name of the data center in which the event occurred. | Event |
aiopscore.vmware_event.event_computer_resource | VMWARE_ALARM_EVENT_COMPUTERESOURCE | The name of the cluster or resource pool in which the event occurred. | Event |
aiopscore.vmware_event.event_host | VMWARE_ALARM_EVENT_HOST | The name of the host on which the event occurred. | Event |
aiopscore.vmware_event.event_vm | VMWARE_ALARM_EVENT_VM | The name of the virtual machine on which the event occurred. | Event |
aiopscore.vmware_event.event_network | VMWARE_ALARM_EVENT_NETWORK | The name of the network on which the event occurred. | Event |
aiopscore.vmware_event.event_datastore | VMWARE_ALARM_EVENT_DATASTORE | The name of the datastore on which the event occurred. | Event |
aiopscore.vmware_event.event_dvs | VMWARE_ALARM_EVENT_DVS | The name of the vSphere Distributed Switch on which the event occurred. | Event |
Script
Use the following script to send alarm events from VMware to Cisco Observability Platform:
#!/usr/bin/env python
import requests
import json
import os,sys
import getpass
print("myuser",getpass.getuser())
#sys.stderr = open('/var/local/vc_errors.txt','a')
def get_access_token(url, client_id, client_secret):
response = requests.post(
url,
data={
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret":client_secret
}
)
print("auth_token response: ", response)
return response.json()["access_token"]
def generate_payload():
output=[]
data={}
data["route"] = "vm"
data['aiopscore.vmware_event.alarm_id'] = os.getenv('VMWARE_ALARM_ID')
data["aiopscore.vmware_event.alarm_name"] = os.getenv('VMWARE_ALARM_NAME')
data["aiopscore.vmware_event.object"] = os.getenv('VMWARE_ALARM_TARGET_NAME')
data["aiopscore.vmware_event.object_type"] = "VM"
data["aiopscore.vmware_event.severity"] = os.getenv('VMWARE_ALARM_NEWSTATUS')
data["aiopscore.vmware_event.triggered_time"] = ""
data["aiopscore.vmware_event.acknowledged_time"] = ""
data["aiopscore.vmware_event.acknowledged_by"] = ""
data["aiopscore.vmware_event.event_description"] = os.getenv('VMWARE_ALARM_EVENTDESCRIPTION')
data["aiopscore.vmware_event.alarm_value"] = os.getenv('VMWARE_ALARM_ALARMVALUE')
data['aiopscore.vmware_event.event_compute_resource'] = os.getenv('VMWARE_ALARM_EVENT_COMPUTERESOURCE')
data['aiopscore.vmware_event.triggering_summary'] = os.getenv('VMWARE_ALARM_TRIGGERINGSUMMARY')
data["aiopscore.vmware_event.target_id"] = os.getenv('VMWARE_ALARM_TARGET_ID')
data["aiopscore.vmware_event.alarm_old_status"] = os.getenv('VMWARE_ALARM_OLDSTATUS')
data['aiopscore.vmware_event.alarm_new_status'] = os.getenv('VMWARE_ALARM_NEWSTATUS')
data['aiopscore.vmware_event.declaring_summary'] = os.getenv('VMWARE_ALARM_DECLARINGSUMMARY')
data['aiopscore.vmware_event.event_username'] = os.getenv('VMWARE_ALARM_EVENT_USERNAME')
data['aiopscore.vmware_event.event_host'] = os.getenv('VMWARE_ALARM_EVENT_HOST')
data['aiopscore.vmware_event.event_vm'] = os.getenv('VMWARE_ALARM_EVENT_VM')
data['aiopscore.vmware_event.event_network'] = os.getenv('VMWARE_ALARM_EVENT_NETWORK')
data['aiopscore.vmware_event.event_datastore'] = os.getenv('VMWARE_ALARM_EVENT_DATASTORE')
data['aiopscore.vmware_event.event_dvs'] = os.getenv('VMWARE_ALARM_EVENT_DVS')
output.append(data)
return output
def publish_events():
endpoint = os.getenv("endpoint")
tenant = os.getenv("tenant")
auth_url = "https://{}/auth/{}/default/oauth2/token".format(endpoint, tenant)
url = "https://{}/rest/aiopsservices/webhook/api/v1/events".format(endpoint)
client_id = os.getenv("client_id")
client_secret = os.getenv("client_secret")
token = get_access_token(auth_url, client_id, client_secret)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {}'.format(token)
}
print(headers)
data=generate_payload()
print(json.dumps(data))
response = requests.post(url, data=json.dumps(data), headers=headers)
print(response.text)
#publish_events()
if __name__ == "__main__":
publish_events()
Next Steps
- Monitor the VMware entities.
Third party names, logos, marks, and general references used in these materials are the property of their respective owners or their affiliates in the United States and/or other countries. Inclusion of such references are for informational purposes only and are not intended to promote or otherwise suggest a relationship between Cisco AppDynamics and the third party.