diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index ead5a76390b..12f7d2079e1 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -263,6 +263,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add dashboards for the azure container metricsets. {pull}17194[17194] - Replace vpc metricset into vpn, transitgateway and natgateway metricsets. {pull}16892[16892] - Release Oracle module as GA. {issue}14279[14279] {pull}16833[16833] +- Release vsphere module as GA. {issue}15798[15798] {pull}17119[17119] *Packetbeat* diff --git a/metricbeat/docs/modules/vsphere.asciidoc b/metricbeat/docs/modules/vsphere.asciidoc index b426ea76ba9..638c9f9d5d7 100644 --- a/metricbeat/docs/modules/vsphere.asciidoc +++ b/metricbeat/docs/modules/vsphere.asciidoc @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-module-vsphere]] == vSphere module -beta[] - The vSphere module uses the https://github.com/vmware/govmomi[Govmomi] library to collect metrics from any Vmware SDK URL (ESXi/VCenter). This library is built for and tested against ESXi and vCenter 5.5, 6.0 and 6.5. By default it enables the metricsets `datastore`, `host` and `virtualmachine`. diff --git a/metricbeat/docs/modules/vsphere/datastore.asciidoc b/metricbeat/docs/modules/vsphere/datastore.asciidoc index 7b68437b5ce..dff7ab78546 100644 --- a/metricbeat/docs/modules/vsphere/datastore.asciidoc +++ b/metricbeat/docs/modules/vsphere/datastore.asciidoc @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-vsphere-datastore]] === vSphere datastore metricset -beta[] - include::../../../module/vsphere/datastore/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. diff --git a/metricbeat/docs/modules/vsphere/host.asciidoc b/metricbeat/docs/modules/vsphere/host.asciidoc index 583bdb2e4e6..1f8bb0ead34 100644 --- a/metricbeat/docs/modules/vsphere/host.asciidoc +++ b/metricbeat/docs/modules/vsphere/host.asciidoc @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-vsphere-host]] === vSphere host metricset -beta[] - include::../../../module/vsphere/host/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. diff --git a/metricbeat/docs/modules/vsphere/virtualmachine.asciidoc b/metricbeat/docs/modules/vsphere/virtualmachine.asciidoc index 59ac57af1f6..edeabb47134 100644 --- a/metricbeat/docs/modules/vsphere/virtualmachine.asciidoc +++ b/metricbeat/docs/modules/vsphere/virtualmachine.asciidoc @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-vsphere-virtualmachine]] === vSphere virtualmachine metricset -beta[] - include::../../../module/vsphere/virtualmachine/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 7cddba02d9c..0365d5b0f2d 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -258,10 +258,10 @@ This file is generated! See scripts/mage/docs_collector.go .1+| .1+| |<> |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | .1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | .2+| .2+| |<> beta[] |<> diff --git a/metricbeat/module/vsphere/_meta/Dockerfile b/metricbeat/module/vsphere/_meta/Dockerfile new file mode 100644 index 00000000000..0dfa4cbde84 --- /dev/null +++ b/metricbeat/module/vsphere/_meta/Dockerfile @@ -0,0 +1,8 @@ +ARG VSPHERE_GOLANG_VERSION +FROM golang:${VSPHERE_GOLANG_VERSION}-alpine + +RUN apk add --no-cache curl git +RUN go get -u github.com/vmware/govmomi/vcsim + +HEALTHCHECK --interval=1s --retries=60 --timeout=10s CMD curl http://localhost:8989/ +CMD vcsim -l :8989 diff --git a/metricbeat/module/vsphere/_meta/fields.yml b/metricbeat/module/vsphere/_meta/fields.yml index 1c3503fbd3f..63cdb9a843e 100644 --- a/metricbeat/module/vsphere/_meta/fields.yml +++ b/metricbeat/module/vsphere/_meta/fields.yml @@ -2,7 +2,7 @@ title: "vSphere" description: > vSphere module - release: beta + release: ga fields: - name: vsphere type: group diff --git a/metricbeat/module/vsphere/datastore/_meta/fields.yml b/metricbeat/module/vsphere/datastore/_meta/fields.yml index f9545509cae..7a1ff578e3f 100644 --- a/metricbeat/module/vsphere/datastore/_meta/fields.yml +++ b/metricbeat/module/vsphere/datastore/_meta/fields.yml @@ -2,7 +2,7 @@ type: group description: > datastore - release: beta + release: ga fields: - name: name type: keyword diff --git a/metricbeat/module/vsphere/datastore/datastore.go b/metricbeat/module/vsphere/datastore/datastore.go index 44ddb1ac65b..c0699daae77 100644 --- a/metricbeat/module/vsphere/datastore/datastore.go +++ b/metricbeat/module/vsphere/datastore/datastore.go @@ -24,7 +24,6 @@ import ( "github.com/pkg/errors" "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/metricbeat/mb" "github.com/vmware/govmomi" @@ -47,8 +46,6 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - cfgwarn.Beta("The vsphere datastore metricset is beta") - config := struct { Username string `config:"username"` Password string `config:"password"` diff --git a/metricbeat/module/vsphere/docker-compose.yml b/metricbeat/module/vsphere/docker-compose.yml new file mode 100644 index 00000000000..8037b6458f2 --- /dev/null +++ b/metricbeat/module/vsphere/docker-compose.yml @@ -0,0 +1,11 @@ +version: '2.3' + +services: + vsphere: + image: docker.elastic.co/integrations-ci/beats-vsphere:${VSPHERE_GOLANG_VERSION:-1.14}-1 + build: + context: ./_meta + args: + VSPHERE_GOLANG_VERSION: ${VSPHERE_GOLANG_VERSION:-1.14} + ports: + - 8989 diff --git a/metricbeat/module/vsphere/fields.go b/metricbeat/module/vsphere/fields.go index cf49cbee27f..1490fb00f37 100644 --- a/metricbeat/module/vsphere/fields.go +++ b/metricbeat/module/vsphere/fields.go @@ -32,5 +32,5 @@ func init() { // AssetVsphere returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/vsphere. func AssetVsphere() string { - return "eJzMlsFunDAQhu/7FKPcsw/AoZdUaS/bVkrT68oLw+IuxpY9JKJPX9mGFRjTpMG08WGlteH/PzDzj2/hgl0GT0ZVqHEHQJxqzODm6cHN3OwACjS55oq4bDL4sAMA6FdByKKt7W0aa2QGMzghsR1AybEuTOYuvoWGCRyb2EGdwgzOWraqn4n4TIXGYgUjZkhe5eKSi7L9UkQkfJJhhCBjGPs7WRhYLtg9S10Ea38gsuPjQDXXHQxLY/XTWd7zGk1nCAXMhAfPnCmWc+r2JInV+1NHaKIEtWzOf2f/3SqCUwRZAlUY3Ro7SqkFowzm9jPOUiMmxbzXiMkpW4NFUspHg8U2lCqnlIwKdY4NvZayv/y6OouEShpakwbB/f8/CD5LQ8sZkKvWb4uofqXclrtvj8AbOASqY1ufAOl8ff2/wtiVdDpfV9Av2AoUUm9Vpgcnbu1j0i/XZw+3VSInwtsmiNfCNUjPUl+O9l8c7E1F+8XLwlT2egbimlpWC5ZXvFl1dllUektu2ejb8/BJ10ZXIDgxsz8bpeXQUII83yqlf/iNgIPfieXAlgm/stD0q0LNiDdnePDHuPfWNsYxem7R0GZhKkv4ZA1Wx5ZjdR/rhqi+UJLkf/rXOukCyd6rawfpYcdNYT1r3hqS4uhDM0ooTz9xdiD2k8cVlX3njCFi/E8b1+8AAAD//7eBEp0=" + return "eJzMls1u2zoQhfd+ikH28QNocTe5SLtxWyBNtwYjjSzWooYgRwnUpy9ISoZ+6CapqLZcGLBInfNJ1JzhLZyxy+DZ6goN7gBYco0Z3Dw/+Cs3O4ACbW6kZklNBv/tAAD6WVBUtLW7zWCNwmIGJ7EDKCXWhc380ltohMKxhRvcabfYUKv7KxGXqdBYrBAsLNNFLi55VbafiohMn2MYc4wxivudTAwkZ+xeyBSzuV/wuPH/wLTUHQxL6/TTWd7LGm1nGRUshAfPXGiRS+72TCzq/VPHaKMENTWn99l/dYrgFYFK4AqjG+NGSUYJzmBpv+AsDWJSzHuDmJyytVgkpXy0WGxDqXNOyajR5NjwWyn75ZfZRSBUZHlNFszu/9sx8JEsX0+AXLdhU1T1I+Wm3H15BNnAYaY6tg31n843VP8bjH1Bp/P15fyKrUJFZqsiPXhxZx+Tfr06e7it8jgR3jYxvBauQX4hcz66f3Gw3yraT0EWprKX84803IpaibySzapzy1Wl96eWi729nD/n2uCaCU7M3M9GWTk0k1mWb5XR38I2wCHsw/W4poTf2Nz0s0YjWDYneAhHuH+taYxD9NSi5c2ilEr44AxWh5Zn9R/rhqihUJKkf/rXOukByd6rbwbpYcctYT1r3lomdQyhGSWkp++4OAyHi8cVlX3njSFi/Efb1s8AAAD//5A1D00=" } diff --git a/metricbeat/module/vsphere/host/_meta/fields.yml b/metricbeat/module/vsphere/host/_meta/fields.yml index 5cbbc310d05..ef6331082eb 100644 --- a/metricbeat/module/vsphere/host/_meta/fields.yml +++ b/metricbeat/module/vsphere/host/_meta/fields.yml @@ -2,7 +2,7 @@ type: group description: > host - release: beta + release: ga fields: - name: name type: keyword diff --git a/metricbeat/module/vsphere/host/host.go b/metricbeat/module/vsphere/host/host.go index 90f5e89a6f7..e8bc5d090bb 100644 --- a/metricbeat/module/vsphere/host/host.go +++ b/metricbeat/module/vsphere/host/host.go @@ -26,7 +26,6 @@ import ( "github.com/pkg/errors" "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/metricbeat/mb" "github.com/vmware/govmomi" @@ -52,8 +51,6 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - cfgwarn.Beta("The vsphere host metricset is beta") - config := struct { Username string `config:"username"` Password string `config:"password"` diff --git a/metricbeat/module/vsphere/test_vsphere.py b/metricbeat/module/vsphere/test_vsphere.py new file mode 100644 index 00000000000..b9e3e4709e9 --- /dev/null +++ b/metricbeat/module/vsphere/test_vsphere.py @@ -0,0 +1,105 @@ +import os +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) +import metricbeat + + +VSPHERE_FIELDS = metricbeat.COMMON_FIELDS + ["vsphere"] + + +@metricbeat.parameterized_with_supported_versions +class TestVsphere(metricbeat.BaseTest): + COMPOSE_SERVICES = ['vsphere'] + + @classmethod + def get_hosts(cls): + return ['https://{}/sdk'.format(cls.compose_host())] + + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_datastore(self): + """ + vsphere datastore test + """ + self.render_config_template(modules=[{ + "name": "vsphere", + "metricsets": ["datastore"], + "hosts": self.get_hosts(), + "period": "5s", + "username": "user", + "password": "pass", + "extras": { + "insecure": True, + }, + }]) + proc = self.start_beat() + self.wait_until(lambda: self.output_lines() > 0) + proc.check_kill_and_wait() + self.assert_no_logged_warnings() + + output = self.read_output_json() + self.assertEqual(len(output), 1) + evt = output[0] + + self.assertCountEqual(self.de_dot(VSPHERE_FIELDS), evt.keys(), evt) + + self.assert_fields_are_documented(evt) + + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_host(self): + """ + vsphere host test + """ + self.render_config_template(modules=[{ + "name": "vsphere", + "metricsets": ["host"], + "hosts": self.get_hosts(), + "period": "5s", + "username": "user", + "password": "pass", + "extras": { + "insecure": True, + }, + }]) + proc = self.start_beat() + self.wait_until(lambda: self.output_lines() > 0) + proc.check_kill_and_wait() + self.assert_no_logged_warnings() + + output = self.read_output_json() + self.assertEqual(len(output), 4) + evt = output[0] + + self.assertCountEqual(self.de_dot(VSPHERE_FIELDS), evt.keys(), evt) + + self.assert_fields_are_documented(evt) + + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_virtualmachine(self): + """ + vsphere virtualmachine test + """ + self.render_config_template(modules=[{ + "name": "vsphere", + "metricsets": ["virtualmachine"], + "hosts": self.get_hosts(), + "period": "5s", + "username": "user", + "password": "pass", + "extras": { + "insecure": True, + }, + }]) + proc = self.start_beat() + self.wait_until(lambda: self.output_lines() > 0) + proc.check_kill_and_wait() + self.assert_no_logged_warnings() + + output = self.read_output_json() + self.assertEqual(len(output), 4) + evt = output[0] + + self.assertCountEqual(self.de_dot(VSPHERE_FIELDS), evt.keys(), evt) + + self.assert_fields_are_documented(evt) diff --git a/metricbeat/module/vsphere/virtualmachine/_meta/fields.yml b/metricbeat/module/vsphere/virtualmachine/_meta/fields.yml index f7bc14d856f..fbbbeec5691 100644 --- a/metricbeat/module/vsphere/virtualmachine/_meta/fields.yml +++ b/metricbeat/module/vsphere/virtualmachine/_meta/fields.yml @@ -2,7 +2,7 @@ type: group description: > virtualmachine - release: beta + release: ga fields: - name: host.id type: keyword diff --git a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go index 5dd2a99675f..82dd9c90ad8 100644 --- a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go +++ b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go @@ -24,7 +24,6 @@ import ( "strings" "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/metricbeat/mb" "github.com/pkg/errors" @@ -53,8 +52,6 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - cfgwarn.Beta("The vsphere virtualmachine metricset is beta") - config := struct { Username string `config:"username"` Password string `config:"password"`