IBM Cloud Docs
Monitoring for VMware vCenter Server deployments

Monitoring for VMware vCenter Server deployments

You can add monitoring capabilities to VMware vCenter Server deployments by configuring the VMware vCenter Exporter for Prometheus and a monitoring agent on a Linux server. Performance data of vCenter Server, clusters, ESXi hosts, and Virtual Machines that are collected from your vSphere environment are sent to IBM Cloud Monitoring for analysis, troubleshooting, and alerting.

VMware vCenter Server® is a hosted private cloud that delivers the VMware vSphere® stack as a service. The VMware® environment is built in addition to a minimum of three IBM Cloud® bare metal servers and it offers shared network-attached storage and dedicated software-defined storage options. It also includes the automatic deployment and configuration of an easy-to-manage logical edge firewall, which VMware NSX® powers. For more information, see vCenter Server overview.

The following graphic depicts the high-level architecture and components of a three node vCenter Server with NSX-T deployment.

Architecture of a vCenter Server NSX-T deployment
Architecture of a vCenter Server NSX-T deployment

Metrics

With the VMware vCenter Exporter for Prometheus, you can collect the following performance metrics:

  • VMware Host time series
  • VMware Datastore time series
  • VMware VM guest time series per VM partition
  • VMware VM time series per VM

Prereqs

  • You must have access to a Monitoring instance in your account where you plan to monitor and manage the metrics that are collected from your VMware vCenter deployment. You also need the access key to configure the agent to send metrics to this instance, and the region where the instance is provisioned. For more information, see Getting started with IBM Cloud Monitoring.

  • You need the vSphere user ID and password, and the vSphere vCenter IP address to configure the VMware vCenter Exporter for Prometheus.

  • Check the topic Tune Agent

  • Learn more about the VMware vCenter Exporter for Prometheus.

Step 1. Configure the Linux server

You need to provision a Linux server where you will configure the Monitoring agent and the VMware vCenter Exporter for Prometheus. For example, you can use a Linux server such as a Red Hat VSI.

You can deploy the Monitoring agent for non-orchestrated environments and pay for the metrics that you configure thorugh the exporter, or deploy the agent for orchestrated environments that gives you an entitlement of 1000 time series per hour included in the price. For more information on agents, see Collecting default metrics by using the Monitoring agent.

The instructions in this topic are based on a Red Hat VSI.

Provision a Linux VPC server instance

Configure a Linux server to collect metrics from your VMware vCenter to forward the metrics to a Monitoring instance.

  1. Provision a bare metal server.

    To complete the steps in this topic, ensure you have internet access from the bare metal server.

  2. Configure a VPN connection between your terminal and the bare metal server.

    Virtual Private Networking (VPN) access enables users to manage all servers remotely and securely over the IBM Cloud private network. A VPN connection from your location to the private network allows out-of-band management and server rescue through an encrypted VPN tunnel. VPN tunnels can be initiated to any IBM Cloud data center or PoP allowing you geographic redundancy.

    Complete the following steps to configure a VPN connection between your terminal and the bare metal server:

    1. Enable VPN access on each account that needs VPN access.

    2. Depending on your operating system, download the latest MotionPro 32-bit or 64-bit files from the Array Networks Clients and Tools download site. Learn more.

    3. Configure a standalone SSL VPN client and open a connection:

    For example, if you use the MotionPro Plus client for MacOS, click Add to add a profile.

    In the Basic section, enter a Title. Enter a Gateway, for example, for a bare metal in Dallas 10, enter vpn.dal10.softlayer.com. Enter your VPN user name. Check that the Port is set to 443. Then, click OK.

    To open a secure connection, click Login.

  3. Connect to a bare metal server by using SSH

    You might require a VPN to access your system depending on your security setup and ssh configuration on the bare metal host.

    You must use ssh to connect to the host by using your credentials, or the root credentials that are available from the IBM Cloud Console.

    You will require root permissions to install the monitoring agent.

    For example, you can complete the following steps to get the bare metal server information that you need to use the ssh command to access the server:

    1. Log in to your IBM Cloud account.

    2. Click the Menu icon Menu icon > Classic Infrastructure > Device List.

    3. Identify the bare metal server that you want to monitor. Copy the Public IP.

    4. Click the bare metal server device name.

    5. Select Passwords. Copy the password for the root user.

      Then, from a terminal, run the following command:

      ssh <USER_ID>@<IP_ADDRESS>
      

      Where:

      <USER_ID> is the user ID that you use to log in to the bare metal server. For example, root.

      <IP_ADDRESS> is the public IP address of the bare metal server.

      For example: ssh root@45.123.122.12

Deploy the Monitoring agent

