# CPU Total/Free Virtual Machine with vSphere Module \[Metricbeat 7.15.2\]

**URL:** <https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 17, 2021, 12:38pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449 "2021-11-17T12:38:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RdrgPorto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdrgporto/32/13278_2.png) [@RdrgPorto](https://discuss.elastic.co/u/RdrgPorto)\
**Post date:** [November 17, 2021, 12:38pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/1 "2021-11-17T12:38:45Z")

</div>

Hi, everyone

I have configured **vSphere module in Metricbeat 7.15.2** in order to get metrics from my **VMware hosts and VMs**.

**Metricbeat** send **all VM memory metrics** , here you are:

```auto
vsphere.virtualmachine.memory.free.guest.bytes: 7.9GB
vsphere.virtualmachine.memory.total.guest.bytes: 8GB
vsphere.virtualmachine.memory.used.guest.bytes: 81MB
vsphere.virtualmachine.memory.used.host.bytes: 1.6GB

```

However, regarding **VM cpu metrics** , **Metricbeat**  **not send all** , here you are:

```auto
vsphere.virtualmachine.cpu.used.mhz: 540

```

Is it possible to **get more cpu VM metrics with vSphere Module**?

Thanks in advance 😃 ,

Regards

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [November 17, 2021, 1:06pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/2 "2021-11-17T13:06:38Z")

</div>

It all depends on what the VSphere GoLang sdk can pull.

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [November 17, 2021, 1:39pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/3 "2021-11-17T13:39:13Z")

</div>

Here is the list of stats that can be exposed via the SDK, some of which are already captured.

```auto
	OverallCpuUsage int32 `xml:"overallCpuUsage,omitempty"`
	OverallCpuDemand int32 `xml:"overallCpuDemand,omitempty"`
	GuestMemoryUsage int32 `xml:"guestMemoryUsage,omitempty"`
	HostMemoryUsage int32 `xml:"hostMemoryUsage,omitempty"`
	GuestHeartbeatStatus ManagedEntityStatus `xml:"guestHeartbeatStatus"`
	DistributedCpuEntitlement int32 `xml:"distributedCpuEntitlement,omitempty"`
	DistributedMemoryEntitlement int32 `xml:"distributedMemoryEntitlement,omitempty"`
	StaticCpuEntitlement int32 `xml:"staticCpuEntitlement,omitempty"`
	StaticMemoryEntitlement int32 `xml:"staticMemoryEntitlement,omitempty"`
	PrivateMemory int32 `xml:"privateMemory,omitempty"`
	SharedMemory int32 `xml:"sharedMemory,omitempty"`
	SwappedMemory int32 `xml:"swappedMemory,omitempty"`
	BalloonedMemory int32 `xml:"balloonedMemory,omitempty"`
	ConsumedOverheadMemory int32 `xml:"consumedOverheadMemory,omitempty"`
	FtLogBandwidth int32 `xml:"ftLogBandwidth,omitempty"`
	FtSecondaryLatency int32 `xml:"ftSecondaryLatency,omitempty"`
	FtLatencyStatus ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"`
	CompressedMemory int64 `xml:"compressedMemory,omitempty"`
	UptimeSeconds int32 `xml:"uptimeSeconds,omitempty"`
	SsdSwappedMemory int64 `xml:"ssdSwappedMemory,omitempty"`

```

---

<div class="post-metadata">

**Author:** ![RdrgPorto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdrgporto/32/13278_2.png) [@RdrgPorto](https://discuss.elastic.co/u/RdrgPorto)\
**Post date:** [November 18, 2021, 9:16am UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/4 "2021-11-18T09:16:37Z")

</div>

Hi,

Thank you 🙂

Regards

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [November 18, 2021, 12:13pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/5 "2021-11-18T12:13:34Z")

</div>

Did u have items on that list u think should be added to the documents? I can make a PR to add them?

---

<div class="post-metadata">

**Author:** ![RdrgPorto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdrgporto/32/13278_2.png) [@RdrgPorto](https://discuss.elastic.co/u/RdrgPorto)\
**Post date:** [November 23, 2021, 10:26am UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/6 "2021-11-23T10:26:45Z")

</div>

Hi,

I have found out that **vsphere.virtualmachine.cpu.total.mhz** and **vsphere.virtualmachine.cpu.free.mhz** appears when it is set [cpuReservation](https://github.com/elastic/beats/blob/77346beb8a3e683d1874ef43d5259492167a75d2/metricbeat/module/vsphere/virtualmachine/virtualmachine.go#L148) in the virtual machine.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 21, 2021, 12:27pm UTC](https://discuss.elastic.co/t/cpu-total-free-virtual-machine-with-vsphere-module-metricbeat-7-15-2/289449/7 "2021-12-21T12:27:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