Complete the following steps to configure a Monitoring agent on the Linux server. The agent collects metrics from your VMware vCenter deployment and forwards them to a Monitoring instance in your account.

  1. Obtain the access key.

  2. Obtain the public or private ingestion URL. For more information, see collector endpoints.

  3. Install the kernel headers.

    When you install a monitoring agent, the agent uses kernel header files. Learn more

    Choose a distribution and run the following command for that distribution.

    For Debian and Ubuntu Linux distributions, run the following command:

    apt-get -y install linux-headers-$(uname -r)
    

    For RHEL, CentOS, and Fedora Linux distributions, run the following command:

    yum -y install kernel-devel-$(uname -r)
    
  4. Deploy the monitoring agent for non-orchestrated environments. Run the following command from a terminal.

    curl -sL https://ibm.biz/install-sysdig-agent | sudo bash -s -- --access_key MONITORING_ACCESS_KEY --collector COLLECTOR_ENDPOINT --collector_port 6443  --tags TAG_DATA --additional_conf 'sysdig_capture_enabled: false\nfeature:\n    mode: monitor_light'
    

    Where

    • MONITORING_ACCESS_KEY is the ingestion key for the instance.

    • COLLECTOR_ENDPOINT is the public or private ingestion URL for the region where the monitoring instance is available. To get an endpoint, see Collector endpoints. For example, for US-South, the endpoint is ingest.private.us-south.monitoring.cloud.ibm.com.

    • TAG_DATA is a list of comma-separated tags that are formatted as TAG_NAME:TAG_VALUE. You can associate one or more tags to your monitoring agent. For example, type:VMware,location:us-south.

    To install cURL, run yum -q -y install curl for RHEL, CentOS, and Fedora Linux distributions.

  5. Check that the monitoring agent is running. Run the following command:

    ps -ef | grep sysdig
    

    To see the latest monitoring agent logs, go to the directory /opt/draios/logs and check the log file draios.log.

    To look for errors, you can run the following command:

    grep error /opt/draios/logs/draios.log
    

Configure the Monitoring agent

You must configure the Monitoring agent to forward the Prometheus metrics that the VMware vCenter Exporter for Prometheus collects.

Complete the following steps:

  1. In the /opt/draios/etc directory, create a prometheus.yaml file with the following information:

    global:
      scrape_interval: 60s
    scrape_configs:
      - job_name: vmware-exporter
        static_configs:
          - targets: ['localhost:9272']
            labels:
              type: vmdemo
    
  2. Restart the agent to activate the changes. Run the following command:

    service dragent restart
    

Deploy the VMware vCenter Exporter for Prometheus

To deploy and run the VMware vCenter Exporter for Prometheus, you must have Python version 3.6 or higher.

Complete the following steps to deploy and configure the VMware vCenter Exporter for Prometheus on a Linux server:

  1. Install python 3. Run the following command:

    dnf install python3-pip
    

    If you get the error message vmware exporter ModuleNotFoundError: No module named 'attrs', run the following command:

    pip install --upgrade attrs
    
  2. Install the VMware vCenter Exporter. Run the following command:

    pip install vmware_exporter
    
  3. Create the directory /usr/monitoring. Run the following commands:

    mkdir /usr/monitoring
    
  4. Create a config.yml file. Run the following commands:

    default:
        vsphere_host: "VMware vCenter IP address"
        vsphere_user: "vCenter user ID"
        vsphere_password: "vCenter password"
        ignore_ssl: False
        specs_size: 5000
        fetch_custom_attributes: True
        fetch_tags: True
        fetch_alarms: True
        collect_only:
            vms: True
            vmguests: True  # For Linux based VMs: Set to false to collect metrics by deploying a Monitoring agent on the VM.
            datastores: True
            hosts: True
            snapshots: True
    

The VMware vCenter Exporter for Prometheus is deployed in /usr/local/bin/vmware_exporter/.

Then, change the permissions of the file:

chmod 777 vmware_exporter.service

Run the VMware vCenter Exporter for Prometheus as a service

Complete the following steps to run the VMware vCenter Exporter for Prometheus as a service in your Linux server:

  1. Create a vmware_exporter.service file under /etc/systemd/system.

    vi /etc/systemd/system/vmware_exporter.service
    
    [Unit]
    Description=VMware Exporter
    After=network.target
    
    [Service]
    User=root
    Group=root
    Restart=always
    Type=simple
    ExecStart=/usr/local/bin/vmware_exporter --config /usr/monitoring/config.yml
    
    [Install]
    WantedBy=multi-user.target
    

    Change the permissions on the file.

    chmod 777 /usr/monitoring/config.yml
    
  2. Reload the system daemon. Run the following command:

    systemctl daemon-reload
    
  3. Enable the vmware_exporter.service. Run the following command:

    systemctl enable vmware_exporter.service
    
  4. Start the service. Run the following command:

    systemctl start vmware_exporter.service
    

To stop the service, you can run systemctl stop vmware_exporter.service.

To see the status of the service, you can run systemctl status vmware_exporter.service.

To get the list of metrics that are collected, you can run the following cURL command: curl localhost:9272/metrics.

Step 2. Define your dashboards

Create a dashboard to monitor your VMware deployment. You can use the Applications > VMWare Overview template in the Dashboard Library to configure your dashboard.