Fixes VIO collection 12/7812/7
authorbeierl <mbeierl@vmware.com>
Thu, 25 Jul 2019 17:05:58 +0000 (13:05 -0400)
committerbeierl <mbeierl@vmware.com>
Thu, 25 Jul 2019 20:47:39 +0000 (21:47 +0100)
Extract common vROPS code from vmware and vio collectors.
Add unit test coverage.
Remove unused code.
Improved vROPS collection to ask for current values only
instead of a date range.
Reduces number of calls to vROPS by asking for all metrics
for all VDUs at once.

BUG 796

Change-Id: I00ecd70c6d25f7c8982cbc633a28ab6f1ceb8cd6
Signed-off-by: beierl <mbeierl@vmware.com>
20 files changed:
osm_mon/collector/vnf_collectors/vio.py
osm_mon/collector/vnf_collectors/vmware.py
osm_mon/collector/vnf_collectors/vrops/__init__.py [new file with mode: 0644]
osm_mon/collector/vnf_collectors/vrops/metrics.py [new file with mode: 0644]
osm_mon/collector/vnf_collectors/vrops/vrops_helper.py [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_http.py [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_vcd.py [deleted file]
osm_mon/tests/unit/collector/vnf_collectors/vmware/osm_mocks/VNFD.json
osm_mon/tests/unit/collector/vnf_collectors/vmware/osm_mocks/VNFR.json
osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vcd_collector.py
osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vio_collector.py [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vrops_helper.py [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/OK.json [deleted file]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/vrops_multi.json [deleted file]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/404.txt [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/OK.json [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/malformed.json [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vcd_vapp_response.xml [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_multi.json [new file with mode: 0644]
osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_resources.json [new file with mode: 0644]

index 0d481ea..84cebe0 100644 (file)
 
 import json
 import logging
-import re
-import time
-import traceback
-
-import requests
-import six
-from keystoneauth1 import session
-from keystoneauth1.identity import v3
-from novaclient import client as nClient
 
 from osm_mon.collector.utils.collector import CollectorUtils
 from osm_mon.collector.vnf_collectors.base_vim import BaseVimCollector
-from osm_mon.collector.vnf_metric import VnfMetric
 from osm_mon.core.common_db import CommonDbClient
 from osm_mon.core.config import Config
-from osm_mon.core.database import VimCredentialsRepository, VimCredentials
+from osm_mon.collector.vnf_collectors.vrops.vrops_helper import vROPS_Helper
 
 log = logging.getLogger(__name__)
 
-PERIOD_MSEC = {'HR': 3600000,
-               'DAY': 86400000,
-               'WEEK': 604800000,
-               'MONTH': 2678400000,
-               'YEAR': 31536000000}
-
-METRIC_MAPPINGS = {
-    "average_memory_utilization": "mem|usage_average",
-    "cpu_utilization": "cpu|usage_average",
-    "read_latency_0": "virtualDisk:scsi0:0|totalReadLatency_average",
-    "write_latency_0": "virtualDisk:scsi0:0|totalWriteLatency_average",
-    "read_latency_1": "virtualDisk:scsi0:1|totalReadLatency_average",
-    "write_latency_1": "virtualDisk:scsi0:1|totalWriteLatency_average",
-    "packets_dropped_0": "net:4000|dropped",
-    "packets_dropped_1": "net:4001|dropped",
-    "packets_dropped_2": "net:4002|dropped",
-    "packets_received": "net:Aggregate of all instances|packetsRxPerSec",
-    "packets_sent": "net:Aggregate of all instances|packetsTxPerSec",
-}
-
 
 class VIOCollector(BaseVimCollector):
     def __init__(self, config: Config, vim_account_id: str):
         super().__init__(config, vim_account_id)
         self.common_db = CommonDbClient(config)
-        vim_account_info = CollectorUtils.get_credentials(vim_account_id)
-        cfg = json.loads(vim_account_info.config)
-        self.vrops_site = cfg['vrops_site']
-        self.vrops_user = cfg['vrops_user']
-        self.vrops_password = cfg['vrops_password']
-        self.client = self.connect_client(vim_account_id)
-
-    def connect_client(self, vim_account_id: str):
-        vim_account_details = VimCredentialsRepository.get(VimCredentials.uuid == vim_account_id)
-        verify_ssl = CollectorUtils.is_verify_ssl(vim_account_details)
-        auth = v3.Password(auth_url=vim_account_details.url,
-                           username=vim_account_details.user,
-                           password=vim_account_details.password,
-                           project_name=vim_account_details.tenant_name,
-                           project_domain_id='default',
-                           user_domain_id='default')
-        sess = session.Session(auth=auth, verify=verify_ssl)
-        client = nClient.Client('2.1', session=sess, endpoint_type=None)
-        return client
-
-    def _get_resource_uuid(self, nsr_id, vnf_member_index, vdur_name) -> str:
-        vdur = self.common_db.get_vdur(nsr_id, vnf_member_index, vdur_name)
-        return vdur['vim-id']
-
-    def get_vm_name_and_id(self, resource_uuid):
-        """ Method to find vm name and id using resource_uuid
-        """
-        server = self.client.servers.find(id=resource_uuid)
-        name = server.to_dict()['name']
-        _id = server.to_dict()['id']
-        return name, _id
+        cfg = self.get_vim_account(vim_account_id)
+        self.vrops = vROPS_Helper(vrops_site=cfg['vrops_site'],
+                                  vrops_user=cfg['vrops_user'],
+                                  vrops_password=cfg['vrops_password'])
 
-    def get_vm_resource_id(self, name, _id):
-        """ Find resource ID in vROPs
-        """
-        api_url = '/suite-api/api/resources?resourceKind=VirtualMachine'
-        headers = {'Accept': 'application/json'}
-
-        resp = requests.get(self.vrops_site + api_url,
-                            auth=(self.vrops_user, self.vrops_password),
-                            verify=False, headers=headers)
-
-        if resp.status_code != 200:
-            log.error("Failed to get resource details for{} {} {}".format(name,
-                                                                          resp.status_code,
-                                                                          resp.content))
-            return None
-
-        vm_resource_id = None
-        try:
-            resp_data = json.loads(resp.content.decode('utf-8'))
-            if resp_data.get('resourceList') is not None:
-                resource_list = resp_data.get('resourceList')
-                for resource in resource_list:
-                    if resource.get('resourceKey') is not None:
-                        m = re.match(r"(.*?)\s\((.*?)\)", resource['resourceKey']['name'])
-                        if m:
-                            v_name = m.group(1)
-                            v_id = m.group(2)
-                        if name == v_name and _id == v_id:
-                            vm_resource_id = resource['identifier']
-                            log.info("Found VM resource ID: {} for vm: {}".format(vm_resource_id,
-                                                                                  v_name))
-
-        except Exception as exp:
-            log.info("get_vm_resource_id: Error in parsing {}\n{}".format(exp, traceback.format_exc()))
-
-        return vm_resource_id
+    def get_vim_account(self, vim_account_id: str):
+        vim_account_info = CollectorUtils.get_credentials(vim_account_id)
+        return json.loads(vim_account_info.config)
 
     def collect(self, vnfr: dict):
-        nsr_id = vnfr['nsr-id-ref']
-        vnf_member_index = vnfr['member-vnf-index-ref']
         vnfd = self.common_db.get_vnfd(vnfr['vnfd-id'])
-        metrics = []
+        vdu_mappings = {}
+
+        # Fetch the list of all known resources from vROPS.
+        resource_list = self.vrops.get_vm_resource_list_from_vrops()
+
         for vdur in vnfr['vdur']:
             # This avoids errors when vdur records have not been completely filled
             if 'name' not in vdur:
                 continue
+
             vdu = next(
                 filter(lambda vdu: vdu['id'] == vdur['vdu-id-ref'], vnfd['vdu'])
-
             )
-            if 'monitoring-param' in vdu:
-                for param in vdu['monitoring-param']:
-                    metric_name = param['nfvi-metric']
-                    vrops_metric_name = METRIC_MAPPINGS[metric_name]
-                    resource_uuid = self._get_resource_uuid(nsr_id, vnf_member_index, vdur['name'])
-
-                    name, _id = self.get_vm_name_and_id(resource_uuid)
-                    if name and _id is not None:
-                        resource_id = self.get_vm_resource_id(name, _id)
-                    else:
-                        return
-                    try:
-                        end_time = int(round(time.time() * 1000))
-                        time_diff = PERIOD_MSEC['YEAR']
-                        begin_time = end_time - time_diff
-
-                        api_url = "/suite-api/api/resources/{}/stats?statKey={}&begin={}&end={}".format(
-                            resource_id, vrops_metric_name, str(begin_time), str(end_time))
-
-                        headers = {'Accept': 'application/json'}
-
-                        resp = requests.get(self.vrops_site + api_url,
-                                            auth=(self.vrops_user, self.vrops_password), verify=False, headers=headers
-                                            )
-
-                        if resp.status_code != 200:
-                            log.info("Failed to get Metrics data from vROPS for {} {} {}".format(vrops_metric_name,
-                                                                                                 resp.status_code,
-                                                                                                 resp.content))
-                            return
-
-                        metrics_data = {}
-                        m_data = json.loads(resp.content.decode('utf-8'))
-
-                        for resp_key, resp_val in six.iteritems(m_data):
-                            if resp_key == 'values':
-                                data = m_data['values'][0]
-                                for data_k, data_v in six.iteritems(data):
-                                    if data_k == 'stat-list':
-                                        stat_list = data_v
-                                        for stat_list_k, stat_list_v in six.iteritems(stat_list):
-                                            for stat_keys, stat_vals in six.iteritems(stat_list_v[0]):
-                                                if stat_keys == 'timestamps':
-                                                    metrics_data['time_series'] = stat_list_v[0]['timestamps']
-                                                if stat_keys == 'data':
-                                                    metrics_data['metrics_series'] = stat_list_v[0]['data']
-
-                        if metrics_data:
-                            metric = VnfMetric(nsr_id,
-                                               vnf_member_index,
-                                               vdur['name'],
-                                               metric_name,
-                                               metrics_data['metrics_series'][-1])
-
-                            metrics.append(metric)
-
-                    except Exception as e:
-                        log.debug("No metric found: %s", e)
-                        pass
+            if 'monitoring-param' not in vdu:
+                continue
 
-        return metrics
+            vim_id = vdur['vim-id']
+            vdu_mappings[vim_id] = {'name': vdur['name']}
+
+            # Map the vROPS instance id to the vim-id so we can look it up.
+            for resource in resource_list:
+                for resourceIdentifier in resource['resourceKey']['resourceIdentifiers']:
+                    if resourceIdentifier['identifierType']['name'] == 'VMEntityInstanceUUID':
+                        if resourceIdentifier['value'] != vim_id:
+                            continue
+                        vdu_mappings[vim_id]['vrops_id'] = resource['identifier']
+
+        if len(vdu_mappings) != 0:
+            return self.vrops.get_metrics(vdu_mappings=vdu_mappings,
+                                          monitoring_params=vdu['monitoring-param'],
+                                          vnfr=vnfr)
+        else:
+            return []
index e79ce06..329d61d 100644 (file)
@@ -23,7 +23,6 @@
 
 import json
 import logging
-import time
 import traceback
 from xml.etree import ElementTree as XmlElementTree
 
@@ -33,106 +32,26 @@ from pyvcloud.vcd.client import Client
 
 from osm_mon.collector.utils.collector import CollectorUtils
 from osm_mon.collector.vnf_collectors.base_vim import BaseVimCollector
-from osm_mon.collector.vnf_metric import VnfMetric
 from osm_mon.core.common_db import CommonDbClient
 from osm_mon.core.config import Config
+from osm_mon.collector.vnf_collectors.vrops.vrops_helper import vROPS_Helper
 
 log = logging.getLogger(__name__)
 
 API_VERSION = '27.0'
 
-TEN_MINUTES = 600000
-
-# Ref: https://docs.vmware.com/en/vRealize-Operations-Manager/7.0/vrealize-operations-manager-70-reference-guide.pdf
-# Potential metrics of interest
-# "cpu|capacity_contentionPct"
-# "cpu|corecount_provisioned"
-# "cpu|costopPct"
-# "cpu|demandmhz"
-# "cpu|demandPct"
-# "cpu|effective_limit"
-# "cpu|iowaitPct"
-# "cpu|readyPct"
-# "cpu|swapwaitPct"
-# "cpu|usage_average"
-# "cpu|usagemhz_average"
-# "cpu|usagemhz_average_mtd"
-# "cpu|vm_capacity_provisioned"
-# "cpu|workload"
-# "guestfilesystem|percentage_total"
-# "guestfilesystem|usage_total"
-# "mem|consumedPct"
-# "mem|guest_usage"
-# "mem|host_contentionPct"
-# "mem|reservation_used"
-# "mem|swapinRate_average"
-# "mem|swapoutRate_average"
-# "mem|swapped_average"
-# "mem|usage_average"
-# "net:Aggregate of all instances|droppedPct"
-# "net|broadcastTx_summation"
-# "net|droppedTx_summation"
-# "net|multicastTx_summation"
-# "net|pnicBytesRx_average"
-# "net|pnicBytesTx_average"
-# "net|received_average"
-# "net|transmitted_average"
-# "net|usage_average"
-# "virtualDisk:Aggregate of all instances|commandsAveraged_average"
-# "virtualDisk:Aggregate of all instances|numberReadAveraged_average"
-# "virtualDisk:Aggregate of all instances|numberWriteAveraged_average"
-# "virtualDisk:Aggregate of all instances|totalLatency"
-# "virtualDisk:Aggregate of all instances|totalReadLatency_average"
-# "virtualDisk:Aggregate of all instances|totalWriteLatency_average"
-# "virtualDisk:Aggregate of all instances|usage"
-# "virtualDisk:Aggregate of all instances|vDiskOIO"
-# "virtualDisk|read_average"
-# "virtualDisk|write_average"
-
-METRIC_MAPPINGS = {
-    # Percent guest operating system active memory
-    "average_memory_utilization": "mem|usage_average",
-    # Percentage of CPU that was used out of all the CPU that was allocated
-    "cpu_utilization": "cpu|usage_average",
-    # KB/s of data read in the performance interval
-    "disk_read_bytes": "virtualDisk|read_average",
-    # Average of read commands per second during the collection interval.
-    "disk_read_ops": "virtualDisk:aggregate of all instances|numberReadAveraged_average",
-    # KB/s  of data written in the performance interval
-    "disk_write_bytes": "virtualDisk|write_average",
-    # Average of write commands per second during the collection interval.
-    "disk_write_ops": "virtualDisk:aggregate of all instances|numberWriteAveraged_average",
-    # "packets_in_dropped": "net|droppedRx_summation",  # Not supported by vROPS
-    # Transmitted packets dropped in the collection interval
-    "packets_out_dropped": "net|droppedTx_summation",
-    # Bytes received in the performance interval
-    "packets_received": "net|received_average",
-    # Packets transmitted in the performance interval
-    "packets_sent": "net|transmitted_average",
-}
-
-# If the unit from vROPS does not align with the expected value. multiply by the specified amount to ensure
-# the correct unit is returned.
-METRIC_MULTIPLIERS = {
-    "disk_read_bytes": 1024,
-    "disk_write_bytes": 1024,
-    "packets_received": 1024,
-    "packets_sent": 1024
-}
-
 
 class VMwareCollector(BaseVimCollector):
     def __init__(self, config: Config, vim_account_id: str):
         super().__init__(config, vim_account_id)
         self.common_db = CommonDbClient(config)
         vim_account = self.get_vim_account(vim_account_id)
-        self.vrops_site = vim_account['vrops_site']
-        self.vrops_user = vim_account['vrops_user']
-        self.vrops_password = vim_account['vrops_password']
         self.vcloud_site = vim_account['vim_url']
         self.admin_username = vim_account['admin_username']
         self.admin_password = vim_account['admin_password']
-        self.vim_uuid = vim_account['vim_uuid']
+        self.vrops = vROPS_Helper(vrops_site=vim_account['vrops_site'],
+                                  vrops_user=vim_account['vrops_user'],
+                                  vrops_password=vim_account['vrops_password'])
 
     def connect_as_admin(self):
         """ Method connect as pvdc admin user to vCloud director.
@@ -143,7 +62,7 @@ class VMwareCollector(BaseVimCollector):
                 The return client object that letter can be used to connect to vcloud direct as admin for provider vdc
         """
 
-        log.info("Logging into vCD org as admin.")
+        log.debug("Logging into vCD org as admin.")
 
         admin_user = None
         try:
@@ -158,11 +77,7 @@ class VMwareCollector(BaseVimCollector):
             return client
 
         except Exception as e:
-            log.info("Can't connect to a vCloud director as: {} with exception {}".format(admin_user, e))
-
-    def _get_resource_uuid(self, nsr_id, vnf_member_index, vdur_name) -> str:
-        vdur = self.common_db.get_vdur(nsr_id, vnf_member_index, vdur_name)
-        return vdur['vim-id']
+            log.error("Can't connect to a vCloud director as: {} with exception {}".format(admin_user, e))
 
     def get_vim_account(self, vim_account_id: str):
         """
@@ -173,13 +88,7 @@ class VMwareCollector(BaseVimCollector):
         vim_account = {}
         vim_account_info = CollectorUtils.get_credentials(vim_account_id)
 
-        vim_account['name'] = vim_account_info.name
-        vim_account['vim_tenant_name'] = vim_account_info.tenant_name
-        vim_account['vim_type'] = vim_account_info.type
         vim_account['vim_url'] = vim_account_info.url
-        vim_account['org_user'] = vim_account_info.user
-        vim_account['org_password'] = vim_account_info.password
-        vim_account['vim_uuid'] = vim_account_info.uuid
 
         vim_config = json.loads(vim_account_info.config)
         vim_account['admin_username'] = vim_config['admin_username']
@@ -187,22 +96,6 @@ class VMwareCollector(BaseVimCollector):
         vim_account['vrops_site'] = vim_config['vrops_site']
         vim_account['vrops_user'] = vim_config['vrops_user']
         vim_account['vrops_password'] = vim_config['vrops_password']
-        vim_account['vcenter_ip'] = vim_config['vcenter_ip']
-        vim_account['vcenter_port'] = vim_config['vcenter_port']
-        vim_account['vcenter_user'] = vim_config['vcenter_user']
-        vim_account['vcenter_password'] = vim_config['vcenter_password']
-
-        if vim_config['nsx_manager'] is not None:
-            vim_account['nsx_manager'] = vim_config['nsx_manager']
-
-        if vim_config['nsx_user'] is not None:
-            vim_account['nsx_user'] = vim_config['nsx_user']
-
-        if vim_config['nsx_password'] is not None:
-            vim_account['nsx_password'] = vim_config['nsx_password']
-
-        if vim_config['orgname'] is not None:
-            vim_account['orgname'] = vim_config['orgname']
 
         return vim_account
 
@@ -219,12 +112,14 @@ class VMwareCollector(BaseVimCollector):
 
                 if vm_details and "vm_vcenter_info" in vm_details:
                     vm_moref_id = vm_details["vm_vcenter_info"].get("vm_moref_id", None)
-
-            log.info("Found vm_moref_id: {} for vApp UUID: {}".format(vm_moref_id, vapp_uuid))
-            return vm_moref_id
+                    log.debug("Found vm_moref_id: {} for vApp UUID: {}".format(vm_moref_id, vapp_uuid))
+                else:
+                    log.error("Failed to find vm_moref_id from vApp UUID: {}".format(vapp_uuid))
 
         except Exception as exp:
-            log.info("Error occurred while getting VM moref ID for VM : {}\n{}".format(exp, traceback.format_exc()))
+            log.warning("Error occurred while getting VM moref ID for VM: {}\n{}".format(exp, traceback.format_exc()))
+
+        return vm_moref_id
 
     def get_vapp_details_rest(self, vapp_uuid=None):
         """
@@ -278,137 +173,49 @@ class VMwareCollector(BaseVimCollector):
                         parsed_respond["vm_vcenter_info"] = vm_vcenter_info
 
             except Exception as exp:
-                log.info("Error occurred for getting vApp details: {}\n{}".format(exp,
-                                                                                  traceback.format_exc())
-                         )
+                log.warning("Error occurred for getting vApp details: {}\n{}".format(exp,
+                                                                                     traceback.format_exc()))
 
         return parsed_respond
 
-    def get_vm_resource_id(self, vm_moref_id):
-        """ Find resource ID in vROPs using vm_moref_id
-        """
-        if vm_moref_id is None:
-            return None
-
-        api_url = '/suite-api/api/resources?resourceKind=VirtualMachine'
-        headers = {'Accept': 'application/json'}
-
-        resp = requests.get(self.vrops_site + api_url,
-                            auth=(self.vrops_user, self.vrops_password),
-                            verify=False, headers=headers)
-
-        if resp.status_code != 200:
-            log.error("Failed to get resource details for{} {} {}".format(vm_moref_id,
-                                                                          resp.status_code,
-                                                                          resp.content))
-            return None
-
-        vm_resource_id = None
-        try:
-            resp_data = json.loads(resp.content.decode('utf-8'))
-            if resp_data.get('resourceList') is not None:
-                resource_list = resp_data.get('resourceList')
-                for resource in resource_list:
-                    if resource.get('resourceKey') is not None:
-                        resource_details = resource['resourceKey']
-                        if resource_details.get('resourceIdentifiers') is not None:
-                            resource_identifiers = resource_details['resourceIdentifiers']
-                            for resource_identifier in resource_identifiers:
-                                if resource_identifier['identifierType']['name'] == 'VMEntityObjectID':
-                                    if resource_identifier.get('value') is not None and \
-                                            resource_identifier['value'] == vm_moref_id:
-                                        vm_resource_id = resource['identifier']
-                                        log.info("Found VM resource ID: {} for vm_moref_id: {}".format(vm_resource_id,
-                                                                                                       vm_moref_id))
-
-        except Exception as exp:
-            log.info("get_vm_resource_id: Error in parsing {}\n{}".format(exp, traceback.format_exc()))
-
-        return vm_resource_id
-
     def collect(self, vnfr: dict):
-        nsr_id = vnfr['nsr-id-ref']
-        vnf_member_index = vnfr['member-vnf-index-ref']
         vnfd = self.common_db.get_vnfd(vnfr['vnfd-id'])
-        metrics = []
+        vdu_mappings = {}
+
+        # Fetch the list of all known resources from vROPS.
+        resource_list = self.vrops.get_vm_resource_list_from_vrops()
+
         for vdur in vnfr['vdur']:
             # This avoids errors when vdur records have not been completely filled
             if 'name' not in vdur:
                 continue
             vdu = next(
                 filter(lambda vdu: vdu['id'] == vdur['vdu-id-ref'], vnfd['vdu'])
-
             )
 
             if 'monitoring-param' not in vdu:
                 continue
 
-            resource_uuid = self._get_resource_uuid(nsr_id, vnf_member_index, vdur['name'])
-
+            resource_uuid = vdur['vim-id']
             # Find vm_moref_id from vApp uuid in vCD
-            vm_moref_id = self.get_vm_moref_id(resource_uuid)
-            if vm_moref_id is None:
-                log.debug("Failed to find vm morefid for vApp in vCD: {}".format(resource_uuid))
-                continue
-
-            # Based on vm_moref_id, find VM's corresponding resource_id in vROPs
-            resource_id = self.get_vm_resource_id(vm_moref_id)
-            if resource_id is None:
-                log.debug("Failed to find resource in vROPs: {}".format(resource_uuid))
+            vim_id = self.get_vm_moref_id(resource_uuid)
+            if vim_id is None:
+                log.debug("Failed to find vROPS ID for vApp in vCD: {}".format(resource_uuid))
                 continue
 
-            stat_key = ""
-            monitoring_params = []
-            for metric_entry in vdu['monitoring-param']:
-                metric_name = metric_entry['nfvi-metric']
-                if metric_name not in METRIC_MAPPINGS:
-                    log.debug("Metric {} not supported, ignoring".format(metric_name))
-                    continue
-                monitoring_params.append(metric_name)
-                vrops_metric_name = METRIC_MAPPINGS[metric_name]
-                stat_key = "{}&statKey={}".format(stat_key, vrops_metric_name)
-
-            try:
-                end_time = int(round(time.time() * 1000))
-                begin_time = end_time - TEN_MINUTES
-
-                api_url = "/suite-api/api/resources/stats?resourceId={}&begin={}&end={}{}".format(
-                    resource_id, str(begin_time), str(end_time), stat_key)
-                headers = {'Accept': 'application/json'}
-
-                resp = requests.get(self.vrops_site + api_url,
-                                    auth=(self.vrops_user, self.vrops_password), verify=False, headers=headers
-                                    )
-
-                if resp.status_code != 200:
-                    log.info("Failed to get Metrics data from vROPS for {} {} {}".format(vdur.name,
-                                                                                         resp.status_code,
-                                                                                         resp.content))
-                    continue
-
-                m_data = json.loads(resp.content.decode('utf-8'))
-
-                stat_list = m_data['values'][0]['stat-list']['stat']
-                for item in stat_list:
-                    reported_metric = item['statKey']['key']
-                    if reported_metric not in METRIC_MAPPINGS.values():
-                        continue
-
-                    metric_name = list(METRIC_MAPPINGS.keys())[list(METRIC_MAPPINGS.values()).
-                                                               index(reported_metric)]
-                    if metric_name in monitoring_params:
-                        metric_value = item['data'][-1]
-                        if metric_name in METRIC_MULTIPLIERS:
-                            metric_value *= METRIC_MULTIPLIERS[metric_name]
-                        metric = VnfMetric(nsr_id,
-                                           vnf_member_index,
-                                           vdur['name'],
-                                           metric_name,
-                                           metric_value)
-
-                        metrics.append(metric)
-
-            except Exception as e:
-                log.debug("No metric found for {}: %s".format(vdur['name']), e)
-                pass
-        return metrics
+            vdu_mappings[vim_id] = {'name': vdur['name']}
+
+            # Map the vROPS instance id to the vim-id so we can look it up.
+            for resource in resource_list:
+                for resourceIdentifier in resource['resourceKey']['resourceIdentifiers']:
+                    if resourceIdentifier['identifierType']['name'] == 'VMEntityObjectID':
+                        if resourceIdentifier['value'] != vim_id:
+                            continue
+                        vdu_mappings[vim_id]['vrops_id'] = resource['identifier']
+
+        if len(vdu_mappings) != 0:
+            return self.vrops.get_metrics(vdu_mappings=vdu_mappings,
+                                          monitoring_params=vdu['monitoring-param'],
+                                          vnfr=vnfr)
+        else:
+            return []
diff --git a/osm_mon/collector/vnf_collectors/vrops/__init__.py b/osm_mon/collector/vnf_collectors/vrops/__init__.py
new file mode 100644 (file)
index 0000000..30d864e
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# #
+# Copyright 2016-2019 VMware Inc.
+# This file is part of ETSI OSM
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact:  osslegalrouting@vmware.com
+# #
diff --git a/osm_mon/collector/vnf_collectors/vrops/metrics.py b/osm_mon/collector/vnf_collectors/vrops/metrics.py
new file mode 100644 (file)
index 0000000..d4bd69f
--- /dev/null
@@ -0,0 +1,91 @@
+# -*- coding: utf-8 -*-
+
+# #
+# Copyright 2016-2019 VMware Inc.
+# This file is part of ETSI OSM
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact:  osslegalrouting@vmware.com
+# #
+
+# Ref: https://docs.vmware.com/en/vRealize-Operations-Manager/7.0/vrealize-operations-manager-70-reference-guide.pdf
+# Potential metrics of interest
+# "cpu|capacity_contentionPct"
+# "cpu|corecount_provisioned"
+# "cpu|costopPct"
+# "cpu|demandmhz"
+# "cpu|demandPct"
+# "cpu|effective_limit"
+# "cpu|iowaitPct"
+# "cpu|readyPct"
+# "cpu|swapwaitPct"
+# "cpu|usage_average"
+# "cpu|usagemhz_average"
+# "cpu|usagemhz_average_mtd"
+# "cpu|vm_capacity_provisioned"
+# "cpu|workload"
+# "guestfilesystem|percentage_total"
+# "guestfilesystem|usage_total"
+# "mem|consumedPct"
+# "mem|guest_usage"
+# "mem|host_contentionPct"
+# "mem|reservation_used"
+# "mem|swapinRate_average"
+# "mem|swapoutRate_average"
+# "mem|swapped_average"
+# "mem|usage_average"
+# "net:Aggregate of all instances|droppedPct"
+# "net|broadcastTx_summation"
+# "net|droppedTx_summation"
+# "net|multicastTx_summation"
+# "net|pnicBytesRx_average"
+# "net|pnicBytesTx_average"
+# "net|received_average"
+# "net|transmitted_average"
+# "net|usage_average"
+# "virtualDisk:Aggregate of all instances|commandsAveraged_average"
+# "virtualDisk:Aggregate of all instances|numberReadAveraged_average"
+# "virtualDisk:Aggregate of all instances|numberWriteAveraged_average"
+# "virtualDisk:Aggregate of all instances|totalLatency"
+# "virtualDisk:Aggregate of all instances|totalReadLatency_average"
+# "virtualDisk:Aggregate of all instances|totalWriteLatency_average"
+# "virtualDisk:Aggregate of all instances|usage"
+# "virtualDisk:Aggregate of all instances|vDiskOIO"
+# "virtualDisk|read_average"
+# "virtualDisk|write_average"
+
+METRIC_MAPPINGS = {
+    # Percent guest operating system active memory.
+    "average_memory_utilization": "mem|usage_average",
+    # Percentage of CPU that was used out of all the CPU that was allocated.
+    "cpu_utilization": "cpu|usage_average",
+    # KB/s of data read in the performance interval
+    "disk_read_bytes": "virtualDisk|read_average",
+    # Average of read commands per second during the collection interval.
+    "disk_read_ops": "virtualDisk:aggregate of all instances|numberReadAveraged_average",
+    # KB/s  of data written in the performance interval.
+    "disk_write_bytes": "virtualDisk|write_average",
+    # Average of write commands per second during the collection interval.
+    "disk_write_ops": "virtualDisk:aggregate of all instances|numberWriteAveraged_average",
+    # Not supported by vROPS, will always return 0.
+    "packets_in_dropped": "net|droppedRx_summation",
+    # Transmitted packets dropped in the collection interval.
+    "packets_out_dropped": "net|droppedTx_summation",
+    # Bytes received in the performance interval.
+    "packets_received": "net|received_average",
+    # Packets transmitted in the performance interval.
+    "packets_sent": "net|transmitted_average",
+}
diff --git a/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py b/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py
new file mode 100644 (file)
index 0000000..430cf86
--- /dev/null
@@ -0,0 +1,165 @@
+# -*- coding: utf-8 -*-
+
+# #
+# Copyright 2016-2019 VMware Inc.
+# This file is part of ETSI OSM
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact:  osslegalrouting@vmware.com
+# #
+
+import logging
+import json
+import requests
+import traceback
+
+from osm_mon.collector.vnf_metric import VnfMetric
+from osm_mon.collector.vnf_collectors.vrops.metrics import METRIC_MAPPINGS
+import copy
+
+log = logging.getLogger(__name__)
+
+
+# If the unit from vROPS does not align with the expected value. multiply by the specified amount to ensure
+# the correct unit is returned.
+METRIC_MULTIPLIERS = {
+    "disk_read_bytes": 1024,
+    "disk_write_bytes": 1024,
+    "packets_received": 1024,
+    "packets_sent": 1024
+}
+
+
+class vROPS_Helper():
+
+    def __init__(self,
+                 vrops_site='https://vrops',
+                 vrops_user='',
+                 vrops_password=''):
+        self.vrops_site = vrops_site
+        self.vrops_user = vrops_user
+        self.vrops_password = vrops_password
+
+    def get_vm_resource_list_from_vrops(self):
+        """ Find all known resource IDs in vROPs
+        """
+        api_url = '/suite-api/api/resources?resourceKind=VirtualMachine'
+        headers = {'Accept': 'application/json'}
+        resource_list = []
+
+        resp = requests.get(self.vrops_site + api_url,
+                            auth=(self.vrops_user, self.vrops_password),
+                            verify=False, headers=headers)
+
+        if resp.status_code != 200:
+            log.error("Failed to get resource list from vROPS: {} {}".format(resp.status_code,
+                                                                             resp.content))
+            return resource_list
+
+        try:
+            resp_data = json.loads(resp.content.decode('utf-8'))
+            if resp_data.get('resourceList') is not None:
+                resource_list = resp_data.get('resourceList')
+
+        except Exception as exp:
+            log.error("get_vm_resource_id: Error in parsing {}\n{}".format(exp, traceback.format_exc()))
+
+        return resource_list
+
+    def get_metrics(self,
+                    vdu_mappings={},
+                    monitoring_params={},
+                    vnfr=None):
+
+        monitoring_keys = {}
+        # Collect the names of all the metrics we need to query
+        for metric_entry in monitoring_params:
+            metric_name = metric_entry['nfvi-metric']
+            if metric_name not in METRIC_MAPPINGS:
+                log.debug("Metric {} not supported, ignoring".format(metric_name))
+                continue
+            monitoring_keys[metric_name] = METRIC_MAPPINGS[metric_name]
+
+        metrics = []
+        # Make a query for only the stats we have been asked for
+        stats_key = ""
+        for stat in monitoring_keys.values():
+            stats_key += "&statKey={}".format(stat)
+
+        # And only ask for the resource ids that we are interested in
+        resource_ids = ""
+        sanitized_vdu_mappings = copy.deepcopy(vdu_mappings)
+        for key in vdu_mappings.keys():
+            vdu = vdu_mappings[key]
+            if 'vrops_id' not in vdu:
+                log.info("Could not find vROPS id for vdu {}".format(vdu))
+                del sanitized_vdu_mappings[key]
+                continue
+            resource_ids += "&resourceId={}".format(vdu['vrops_id'])
+        vdu_mappings = sanitized_vdu_mappings
+
+        try:
+
+            # Now we can make a single call to vROPS to collect all relevant metrics for resources we need to monitor
+            api_url = "/suite-api/api/resources/stats?IntervalType=MINUTES&IntervalCount=1"\
+                "&rollUpType=MAX&currentOnly=true{}{}".format(stats_key, resource_ids)
+            headers = {'Accept': 'application/json'}
+
+            resp = requests.get(self.vrops_site + api_url,
+                                auth=(self.vrops_user, self.vrops_password), verify=False, headers=headers)
+
+            if resp.status_code != 200:
+                log.error("Failed to get Metrics data from vROPS for {} {}".format(resp.status_code,
+                                                                                   resp.content))
+                return metrics
+
+            m_data = json.loads(resp.content.decode('utf-8'))
+            if 'values' not in m_data:
+                return metrics
+
+            statistics = m_data['values']
+            for vdu_stat in statistics:
+                vrops_id = vdu_stat['resourceId']
+                vdu_name = None
+                for vdu in vdu_mappings.values():
+                    if vdu['vrops_id'] == vrops_id:
+                        vdu_name = vdu['name']
+                if vdu_name is None:
+                    continue
+                for item in vdu_stat['stat-list']['stat']:
+                    reported_metric = item['statKey']['key']
+                    if reported_metric not in METRIC_MAPPINGS.values():
+                        continue
+
+                    # Convert the vROPS metric name back to OSM key
+                    metric_name = list(METRIC_MAPPINGS.keys())[list(METRIC_MAPPINGS.values()).
+                                                               index(reported_metric)]
+                    if metric_name in monitoring_keys.keys():
+                        metric_value = item['data'][-1]
+                        if metric_name in METRIC_MULTIPLIERS:
+                            metric_value *= METRIC_MULTIPLIERS[metric_name]
+                        metric = VnfMetric(vnfr['nsr-id-ref'],
+                                           vnfr['member-vnf-index-ref'],
+                                           vdu_name,
+                                           metric_name,
+                                           metric_value)
+
+                        metrics.append(metric)
+
+        except Exception as exp:
+            log.error("Exception while parsing metrics data from vROPS {}\n{}".format(exp, traceback.format_exc()))
+
+        return metrics
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_http.py b/osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_http.py
new file mode 100644 (file)
index 0000000..36ee361
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Copyright 2019 VMware
+# *************************************************************
+
+# This file is part of OSM Monitoring module
+# All Rights Reserved to VMware
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+
+#         http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: mbeierl@vmware.com
+# #
+
+import os
+import re
+
+
+def mock_http_response(mocker, method='GET', site='https://vrops', url_pattern='', response_file='OK',
+                       status_code=200, exception=None):
+    '''Helper function to load a canned response from a file.'''
+    with open(os.path.join(os.path.dirname(__file__), 'vmware_mocks',
+                           '%s' % response_file), 'r') as f:
+        response = f.read()
+
+    matcher = re.compile(site + url_pattern)
+    if exception is None:
+        mocker.register_uri(method, matcher, text=response, status_code=status_code)
+    else:
+        mocker.register_uri(method, matcher, exc=exception)
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_vcd.py b/osm_mon/tests/unit/collector/vnf_collectors/vmware/mock_vcd.py
deleted file mode 100644 (file)
index 6938873..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright 2019 VMware
-# *************************************************************
-
-# This file is part of OSM Monitoring module
-# All Rights Reserved to VMware
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-
-#         http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-# For those usages not covered by the Apache License, Version 2.0 please
-# contact: mbeierl@vmware.com
-# #
-
-import os
-import re
-
-
-def mock_vdc_response(mocker, method='GET', site='https://vrops', url_pattern='', response_file='OK'):
-    '''Helper function to load a canned response from a file.'''
-    with open(os.path.join(os.path.dirname(__file__), 'vcd_mocks',
-                           '%s' % response_file), 'r') as f:
-        response = f.read()
-
-    matcher = re.compile(site + url_pattern)
-    mocker.register_uri(method, matcher, text=response)
index ed34789..12105a4 100644 (file)
 {
+       "_copyright_comment": "Copyright 2016-2019 VMware Inc.  This file is part of ETSI OSM  All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may  not use this file except in compliance with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. For those usages not covered by the Apache License, Version 2.0 please contact:  osslegalrouting@vmware.com",
        "_admin": {
-               "created": 1561567611.6193357,
-               "modified": 1561567611.6193357,
+               "created": 1562374395.5216513,
+               "modified": 1562374395.5216513,
                "onboardingState": "ONBOARDED",
                "operationalState": "ENABLED",
                "projects_read": [
-                       "admin"
+                       "775be778-0f51-495a-b865-a23ab20a080f"
                ],
                "projects_write": [
-                       "admin"
+                       "775be778-0f51-495a-b865-a23ab20a080f"
                ],
                "storage": {
                        "descriptor": "cirros_vnf/cirros_vdu_alarm_vnfd.yaml",
-                       "folder": "9d116df6-6fa7-4a5b-b284-a67f554c1261",
+                       "folder": "cb0da948-7bce-474d-bbcb-6bfce545d397",
                        "fs": "local",
                        "path": "/app/storage/",
                        "pkg-dir": "cirros_vnf",
-                       "zipfile": "cirros_vdu_alarm_vnfd.tar.gz"
+                       "zipfile": "package.tar.gz"
                },
                "type": "vnfd",
                "usageState": "NOT_IN_USE",
                "userDefinedData": {
                }
        },
-       "_id": "9d116df6-6fa7-4a5b-b284-a67f554c1261",
+       "_id": "cb0da948-7bce-474d-bbcb-6bfce545d397",
        "connection-point": [
                {
                        "name": "eth0",
                        "type": "VPORT"
                }
        ],
-       "description": "Simple VNF example with a cirros and a VNF alarm",
-       "id": "cirros_vdu_alarm_vnf",
-       "logo": "cirros-64.png",
+       "description": "Simple Ubuntu VNF with metric collectors and scaling group",
+       "id": "ubuntu_vdu_alarm_vnf",
+       "logo": "ubuntu-64.png",
        "mgmt-interface": {
                "cp": "eth0"
        },
        "monitoring-param": [
                {
                        "aggregation-type": "AVERAGE",
-                       "id": "cirros_vnf_cpu_util",
-                       "name": "cirros_vnf_cpu_util",
+                       "id": "ubuntu_vnf_cpu_util",
+                       "name": "ubuntu_vnf_cpu_util",
                        "vdu-monitoring-param": {
-                               "vdu-monitoring-param-ref": "cirros_vnfd-VM_cpu_util",
-                               "vdu-ref": "cirros_vnfd-VM"
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_cpu_util",
+                               "vdu-ref": "ubuntu_vnfd-VM"
                        }
                },
                {
                        "aggregation-type": "AVERAGE",
-                       "id": "cirros_vnf_average_memory_utilization",
-                       "name": "cirros_vnf_average_memory_utilization",
+                       "id": "ubuntu_vnf_average_memory_utilization",
+                       "name": "ubuntu_vnf_average_memory_utilization",
                        "vdu-monitoring-param": {
-                               "vdu-monitoring-param-ref": "cirros_vnfd-VM_average_memory_utilization",
-                               "vdu-ref": "cirros_vnfd-VM"
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_average_memory_utilization",
+                               "vdu-ref": "ubuntu_vnfd-VM"
                        }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_disk_read_ops",
+                       "name": "ubuntu_vnf_disk_read_ops",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_disk_read_ops",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_disk_write_ops",
+                       "name": "ubuntu_vnf_disk_write_ops",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_disk_write_ops",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_disk_read_bytes",
+                       "name": "ubuntu_vnf_disk_read_bytes",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_disk_read_bytes",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_disk_write_bytes",
+                       "name": "ubuntu_vnf_disk_write_bytes",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_disk_write_bytes",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_packets_in_dropped",
+                       "name": "ubuntu_vnf_packets_in_dropped",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_packets_in_dropped",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_packets_out_dropped",
+                       "name": "ubuntu_vnf_packets_out_dropped",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_packets_out_dropped",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_packets_received",
+                       "name": "ubuntu_vnf_packets_received",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_packets_received",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               },
+               {
+                       "aggregation-type": "AVERAGE",
+                       "id": "ubuntu_vnf_packets_sent",
+                       "name": "ubuntu_vnf_packets_sent",
+                       "vdu-monitoring-param": {
+                               "vdu-monitoring-param-ref": "ubuntu_vnfd-VM_packets_sent",
+                               "vdu-ref": "ubuntu_vnfd-VM"
+                       }
+               }
+       ],
+       "name": "ubuntu_vdu_alarm_vnf",
+       "scaling-group-descriptor": [
+               {
+                       "min-instance-count": 0,
+                       "name": "cpu_autoscaling_descriptor",
+                       "scaling-policy": [
+                               {
+                                       "cooldown-time": 120,
+                                       "name": "cpu_scaling_policy",
+                                       "scaling-criteria": [
+                                               {
+                                                       "name": "cpu_autoscaling_criteria",
+                                                       "scale-in-relational-operation": "LT",
+                                                       "scale-in-threshold": "20.0000000000",
+                                                       "scale-out-relational-operation": "GT",
+                                                       "scale-out-threshold": "80.0000000000",
+                                                       "vnf-monitoring-param-ref": "ubuntu_vnf_cpu_util"
+                                               }
+                                       ],
+                                       "scaling-type": "automatic"
+                               }
+                       ],
+                       "vdu": [
+                               {
+                                       "vdu-id-ref": "ubuntu_vnfd-VM"
+                               }
+                       ]
                }
        ],
-       "name": "cirros_vdu_alarm_vnf",
-       "short-name": "cirros_vdu_alarm_vnf",
+       "short-name": "ubuntu_vdu_alarm_vnf",
        "vdu": [
                {
                        "alarm": [
                                        "alarm-id": "alarm-1",
                                        "operation": "LT",
                                        "value": "20.0000",
-                                       "vnf-monitoring-param-ref": "cirros_vnf_cpu_util"
+                                       "vnf-monitoring-param-ref": "ubuntu_vnf_cpu_util"
                                }
                        ],
                        "count": "1",
-                       "description": "cirros_vnfd-VM",
-                       "id": "cirros_vnfd-VM",
+                       "description": "ubuntu_vnfd-VM",
+                       "id": "ubuntu_vnfd-VM",
                        "image": "ubuntu",
                        "interface": [
                                {
                        ],
                        "monitoring-param": [
                                {
-                                       "id": "cirros_vnfd-VM_cpu_util",
+                                       "id": "ubuntu_vnfd-VM_cpu_util",
                                        "nfvi-metric": "cpu_utilization"
                                },
                                {
-                                       "id": "cirros_vnfd-VM_average_memory_utilization",
+                                       "id": "ubuntu_vnfd-VM_average_memory_utilization",
                                        "nfvi-metric": "average_memory_utilization"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_disk_read_ops",
+                                       "nfvi-metric": "disk_read_ops"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_disk_write_ops",
+                                       "nfvi-metric": "disk_write_ops"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_disk_read_bytes",
+                                       "nfvi-metric": "disk_read_bytes"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_disk_write_bytes",
+                                       "nfvi-metric": "disk_write_bytes"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_packets_in_dropped",
+                                       "nfvi-metric": "packets_in_dropped"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_packets_out_dropped",
+                                       "nfvi-metric": "packets_out_dropped"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_packets_received",
+                                       "nfvi-metric": "packets_received"
+                               },
+                               {
+                                       "id": "ubuntu_vnfd-VM_packets_sent",
+                                       "nfvi-metric": "packets_sent"
                                }
                        ],
-                       "name": "cirros_vnfd-VM",
+                       "name": "ubuntu_vnfd-VM",
                        "vm-flavor": {
-                               "memory-mb": "256",
-                               "storage-gb": "2",
-                               "vcpu-count": 1
+                               "memory-mb": "4096",
+                               "storage-gb": "20",
+                               "vcpu-count": 4
                        }
                }
        ],
index 332949b..2583c8e 100644 (file)
@@ -1,15 +1,16 @@
 {
+       "_copyright_comment": "Copyright 2016-2019 VMware Inc.  This file is part of ETSI OSM  All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may  not use this file except in compliance with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. For those usages not covered by the Apache License, Version 2.0 please contact:  osslegalrouting@vmware.com",
        "_admin": {
-               "created": 1561569715.5365124,
-               "modified": 1561569715.5365124,
+               "created": 1563297813.7205596,
+               "modified": 1563297813.7205596,
                "projects_read": [
-                       "admin"
+                       "775be778-0f51-495a-b865-a23ab20a080f"
                ],
                "projects_write": [
-                       "admin"
+                       "775be778-0f51-495a-b865-a23ab20a080f"
                ]
        },
-       "_id": "c222366b-4e67-47e8-a3a5-d602ef9f953f",
+       "_id": "a3ec20d6-a47d-4459-ac17-65391424856b",
        "additionalParamsForVnf": null,
        "connection-point": [
                {
                        "name": "eth0"
                }
        ],
-       "created-time": 1561569715.5344007,
-       "id": "c222366b-4e67-47e8-a3a5-d602ef9f953f",
-       "ip-address": "172.21.6.212",
+       "created-time": 1563297813.7185328,
+       "id": "a3ec20d6-a47d-4459-ac17-65391424856b",
+       "ip-address": "172.21.6.152",
        "member-vnf-index-ref": "1",
-       "nsr-id-ref": "66300531-3fb2-43e2-a988-51a1afd9a8f2",
+       "nsr-id-ref": "5915fddf-519a-4235-b18a-41997d76bca0",
        "vdur": [
                {
-                       "_id": "ddb46f3c-d586-4a8e-80c3-87a74d0a3b37",
+                       "_id": "66f70869-8c11-48b6-bd48-95312832ea67",
                        "count-index": 0,
                        "interfaces": [
                                {
-                                       "ip-address": "172.21.6.212",
-                                       "mac-address": "00:50:56:03:01:79",
+                                       "ip-address": "172.21.6.152",
+                                       "mac-address": "fa:16:3e:d2:22:5d",
                                        "mgmt-vnf": true,
                                        "name": "eth0",
-                                       "ns-vld-id": "cirros_nsd_vld1"
+                                       "ns-vld-id": "ubuntu_nsd_vld1"
                                }
                        ],
                        "internal-connection-point": [
                        ],
-                       "ip-address": "172.21.6.212",
-                       "name": "mb-cirros-1-cirros_vnfd-VM-1",
+                       "ip-address": "172.21.6.152",
+                       "name": "vmware-scaling-1-ubuntu_vnfd-VM-1",
                        "status": "ACTIVE",
-                       "status-detailed": "ACTIVE",
-                       "vdu-id-ref": "cirros_vnfd-VM",
-                       "vim-id": "962e29e7-e0b0-4253-b3ef-88df7971f12e"
+                       "status-detailed": null,
+                       "vdu-id-ref": "ubuntu_vnfd-VM",
+                       "vim-id": "VMWARE-UUID-VM-1"
+               },
+               {
+                       "_id": "a1e81bfc-5ded-4a72-9e26-6e1a5f91902a",
+                       "count-index": 1,
+                       "interfaces": [
+                               {
+                                       "ip-address": "172.21.6.163",
+                                       "mac-address": "fa:16:3e:b8:9e:7c",
+                                       "mgmt-vnf": true,
+                                       "name": "eth0",
+                                       "ns-vld-id": "ubuntu_nsd_vld1"
+                               }
+                       ],
+                       "internal-connection-point": [
+                       ],
+                       "ip-address": "172.21.6.163",
+                       "name": "vmware-scaling-1-ubuntu_vnfd-VM-2",
+                       "status": "ACTIVE",
+                       "status-detailed": null,
+                       "vdu-id-ref": "ubuntu_vnfd-VM",
+                       "vim-id": "VMWARE-UUID-VM-2"
                }
        ],
-       "vim-account-id": "43d176fd-dc6d-4fb0-acf3-faf03b1d2589",
-       "vnfd-id": "9d116df6-6fa7-4a5b-b284-a67f554c1261",
-       "vnfd-ref": "cirros_vdu_alarm_vnf"
+       "vim-account-id": "1fc05d6c-2b8b-483e-8d59-f65d658ccfc1",
+       "vnfd-id": "cb0da948-7bce-474d-bbcb-6bfce545d397",
+       "vnfd-ref": "ubuntu_vdu_alarm_vnf"
 }
index 19d1496..740de74 100644 (file)
@@ -22,7 +22,7 @@
 
 from osm_mon.collector.vnf_collectors.vmware import VMwareCollector
 from osm_mon.core.config import Config
-from osm_mon.tests.unit.collector.vnf_collectors.vmware.mock_vcd import mock_vdc_response
+from osm_mon.tests.unit.collector.vnf_collectors.vmware.mock_http import mock_http_response
 from unittest import TestCase, mock
 
 import json
@@ -32,14 +32,12 @@ import requests_mock
 VIM_ACCOUNT = {"vrops_site": "https://vrops",
                "vrops_user": "",
                "vrops_password": "",
-               "vim_url": "",
+               "vim_url": "https://vcd",
                "admin_username": "",
                "admin_password": "",
                "vim_uuid": ""}
 
 
-@mock.patch.object(VMwareCollector, 'get_vm_resource_id',
-                   spec_set=True, autospec=True)
 @mock.patch.object(VMwareCollector, 'get_vm_moref_id',
                    spec_set=True, autospec=True)
 class CollectorTest(TestCase):
@@ -60,101 +58,168 @@ class CollectorTest(TestCase):
     def tearDown(self):
         super().tearDown()
 
-    def test_collect_cpu_and_memory(self, mock_vm_moref_id, mock_vm_resource_id):
+    def test_collect_cpu_and_memory(self, mock_vm_moref_id):
 
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
+        mock_vm_moref_id.return_value = "VMWARE-OID-VM-1"
+        self.vnfd['vdu'][0]['monitoring-param'] = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            {"id": "ubuntu_vnfd-VM_average_memory_utilization", "nfvi-metric": "average_memory_utilization"}
+            ]
         self.mock_db.return_value.get_vnfd.return_value = self.vnfd
 
         with requests_mock.Mocker() as mock_requests:
-            mock_vdc_response(mock_requests,
-                              url_pattern='/suite-api/api/resources/stats.*',
-                              response_file='vrops_multi.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
             metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 2, "Number of metrics returned")
-            self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
-            self.assertEqual(metrics[1].name, "average_memory_utilization", "Second metric name")
-            self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
-            self.assertEqual(metrics[1].value, 20.515941619873047, "Memory metric value")
-
-    def test_collect_one_metric_only(self, mock_vm_moref_id, mock_vm_resource_id):
-
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
-
-        self.vnfd['vdu'][0]['monitoring-param'] = [
-            {'id': 'cirros_vnfd-VM_cpu_util', 'nfvi-metric': 'cpu_utilization'},
-            ]
+        self.assertEqual(len(metrics), 2, "Number of metrics returned")
+        self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
+        self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
+        self.assertEqual(metrics[1].name, "average_memory_utilization", "Second metric name")
+        self.assertEqual(metrics[1].value, 20.515941619873047, "Memory metric value")
+
+    def test_collect_no_moref(self, mock_vm_moref_id):
+        mock_vm_moref_id.return_value = None
         self.mock_db.return_value.get_vnfd.return_value = self.vnfd
-
         with requests_mock.Mocker() as mock_requests:
-            mock_vdc_response(mock_requests,
-                              url_pattern='/suite-api/api/resources/stats.*',
-                              response_file='vrops_multi.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='404.txt', status_code=404)
             metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 1, "Number of metrics returned")
-            self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
-            self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
 
-    def test_collect_adjusted_metric(self, mock_vm_moref_id, mock_vm_resource_id):
-
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
+    def test_collect_no_monitoring_param(self, _):
+        self.vnfd['vdu'][0]['monitoring-param'] = []
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
 
-        self.vnfd['vdu'][0]['monitoring-param'] = [
-            {'id': 'cirros_vnfd-VM_cpu_util', 'nfvi-metric': 'disk_read_bytes'},
-            ]
+    def test_collect_empty_monitoring_param(self, _):
+        del self.vnfd['vdu'][0]['monitoring-param']
         self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
 
+    def test_collect_no_name(self, _):
+        del self.vnfr['vdur'][0]['name']
+        del self.vnfr['vdur'][1]['name']
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
         with requests_mock.Mocker() as mock_requests:
-            mock_vdc_response(mock_requests,
-                              url_pattern='/suite-api/api/resources/stats.*',
-                              response_file='vrops_multi.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
             metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 1, "Number of metrics returned")
-            self.assertEqual(metrics[0].name, "disk_read_bytes", "First metric name")
-            self.assertEqual(metrics[0].value, 10240.0, "Disk read bytes (not KB/s)")
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
 
-    def test_collect_not_provided_metric(self, mock_vm_moref_id, mock_vm_resource_id):
 
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
+class VApp_Details_Test(TestCase):
 
-        self.vnfd['vdu'][0]['monitoring-param'] = [
-            {'id': 'cirros_vnfd-VM_packets_sent', 'nfvi-metric': 'packets_sent'},
-            ]
-        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+    @mock.patch.object(VMwareCollector, 'get_vim_account',
+                       spec_set=True, autospec=True)
+    @mock.patch('osm_mon.collector.vnf_collectors.vmware.CommonDbClient')
+    def setUp(self, mock_db, mock_get_vim_account):
+        super().setUp()
+        self.mock_db = mock_db
+        mock_get_vim_account.return_value = VIM_ACCOUNT
+        self.collector = VMwareCollector(Config(), "9de6df67-b820-48c3-bcae-ee4838c5c5f4")
+
+    def tearDown(self):
+        super().tearDown()
 
+    @mock.patch('osm_mon.collector.vnf_collectors.vmware.Client')
+    def test_get_vapp_details(self, mock_vcd_client):
+        mock_vcd_client.return_value._session.headers = {'x-vcloud-authorization': ''}
         with requests_mock.Mocker() as mock_requests:
-            mock_vdc_response(mock_requests,
-                              url_pattern='/suite-api/api/resources/stats.*',
-                              response_file='OK.json')
-            metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 0, "Number of metrics returned")
+            mock_http_response(mock_requests,
+                               site='https://vcd',
+                               url_pattern='/api/vApp/.*',
+                               response_file='vcd_vapp_response.xml')
+            response = self.collector.get_vapp_details_rest('')
+        self.assertDictContainsSubset({'vm_vcenter_info': {'vm_moref_id': 'vm-4055'}},
+                                      response, 'Managed object reference id incorrect')
+
+    def test_no_admin_connect(self):
+        response = self.collector.get_vapp_details_rest('')
+        self.assertDictEqual(response, {}, 'Failed to connect should return empty dictionary')
+
+    def test_no_id(self):
+        response = self.collector.get_vapp_details_rest()
+        self.assertDictEqual(response, {}, 'No id supplied should return empty dictionary')
+
+    @mock.patch('osm_mon.collector.vnf_collectors.vmware.Client')
+    def test_get_vapp_details_404(self, mock_vcd_client):
+        mock_vcd_client.return_value._session.headers = {'x-vcloud-authorization': ''}
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               site='https://vcd',
+                               url_pattern='/api/vApp/.*',
+                               response_file='404.txt', status_code=404)
+            response = self.collector.get_vapp_details_rest('')
+        self.assertDictEqual(response, {}, 'HTTP error should return empty dictionary')
+
+    @mock.patch('osm_mon.collector.vnf_collectors.vmware.Client')
+    def test_get_vapp_details_xml_parse_error(self, mock_vcd_client):
+        mock_vcd_client.return_value._session.headers = {'x-vcloud-authorization': ''}
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               site='https://vcd',
+                               url_pattern='/api/vApp/.*',
+                               response_file='404.txt')
+            response = self.collector.get_vapp_details_rest('')
+        self.assertDictEqual(response, {}, 'XML parse error should return empty dictionary')
 
-    def test_collect_unkown_metric(self, mock_vm_moref_id, mock_vm_resource_id):
 
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
+class Get_VM_Moref_Test(TestCase):
 
-        self.vnfd['vdu'][0]['monitoring-param'] = [
-            {'id': 'cirros_vnfd-Unknown_Metric', 'nfvi-metric': 'unknown'},
-            ]
-        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+    @mock.patch.object(VMwareCollector, 'get_vim_account',
+                       spec_set=True, autospec=True)
+    @mock.patch('osm_mon.collector.vnf_collectors.vmware.CommonDbClient')
+    def setUp(self, mock_db, mock_get_vim_account):
+        super().setUp()
+        self.mock_db = mock_db
+        mock_get_vim_account.return_value = VIM_ACCOUNT
+        self.collector = VMwareCollector(Config(), "9de6df67-b820-48c3-bcae-ee4838c5c5f4")
 
-        with requests_mock.Mocker() as mock_requests:
-            mock_vdc_response(mock_requests,
-                              url_pattern='/suite-api/api/resources/stats.*',
-                              response_file='vrops_multi.json')
-            metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 0, "Number of metrics returned")
+    def tearDown(self):
+        super().tearDown()
 
-    def test_collect_vrops_error(self, mock_vm_moref_id, mock_vm_resource_id):
+    @mock.patch.object(VMwareCollector, 'get_vapp_details_rest',
+                       spec_set=True, autospec=True)
+    def test_get_vm_moref_id(self, mock_vapp_details):
+        mock_vapp_details.return_value = {'vm_vcenter_info': {'vm_moref_id': 'vm-4055'}}
+        response = self.collector.get_vm_moref_id('1234')
+        self.assertEqual(response, 'vm-4055', 'Did not fetch correct ref id from dictionary')
 
-        mock_vm_moref_id.return_value = "moref"
-        mock_vm_resource_id.return_value = "resource"
-        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+    @mock.patch.object(VMwareCollector, 'get_vapp_details_rest',
+                       spec_set=True, autospec=True)
+    def test_get_vm_moref_bad_content(self, mock_vapp_details):
+        mock_vapp_details.return_value = {}
+        response = self.collector.get_vm_moref_id('1234')
+        self.assertEqual(response, None, 'Error fetching vapp details should return None')
 
-        with requests_mock.Mocker():
-            metrics = self.collector.collect(self.vnfr)
-            self.assertEqual(len(metrics), 0, "Number of metrics returned")
+    @mock.patch.object(VMwareCollector, 'get_vapp_details_rest',
+                       spec_set=True, autospec=True)
+    def test_get_vm_moref_has_exception(self, mock_vapp_details):
+        mock_vapp_details.side_effect = Exception('Testing')
+        response = self.collector.get_vm_moref_id('1234')
+        self.assertEqual(response, None, 'Exception while fetching vapp details should return None')
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vio_collector.py b/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vio_collector.py
new file mode 100644 (file)
index 0000000..215bd53
--- /dev/null
@@ -0,0 +1,121 @@
+# -*- coding: utf-8 -*-
+# #
+# Copyright 2016-2019 VMware Inc.
+# This file is part of ETSI OSM
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact:  osslegalrouting@vmware.com
+# #
+
+from osm_mon.collector.vnf_collectors.vio import VIOCollector
+from osm_mon.core.config import Config
+from osm_mon.tests.unit.collector.vnf_collectors.vmware.mock_http import mock_http_response
+from unittest import TestCase, mock
+
+import json
+import os
+import requests_mock
+
+VIM_ACCOUNT = {"vrops_site": "https://vrops",
+               "vrops_user": "",
+               "vrops_password": "",
+               "vim_url": "",
+               "admin_username": "",
+               "admin_password": "",
+               "vim_uuid": ""}
+
+
+class CollectorTest(TestCase):
+
+    @mock.patch.object(VIOCollector, 'get_vim_account',
+                       spec_set=True, autospec=True)
+    @mock.patch('osm_mon.collector.vnf_collectors.vio.CommonDbClient')
+    def setUp(self, mock_db, mock_get_vim_account):
+        super().setUp()
+        self.mock_db = mock_db
+        mock_get_vim_account.return_value = VIM_ACCOUNT
+        self.collector = VIOCollector(Config(), "9de6df67-b820-48c3-bcae-ee4838c5c5f4")
+        with open(os.path.join(os.path.dirname(__file__), 'osm_mocks', 'VNFR.json'), 'r') as f:
+            self.vnfr = json.load(f)
+        with open(os.path.join(os.path.dirname(__file__), 'osm_mocks', 'VNFD.json'), 'r') as f:
+            self.vnfd = json.load(f)
+
+    def tearDown(self):
+        super().tearDown()
+
+    def test_collect_cpu_and_memory(self):
+        self.vnfd['vdu'][0]['monitoring-param'] = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            {"id": "ubuntu_vnfd-VM_average_memory_utilization", "nfvi-metric": "average_memory_utilization"}
+            ]
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+            self.assertEqual(len(metrics), 4, "Number of metrics returned")
+            self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
+            self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
+            self.assertEqual(metrics[1].name, "average_memory_utilization", "Second metric name")
+            self.assertEqual(metrics[1].value, 20.515941619873047, "Memory metric value")
+            self.assertEqual(metrics[2].name, "cpu_utilization", "First metric name")
+            self.assertEqual(metrics[2].value, 0.05400000140070915, "CPU metric value")
+            self.assertEqual(metrics[3].name, "average_memory_utilization", "Second metric name")
+            self.assertEqual(metrics[3].value, 15.23439884185791, "Memory metric value")
+
+    def test_collect_no_monitoring_param(self):
+        self.vnfd['vdu'][0]['monitoring-param'] = []
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+            self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_empty_monitoring_param(self):
+        del self.vnfd['vdu'][0]['monitoring-param']
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+            self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_no_name(self):
+        del self.vnfr['vdur'][0]['name']
+        del self.vnfr['vdur'][1]['name']
+        self.mock_db.return_value.get_vnfd.return_value = self.vnfd
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.collector.collect(self.vnfr)
+            self.assertEqual(len(metrics), 0, "Number of metrics returned")
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vrops_helper.py b/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vrops_helper.py
new file mode 100644 (file)
index 0000000..956a19f
--- /dev/null
@@ -0,0 +1,263 @@
+# -*- coding: utf-8 -*-
+# #
+# Copyright 2016-2019 VMware Inc.
+# This file is part of ETSI OSM
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact:  osslegalrouting@vmware.com
+# #
+
+from osm_mon.collector.vnf_collectors.vrops.vrops_helper import vROPS_Helper
+from osm_mon.tests.unit.collector.vnf_collectors.vmware.mock_http import mock_http_response
+from unittest import TestCase
+
+import json
+import os
+import requests_mock
+
+
+class vROPS_Helper_Resource_List_Test(TestCase):
+
+    def setUp(self):
+        super().setUp()
+        self.vrops = vROPS_Helper()
+
+    def tearDown(self):
+        super().tearDown()
+
+    def test_get_vm_resource_list_from_vrops(self):
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='vrops_resources.json')
+            resource_list = self.vrops.get_vm_resource_list_from_vrops()
+            self.assertEqual(len(resource_list), 3, "List of resources from canned vrops_resources.json")
+
+    def test_get_vm_resource_list_from_vrops_http_404(self):
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='404.txt', status_code=404)
+            resource_list = self.vrops.get_vm_resource_list_from_vrops()
+            self.assertEqual(len(resource_list), 0, "Should return an empty list")
+
+    def test_get_vm_resource_list_from_vrops_bad_json(self):
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources\\?resourceKind=VirtualMachine',
+                               response_file='malformed.json')
+            resource_list = self.vrops.get_vm_resource_list_from_vrops()
+            self.assertEqual(len(resource_list), 0, "Should return an empty list")
+
+
+class vROPS_Helper_Get_Metrics_Test(TestCase):
+
+    def setUp(self):
+        super().setUp()
+        self.vrops = vROPS_Helper()
+        with open(os.path.join(os.path.dirname(__file__), 'osm_mocks', 'VNFR.json'), 'r') as f:
+            self.vnfr = json.load(f)
+
+    def tearDown(self):
+        super().tearDown()
+
+    def test_collect_one_metric_only(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+        self.assertEqual(len(metrics), 1, "Number of metrics returned")
+        self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
+        self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
+
+    def test_collect_cpu_and_memory(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            {"id": "ubuntu_vnfd-VM_average_memory_utilization", "nfvi-metric": "average_memory_utilization"}
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 2, "Number of metrics returned")
+        self.assertEqual(metrics[0].name, "cpu_utilization", "First metric name")
+        self.assertEqual(metrics[0].value, 100.0, "CPU metric value")
+        self.assertEqual(metrics[1].name, "average_memory_utilization", "Second metric name")
+        self.assertEqual(metrics[1].value, 20.515941619873047, "Memory metric value")
+
+    def test_collect_adjusted_metric(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {'id': 'ubuntu_vnfd-VM_cpu_util', 'nfvi-metric': 'disk_read_bytes'}
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 1, "Number of metrics returned")
+        self.assertEqual(metrics[0].name, "disk_read_bytes", "First metric name")
+        self.assertEqual(metrics[0].value, 10240.0, "Disk read bytes (not KB/s)")
+
+    def test_collect_not_provided_metric(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {'id': 'cirros_vnfd-VM_packets_sent', 'nfvi-metric': 'packets_in_dropped'},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_unkown_metric(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {'id': 'cirros_vnfd-Unknown_Metric', 'nfvi-metric': 'unknown'},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_vrops_no_data(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='OK.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_vrops_unknown_vim_id(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_vrops_http_error(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='404.txt', status_code=404)
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_vrops_json_parse_error(self):
+        vdu_mappings = {'VMWARE-OID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2',
+                         'vrops_id': 'VROPS-UUID-1'}}
+        monitoring_params = [
+            {"id": "ubuntu_vnfd-VM_cpu_util", "nfvi-metric": "cpu_utilization"},
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='404.txt')
+
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), 0, "Number of metrics returned")
+
+    def test_collect_multi_vdu(self):
+        vdu_mappings = {'VMWARE-UUID-VM-1':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-1', 'vrops_id': 'VROPS-UUID-1'},
+                        'VMWARE-UUID-VM-2':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2', 'vrops_id': 'VROPS-UUID-2'},
+                        'VMWARE-UUID-VM-3':
+                        {'name': 'vmware-scaling-1-ubuntu_vnfd-VM-2', 'vrops_id': 'VROPS-UUID-3'}
+                        }
+        monitoring_params = [
+            {'id': 'ubuntu_vnfd-VM_cpu_util', 'nfvi-metric': 'cpu_utilization'},
+            {'id': 'ubuntu_vnfd-VM_average_memory_utilization', 'nfvi-metric': 'average_memory_utilization'},
+            {'id': 'ubuntu_vnfd-VM_disk_read_ops', 'nfvi-metric': 'disk_read_ops'},
+            {'id': 'ubuntu_vnfd-VM_disk_write_ops', 'nfvi-metric': 'disk_write_ops'},
+            {'id': 'ubuntu_vnfd-VM_disk_read_bytes', 'nfvi-metric': 'disk_read_bytes'},
+            {'id': 'ubuntu_vnfd-VM_disk_write_bytes', 'nfvi-metric': 'disk_write_bytes'},
+            {'id': 'ubuntu_vnfd-VM_packets_out_dropped', 'nfvi-metric': 'packets_out_dropped'},
+            {'id': 'ubuntu_vnfd-VM_packets_received', 'nfvi-metric': 'packets_received'},
+            {'id': 'ubuntu_vnfd-VM_packets_sent', 'nfvi-metric': 'packets_sent'}
+            ]
+
+        with requests_mock.Mocker() as mock_requests:
+            mock_http_response(mock_requests,
+                               url_pattern='/suite-api/api/resources/stats.*',
+                               response_file='vrops_multi.json')
+            metrics = self.vrops.get_metrics(vdu_mappings, monitoring_params, self.vnfr)
+
+        self.assertEqual(len(metrics), len(monitoring_params) * len(vdu_mappings), "Number of metrics returned")
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/OK.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/OK.json
deleted file mode 100644 (file)
index 0967ef4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/vrops_multi.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vcd_mocks/vrops_multi.json
deleted file mode 100644 (file)
index 95b0305..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-{
-       "values": [
-               {
-                       "resourceId": "a761f4ae-40a3-4696-ae37-ee447ed421c3",
-                       "stat-list": {
-                               "stat": [
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk:aggregate of all instances|totalReadLatency_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       1.1373332738876343,
-                                                       1.1440000534057617,
-                                                       1.1239999532699585,
-                                                       100.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "cpu|usage_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       6.0,
-                                                       6.066666603088379,
-                                                       6.133333206176758,
-                                                       6.066666603088379
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk:aggregate of all instances|numberWriteAveraged_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk:aggregate of all instances|numberReadAveraged_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "net|droppedTx_summation"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.20000000298023224,
-                                                       0.20000000298023224,
-                                                       0.20000000298023224,
-                                                       10.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk|read_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "net|transmitted_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       20.491540908813477,
-                                                       20.505388259887695,
-                                                       20.517423629760742,
-                                                       20.515941619873047
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "mem|usage_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk:aggregate of all instances|totalWriteLatency_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       46.266666412353516,
-                                                       46.599998474121094,
-                                                       46.93333435058594,
-                                                       46.86666488647461
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "virtualDisk|write_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "net|received_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       },
-                                       {
-                                               "data": [
-                                                       0.0,
-                                                       0.0,
-                                                       0.0,
-                                                       0.0
-                                               ],
-                                               "intervalUnit": {
-                                                       "quantifier": 1
-                                               },
-                                               "statKey": {
-                                                       "key": "net:vmnic5|transmitted_average"
-                                               },
-                                               "timestamps": [
-                                                       1561744712552,
-                                                       1561744772549,
-                                                       1561744832548,
-                                                       1561744892557
-                                               ]
-                                       }
-                               ]
-                       }
-               }
-       ]
-}
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/404.txt b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/404.txt
new file mode 100644 (file)
index 0000000..4e38daa
--- /dev/null
@@ -0,0 +1,20 @@
+404 NOT FOUND
+
+ Copyright 2016-2019 VMware Inc.
+ This file is part of ETSI OSM
+ All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+ For those usages not covered by the Apache License, Version 2.0 please
+ contact:  osslegalrouting@vmware.com
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/OK.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/OK.json
new file mode 100644 (file)
index 0000000..cad20b3
--- /dev/null
@@ -0,0 +1,3 @@
+{
+       "_copyright_comment": "Copyright 2016-2019 VMware Inc.  This file is part of ETSI OSM  All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may  not use this file except in compliance with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. For those usages not covered by the Apache License, Version 2.0 please contact:  osslegalrouting@vmware.com"
+}
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/malformed.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/malformed.json
new file mode 100644 (file)
index 0000000..9b3bf23
--- /dev/null
@@ -0,0 +1,22 @@
+{
+       This is not valid JSON
+
+ Copyright 2016-2019 VMware Inc.
+ This file is part of ETSI OSM
+ All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+ For those usages not covered by the Apache License, Version 2.0 please
+ contact:  osslegalrouting@vmware.com
+}
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vcd_vapp_response.xml b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vcd_vapp_response.xml
new file mode 100644 (file)
index 0000000..5b1fd54
--- /dev/null
@@ -0,0 +1,521 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright 2016-2019 VMware Inc.
+ This file is part of ETSI OSM
+ All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+ For those usages not covered by the Apache License, Version 2.0 please
+ contact:  osslegalrouting@vmware.com
+-->
+<VApp xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ns9="http://www.vmware.com/vcloud/versions" ovfDescriptorUploaded="true" deployed="true" status="4" name="MB-Ubuntu-1-ubuntu_vnfd-VM-1-c01293c4-e427-47fb-8e6c-694c9af660d3" id="urn:vcloud:vapp:80c8a597-5ed1-4b52-a8b6-e04945fd36b2" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2" type="application/vnd.vmware.vcloud.vApp+xml">
+    <Link rel="power:powerOff" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/power/action/powerOff"/>
+    <Link rel="power:reboot" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/power/action/reboot"/>
+    <Link rel="power:reset" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/power/action/reset"/>
+    <Link rel="power:shutdown" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/power/action/shutdown"/>
+    <Link rel="power:suspend" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/power/action/suspend"/>
+    <Link rel="deploy" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/deploy" type="application/vnd.vmware.vcloud.deployVAppParams+xml"/>
+    <Link rel="undeploy" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/undeploy" type="application/vnd.vmware.vcloud.undeployVAppParams+xml"/>
+    <Link rel="down" href="https://172.21.6.38/api/network/6d042159-d109-44e5-89e4-39a30ed8208f" name="vnf-mgmt" type="application/vnd.vmware.vcloud.vAppNetwork+xml"/>
+    <Link rel="down" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>
+    <Link rel="controlAccess" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>
+    <Link rel="recompose" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/recomposeVApp" type="application/vnd.vmware.vcloud.recomposeVAppParams+xml"/>
+    <Link rel="enterMaintenanceMode" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/enterMaintenanceMode"/>
+    <Link rel="up" href="https://172.21.6.38/api/vdc/a5771f81-471a-4cda-a02c-0b897ba49c51" type="application/vnd.vmware.vcloud.vdc+xml"/>
+    <Link rel="edit" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2" type="application/vnd.vmware.vcloud.vApp+xml"/>
+    <Link rel="down" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/owner" type="application/vnd.vmware.vcloud.owner+xml"/>
+    <Link rel="down" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>
+    <Link rel="ovf" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/ovf" type="text/xml"/>
+    <Link rel="down" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/productSections/" type="application/vnd.vmware.vcloud.productSections+xml"/>
+    <Link rel="snapshot:create" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/action/createSnapshot" type="application/vnd.vmware.vcloud.createSnapshotParams+xml"/>
+    <Description>Vapp instantiation</Description>
+    <LeaseSettingsSection href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/leaseSettingsSection/" type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" ovf:required="false">
+        <ovf:Info>Lease settings section</ovf:Info>
+        <Link rel="edit" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/leaseSettingsSection/" type="application/vnd.vmware.vcloud.leaseSettingsSection+xml"/>
+        <DeploymentLeaseInSeconds>604800</DeploymentLeaseInSeconds>
+        <StorageLeaseInSeconds>172800</StorageLeaseInSeconds>
+        <DeploymentLeaseExpiration>2019-07-31T21:22:09.915Z</DeploymentLeaseExpiration>
+    </LeaseSettingsSection>
+    <ovf:StartupSection xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ns10:type="application/vnd.vmware.vcloud.startupSection+xml" ns10:href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/startupSection/">
+        <ovf:Info>VApp startup section</ovf:Info>
+        <ovf:Item ovf:id="ubuntu" ovf:order="0" ovf:startAction="powerOn" ovf:startDelay="0" ovf:stopAction="powerOff" ovf:stopDelay="0"/>
+        <Link rel="edit" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/startupSection/" type="application/vnd.vmware.vcloud.startupSection+xml"/>
+    </ovf:StartupSection>
+    <ovf:NetworkSection xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ns10:type="application/vnd.vmware.vcloud.networkSection+xml" ns10:href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/networkSection/">
+        <ovf:Info>The list of logical networks</ovf:Info>
+        <ovf:Network ovf:name="vnf-mgmt">
+            <ovf:Description></ovf:Description>
+        </ovf:Network>
+    </ovf:NetworkSection>
+    <NetworkConfigSection href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/networkConfigSection/" type="application/vnd.vmware.vcloud.networkConfigSection+xml" ovf:required="false">
+        <ovf:Info>The configuration parameters for logical networks</ovf:Info>
+        <Link rel="edit" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/networkConfigSection/" type="application/vnd.vmware.vcloud.networkConfigSection+xml"/>
+        <NetworkConfig networkName="vnf-mgmt">
+            <VCloudExtension required="false">
+                <vmext:VimObjectRef>
+                    <vmext:VimServerRef href="https://172.21.6.38/api/admin/extension/vimServer/116d2935-59fc-4702-876c-a417436caec7" id="urn:vcloud:vimserver:116d2935-59fc-4702-876c-a417436caec7" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"/>
+                    <vmext:MoRef>dvportgroup-956</vmext:MoRef>
+                    <vmext:VimObjectType>DV_PORTGROUP</vmext:VimObjectType>
+                </vmext:VimObjectRef>
+            </VCloudExtension>
+            <Link rel="repair" href="https://172.21.6.38/api/admin/network/6d042159-d109-44e5-89e4-39a30ed8208f/action/reset"/>
+            <Description></Description>
+            <Configuration>
+                <IpScopes>
+                    <IpScope>
+                        <IsInherited>true</IsInherited>
+                        <Gateway>172.21.6.130</Gateway>
+                        <Netmask>255.255.255.128</Netmask>
+                        <SubnetPrefixLength>25</SubnetPrefixLength>
+                        <Dns1>172.21.6.10</Dns1>
+                        <DnsSuffix>corp.local</DnsSuffix>
+                        <IsEnabled>true</IsEnabled>
+                        <IpRanges>
+                            <IpRange>
+<StartAddress>172.21.6.175</StartAddress>
+<EndAddress>172.21.6.198</EndAddress>
+                            </IpRange>
+                        </IpRanges>
+                    </IpScope>
+                </IpScopes>
+                <ParentNetwork href="https://172.21.6.38/api/admin/network/6412df5b-340c-4949-b843-da0fa29af418" id="6412df5b-340c-4949-b843-da0fa29af418" name="vnf-mgmt"/>
+                <FenceMode>bridged</FenceMode>
+                <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
+            </Configuration>
+            <IsDeployed>true</IsDeployed>
+        </NetworkConfig>
+    </NetworkConfigSection>
+    <SnapshotSection href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2/snapshotSection" type="application/vnd.vmware.vcloud.snapshotSection+xml" ovf:required="false">
+        <ovf:Info>Snapshot information section</ovf:Info>
+    </SnapshotSection>
+    <DateCreated>2019-07-24T21:20:41.929Z</DateCreated>
+    <Owner type="application/vnd.vmware.vcloud.owner+xml">
+        <User href="https://172.21.6.38/api/admin/user/e2686eea-0a8e-4c59-a52c-4a9826d5a12b" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/>
+    </Owner>
+    <autoNature>false</autoNature>
+    <InMaintenanceMode>false</InMaintenanceMode>
+    <Children>
+        <Vm needsCustomization="false" nestedHypervisorEnabled="false" deployed="true" status="4" name="ubuntu" id="urn:vcloud:vm:a1022e38-05e9-404d-b6ff-d6b896cec1bc" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc" type="application/vnd.vmware.vcloud.vm+xml">
+            <VCloudExtension required="false">
+                <vmext:VmVimInfo>
+                    <vmext:VmVimObjectRef>
+                        <vmext:VimServerRef href="https://172.21.6.38/api/admin/extension/vimServer/116d2935-59fc-4702-876c-a417436caec7" id="urn:vcloud:vimserver:116d2935-59fc-4702-876c-a417436caec7" name="Hive VC" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"/>
+                        <vmext:MoRef>vm-4055</vmext:MoRef>
+                        <vmext:VimObjectType>VIRTUAL_MACHINE</vmext:VimObjectType>
+                    </vmext:VmVimObjectRef>
+                    <vmext:DatastoreVimObjectRef>
+                        <vmext:VimServerRef href="https://172.21.6.38/api/admin/extension/vimServer/116d2935-59fc-4702-876c-a417436caec7" id="urn:vcloud:vimserver:116d2935-59fc-4702-876c-a417436caec7" name="Hive VC" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"/>
+                        <vmext:MoRef>datastore-936</vmext:MoRef>
+                        <vmext:VimObjectType>DATASTORE</vmext:VimObjectType>
+                    </vmext:DatastoreVimObjectRef>
+                    <vmext:VmDiskDatastores instanceId="2000">
+                        <vmext:VimServerRef href="https://172.21.6.38/api/admin/extension/vimServer/116d2935-59fc-4702-876c-a417436caec7" id="urn:vcloud:vimserver:116d2935-59fc-4702-876c-a417436caec7" name="Hive VC" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"/>
+                        <vmext:MoRef>datastore-936</vmext:MoRef>
+                        <vmext:VimObjectType>DATASTORE</vmext:VimObjectType>
+                    </vmext:VmDiskDatastores>
+                    <vmext:HostVimObjectRef>
+                        <vmext:VimServerRef href="https://172.21.6.38/api/admin/extension/vimServer/116d2935-59fc-4702-876c-a417436caec7" id="urn:vcloud:vimserver:116d2935-59fc-4702-876c-a417436caec7" name="Hive VC" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"/>
+                        <vmext:MoRef>host-13</vmext:MoRef>
+                        <vmext:VimObjectType>HOST</vmext:VimObjectType>
+                    </vmext:HostVimObjectRef>
+                    <vmext:VirtualDisksMaxChainLength>2</vmext:VirtualDisksMaxChainLength>
+                </vmext:VmVimInfo>
+            </VCloudExtension>
+            <Link rel="power:powerOff" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/power/action/powerOff"/>
+            <Link rel="power:reboot" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/power/action/reboot"/>
+            <Link rel="power:reset" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/power/action/reset"/>
+            <Link rel="power:shutdown" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/power/action/shutdown"/>
+            <Link rel="power:suspend" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/power/action/suspend"/>
+            <Link rel="undeploy" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/undeploy" type="application/vnd.vmware.vcloud.undeployVAppParams+xml"/>
+            <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc" type="application/vnd.vmware.vcloud.vm+xml"/>
+            <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>
+            <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/complianceResult" type="application/vnd.vmware.vm.complianceResult+xml"/>
+            <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/productSections/" type="application/vnd.vmware.vcloud.productSections+xml"/>
+            <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/metrics/current" type="application/vnd.vmware.vcloud.metrics.currentUsageSpec+xml"/>
+            <Link rel="metrics" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/metrics/current" type="application/vnd.vmware.vcloud.metrics.currentUsageSpec+xml"/>
+            <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/metrics/historic" type="application/vnd.vmware.vcloud.metrics.historicUsageSpec+xml"/>
+            <Link rel="metrics" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/metrics/historic" type="application/vnd.vmware.vcloud.metrics.historicUsageSpec+xml"/>
+            <Link rel="screen:thumbnail" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/screen"/>
+            <Link rel="screen:acquireTicket" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/screen/action/acquireTicket" type="application/vnd.vmware.vcloud.screenTicket+xml"/>
+            <Link rel="screen:acquireMksTicket" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/screen/action/acquireMksTicket" type="application/vnd.vmware.vcloud.mksTicket+xml"/>
+            <Link rel="media:insertMedia" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/media/action/insertMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"/>
+            <Link rel="media:ejectMedia" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/media/action/ejectMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"/>
+            <Link rel="disk:attach" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/disk/action/attach" type="application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml"/>
+            <Link rel="disk:detach" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/disk/action/detach" type="application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml"/>
+            <Link rel="installVmwareTools" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/installVMwareTools"/>
+            <Link rel="relocate" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/relocate" type="application/vnd.vmware.vcloud.relocateVmParams+xml"/>
+            <Link rel="customizeAtNextPowerOn" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/customizeAtNextPowerOn"/>
+            <Link rel="reloadFromVc" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/reloadFromVc"/>
+            <Link rel="checkCompliance" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/checkCompliance"/>
+            <Link rel="snapshot:create" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/createSnapshot" type="application/vnd.vmware.vcloud.createSnapshotParams+xml"/>
+            <Link rel="reconfigureVm" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/reconfigureVm" name="ubuntu" type="application/vnd.vmware.vcloud.vm+xml"/>
+            <Link rel="up" href="https://172.21.6.38/api/vApp/vapp-80c8a597-5ed1-4b52-a8b6-e04945fd36b2" type="application/vnd.vmware.vcloud.vApp+xml"/>
+            <Description></Description>
+            <ovf:VirtualHardwareSection xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ovf:transport="" ns10:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" ns10:href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/">
+                <ovf:Info>Virtual hardware requirements</ovf:Info>
+                <ovf:System>
+                    <vssd:AutomaticRecoveryAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:AutomaticShutdownAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:AutomaticStartupAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:AutomaticStartupActionDelay xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:AutomaticStartupActionSequenceNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ConfigurationDataRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ConfigurationFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ConfigurationID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:CreationTime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:Description xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
+                    <vssd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:InstanceID>0</vssd:InstanceID>
+                    <vssd:LogDataRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:RecoveryFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:SnapshotDataRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:SuspendDataRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:SwapFileDataRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <vssd:VirtualSystemIdentifier>ubuntu</vssd:VirtualSystemIdentifier>
+                    <vssd:VirtualSystemType>vmx-14</vssd:VirtualSystemType>
+                </ovf:System>
+                <ovf:Item>
+                    <rasd:Address>00:50:56:03:01:86</rasd:Address>
+                    <rasd:AddressOnParent>0</rasd:AddressOnParent>
+                    <rasd:AllocationUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Connection ns10:ipAddressingMode="DHCP" ns10:ipAddress="172.21.6.214" ns10:primaryNetworkConnection="true">vnf-mgmt</rasd:Connection>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>Vmxnet3 ethernet adapter on "vnf-mgmt"</rasd:Description>
+                    <rasd:ElementName>Network adapter 0</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:InstanceID>1</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceSubType>VMXNET3</rasd:ResourceSubType>
+                    <rasd:ResourceType>10</rasd:ResourceType>
+                    <rasd:VirtualQuantity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                </ovf:Item>
+                <ovf:Item>
+                    <rasd:Address>0</rasd:Address>
+                    <rasd:AddressOnParent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AllocationUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticAllocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>SCSI Controller</rasd:Description>
+                    <rasd:ElementName>SCSI Controller 0</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:InstanceID>2</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
+                    <rasd:ResourceType>6</rasd:ResourceType>
+                    <rasd:VirtualQuantity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                </ovf:Item>
+                <ovf:Item>
+                    <rasd:Address xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AddressOnParent>0</rasd:AddressOnParent>
+                    <rasd:AllocationUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticAllocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>Hard disk</rasd:Description>
+                    <rasd:ElementName>Hard disk 1</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:HostResource ns10:storageProfileHref="https://172.21.6.38/api/vdcStorageProfile/a9dae5fb-43fd-4fdd-885d-87bb6532aa18" ns10:busType="6" ns10:busSubType="lsilogic" ns10:capacity="16384" ns10:iops="0" ns10:storageProfileOverrideVmDefault="false"></rasd:HostResource>
+                    <rasd:InstanceID>2000</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent>2</rasd:Parent>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceSubType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceType>17</rasd:ResourceType>
+                    <rasd:VirtualQuantity>17179869184</rasd:VirtualQuantity>
+                    <rasd:VirtualQuantityUnits>byte</rasd:VirtualQuantityUnits>
+                    <rasd:Weight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                </ovf:Item>
+                <ovf:Item>
+                    <rasd:Address>0</rasd:Address>
+                    <rasd:AddressOnParent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AllocationUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticAllocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>SATA Controller</rasd:Description>
+                    <rasd:ElementName>SATA Controller 0</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:InstanceID>3</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceSubType>vmware.sata.ahci</rasd:ResourceSubType>
+                    <rasd:ResourceType>20</rasd:ResourceType>
+                    <rasd:VirtualQuantity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                </ovf:Item>
+                <ovf:Item>
+                    <rasd:Address xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AddressOnParent>0</rasd:AddressOnParent>
+                    <rasd:AllocationUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>CD/DVD Drive</rasd:Description>
+                    <rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:HostResource></rasd:HostResource>
+                    <rasd:InstanceID>16000</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent>3</rasd:Parent>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceSubType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceType>15</rasd:ResourceType>
+                    <rasd:VirtualQuantity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                </ovf:Item>
+                <ovf:Item ns10:type="application/vnd.vmware.vcloud.rasdItem+xml" ns10:href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/cpu">
+                    <rasd:Address xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AddressOnParent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
+                    <rasd:AutomaticAllocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>Number of Virtual CPUs</rasd:Description>
+                    <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:InstanceID>4</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation>0</rasd:Reservation>
+                    <rasd:ResourceSubType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceType>3</rasd:ResourceType>
+                    <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight>1000</rasd:Weight>
+                    <vmw:CoresPerSocket ovf:required="false">1</vmw:CoresPerSocket>
+                    <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                </ovf:Item>
+                <ovf:Item ns10:type="application/vnd.vmware.vcloud.rasdItem+xml" ns10:href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/memory">
+                    <rasd:Address xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AddressOnParent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
+                    <rasd:AutomaticAllocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:AutomaticDeallocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Caption xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ChangeableType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConfigurationName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ConsumerVisibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Description>Memory Size</rasd:Description>
+                    <rasd:ElementName>1024 MB of memory</rasd:ElementName>
+                    <rasd:Generation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:InstanceID>5</rasd:InstanceID>
+                    <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Parent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:PoolID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Reservation>0</rasd:Reservation>
+                    <rasd:ResourceSubType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:ResourceType>4</rasd:ResourceType>
+                    <rasd:VirtualQuantity>1024</rasd:VirtualQuantity>
+                    <rasd:VirtualQuantityUnits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+                    <rasd:Weight>10240</rasd:Weight>
+                    <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                </ovf:Item>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/" type="application/vnd.vmware.vcloud.virtualHardwareSection+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/media" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.checkpointSVGAPrimarySize" vmw:value="4194304"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="pciBridge0.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.functions" vmw:value="8"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="vmware.tools.internalversion" vmw:value="10304"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="vmware.tools.requiredversion" vmw:value="10338"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="sata0.pciSlotNumber" vmw:value="33"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.vmtools.buildNumber" vmw:value="7253323"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="sched.swap.derivedName" vmw:value="/vmfs/volumes/8e81a4eb-407b9e20/ubuntu-pDRI/ubuntu-pDRI-9ef8ca33.vswp"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.virtualDev" vmw:value="pcieRootPort"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="cloud.uuid" vmw:value="8bc8661d-5172-49d5-b2ec-c4808040a4f0"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="pciBridge4.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="nvram" vmw:value="ubuntu-pDRI.nvram"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="pciBridge5.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="tools.guest.desktop.autolock" vmw:value="FALSE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.pciSlotNumber" vmw:value="23"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.vmtools.versionString" vmw:value="10.2.0"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="pciBridge7.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="pciBridge6.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.pciSlotNumber" vmw:value="21"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.vmtools.versionNumber" vmw:value="10304"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.virtualDev" vmw:value="pcieRootPort"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="migrate.migrationId" vmw:value="8827505165397353629"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="hpet0.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="migrate.hostLog" vmw:value="ubuntu-pDRI-7c665aaf.hlog"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.cookie" vmw:value="10001"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.functions" vmw:value="8"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="monitor.phys_bits_used" vmw:value="43"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="svga.present" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.pciSlotNumber" vmw:value="24"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.pciSlotNumber" vmw:value="17"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="ethernet0.pciSlotNumber" vmw:value="160"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.functions" vmw:value="8"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="scsi0.pciSlotNumber" vmw:value="16"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.virtualDev" vmw:value="pcieRootPort"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="migrate.hostLogState" vmw:value="none"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.pciSlotNumber" vmw:value="22"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.vmtools.description" vmw:value="open-vm-tools 10.2.0 build 7253323"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="softPowerOff" vmw:value="FALSE"/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="svga.guestBackedPrimaryAware" vmw:value="TRUE"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="scsi0:0.redo" vmw:value=""/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.ovfEnv" vmw:value=""/>
+                <vmw:ExtraConfig ovf:required="true" vmw:key="numa.autosize.vcpu.maxPerVirtualNode" vmw:value="1"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="vmci0.pciSlotNumber" vmw:value="32"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.virtualDev" vmw:value="pcieRootPort"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="sched.cpu.latencySensitivity" vmw:value="normal"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.functions" vmw:value="8"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="guestinfo.gc.status" vmw:value="Successful"/>
+                <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.checkpointFBSize" vmw:value="4194304"/>
+            </ovf:VirtualHardwareSection>
+            <ovf:OperatingSystemSection xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ovf:id="102" ns10:type="application/vnd.vmware.vcloud.operatingSystemSection+xml" vmw:osType="ubuntu64Guest" ns10:href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/operatingSystemSection/">
+                <ovf:Info>Specifies the operating system installed</ovf:Info>
+                <ovf:Description>Ubuntu Linux (64-bit)</ovf:Description>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/operatingSystemSection/" type="application/vnd.vmware.vcloud.operatingSystemSection+xml"/>
+            </ovf:OperatingSystemSection>
+            <NetworkConnectionSection href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml" ovf:required="false">
+                <ovf:Info>Specifies the available VM network connections</ovf:Info>
+                <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
+                <NetworkConnection needsCustomization="false" network="vnf-mgmt">
+                    <NetworkConnectionIndex>0</NetworkConnectionIndex>
+                    <IpAddress>172.21.6.214</IpAddress>
+                    <IsConnected>true</IsConnected>
+                    <MACAddress>00:50:56:03:01:86</MACAddress>
+                    <IpAddressAllocationMode>DHCP</IpAddressAllocationMode>
+                    <NetworkAdapterType>VMXNET3</NetworkAdapterType>
+                </NetworkConnection>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml"/>
+            </NetworkConnectionSection>
+            <GuestCustomizationSection href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" ovf:required="false">
+                <ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
+                <Enabled>true</Enabled>
+                <ChangeSid>false</ChangeSid>
+                <VirtualMachineId>a1022e38-05e9-404d-b6ff-d6b896cec1bc</VirtualMachineId>
+                <JoinDomainEnabled>false</JoinDomainEnabled>
+                <UseOrgSettings>false</UseOrgSettings>
+                <AdminPasswordEnabled>false</AdminPasswordEnabled>
+                <AdminPasswordAuto>true</AdminPasswordAuto>
+                <AdminAutoLogonEnabled>false</AdminAutoLogonEnabled>
+                <AdminAutoLogonCount>0</AdminAutoLogonCount>
+                <ResetPasswordRequired>false</ResetPasswordRequired>
+                <ComputerName>ubuntu-001</ComputerName>
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/guestcustomizationstatus/" type="application/vnd.vmware.vcloud.guestCustomizationStatusSection+xml"/>
+                <Link rel="down" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/checkpostcustomizationscript/" type="application/vnd.vmware.vcloud.vm.checkPostGuestCustomizationSection+xml"/>
+            </GuestCustomizationSection>
+            <RuntimeInfoSection xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ns10:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" ns10:href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/runtimeInfoSection">
+                <ovf:Info>Specifies Runtime info</ovf:Info>
+                <VMWareTools version="10304"/>
+            </RuntimeInfoSection>
+            <SnapshotSection href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/snapshotSection" type="application/vnd.vmware.vcloud.snapshotSection+xml" ovf:required="false">
+                <ovf:Info>Snapshot information section</ovf:Info>
+            </SnapshotSection>
+            <DateCreated>2019-07-24T21:20:47.602Z</DateCreated>
+            <VAppScopedLocalId>ubuntu</VAppScopedLocalId>
+            <ovfenv:Environment xmlns:ve="http://www.vmware.com/schema/ovfenv" ovfenv:id="" ve:vCenterId="vm-4055">
+                <ovfenv:PlatformSection>
+                    <ovfenv:Kind>VMware ESXi</ovfenv:Kind>
+                    <ovfenv:Version>6.7.0</ovfenv:Version>
+                    <ovfenv:Vendor>VMware, Inc.</ovfenv:Vendor>
+                    <ovfenv:Locale>en</ovfenv:Locale>
+                </ovfenv:PlatformSection>
+                <ovfenv:PropertySection>
+                    <ovfenv:Property ovfenv:key="vCloud_UseSysPrep" ovfenv:value="None"/>
+                    <ovfenv:Property ovfenv:key="vCloud_bitMask" ovfenv:value="1"/>
+                    <ovfenv:Property ovfenv:key="vCloud_bootproto_0" ovfenv:value="dhcp"/>
+                    <ovfenv:Property ovfenv:key="vCloud_computerName" ovfenv:value="ubuntu-001"/>
+                    <ovfenv:Property ovfenv:key="vCloud_macaddr_0" ovfenv:value="00:50:56:03:01:86"/>
+                    <ovfenv:Property ovfenv:key="vCloud_markerid" ovfenv:value="32ef75ab-6ff8-494f-bade-208e3b5ff086"/>
+                    <ovfenv:Property ovfenv:key="vCloud_numnics" ovfenv:value="1"/>
+                    <ovfenv:Property ovfenv:key="vCloud_primaryNic" ovfenv:value="0"/>
+                    <ovfenv:Property ovfenv:key="vCloud_reconfigToken" ovfenv:value="300838675"/>
+                    <ovfenv:Property ovfenv:key="vCloud_resetPassword" ovfenv:value="0"/>
+                </ovfenv:PropertySection>
+                <ve:EthernetAdapterSection xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+                    <ve:Adapter ve:mac="00:50:56:03:01:86" ve:network="DP-VCD-External-102" ve:unitNumber="7"/>
+   </ve:EthernetAdapterSection>
+            </ovfenv:Environment>
+            <VmCapabilities href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml">
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml"/>
+                <MemoryHotAddEnabled>false</MemoryHotAddEnabled>
+                <CpuHotAddEnabled>false</CpuHotAddEnabled>
+            </VmCapabilities>
+            <StorageProfile href="https://172.21.6.38/api/vdcStorageProfile/a9dae5fb-43fd-4fdd-885d-87bb6532aa18" id="urn:vcloud:vdcstorageProfile:a9dae5fb-43fd-4fdd-885d-87bb6532aa18" name="NFS Storage" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/>
+            <BootOptions href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/bootOptions/" type="application/vnd.vmware.vcloud.bootOptionsSection+xml">
+                <Link rel="edit" href="https://172.21.6.38/api/vApp/vm-a1022e38-05e9-404d-b6ff-d6b896cec1bc/action/bootOptions" type="application/vnd.vmware.vcloud.bootOptionsSection+xml"/>
+                <BootDelay>0</BootDelay>
+                <EnterBIOSSetup>false</EnterBIOSSetup>
+            </BootOptions>
+        </Vm>
+    </Children>
+</VApp>
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_multi.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_multi.json
new file mode 100644 (file)
index 0000000..e11179f
--- /dev/null
@@ -0,0 +1,1490 @@
+{
+       "_copyright_comment": "Copyright 2016-2019 VMware Inc.  This file is part of ETSI OSM  All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may  not use this file except in compliance with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. For those usages not covered by the Apache License, Version 2.0 please contact:  osslegalrouting@vmware.com",
+       "values": [
+               {
+                       "resourceId": "VROPS-UUID-1",
+                       "stat-list": {
+                               "stat": [
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|totalReadLatency_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       1.1373332738876343,
+                                                       1.1440000534057617,
+                                                       1.1239999532699585,
+                                                       100.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "cpu|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       6.0,
+                                                       6.066666603088379,
+                                                       6.133333206176758,
+                                                       6.066666603088379
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberWriteAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberReadAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|droppedTx_summation"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.20000000298023224,
+                                                       0.20000000298023224,
+                                                       0.20000000298023224,
+                                                       10.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|read_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       20.491540908813477,
+                                                       20.505388259887695,
+                                                       20.517423629760742,
+                                                       20.515941619873047
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "mem|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|totalWriteLatency_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       46.266666412353516,
+                                                       46.599998474121094,
+                                                       46.93333435058594,
+                                                       46.86666488647461
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|write_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic5|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1561744712552,
+                                                       1561744772549,
+                                                       1561744832548,
+                                                       1561744892557
+                                               ]
+                                       }
+                               ]
+                       }
+               },
+               {
+                       "resourceId": "VROPS-UUID-2",
+                       "stat-list": {
+                               "stat": [
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic4|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic0|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic9|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic5|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.05400000140070915,
+                                                       0.05533333495259285,
+                                                       0.05400000140070915
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "cpu|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic9|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:scsi0:0|read_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberWriteAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic6|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic1|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:scsi0:0|write_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic2|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic7|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberReadAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic2|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic7|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic8|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic0|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|droppedTx_summation"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic5|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|read_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic3|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic3|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       15.234436988830566,
+                                                       15.23439884185791,
+                                                       15.23439884185791
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "mem|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|write_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|droppedTx_summation"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic8|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic1|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic4|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic6|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       }
+                               ]
+                       }
+               },
+               {
+                       "resourceId": "VROPS-UUID-3",
+                       "stat-list": {
+                               "stat": [
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic4|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic0|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic9|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic5|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0560000017285347,
+                                                       0.05400000140070915,
+                                                       0.052666667848825455
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "cpu|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic9|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:scsi0:0|read_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberWriteAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic6|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic1|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:scsi0:0|write_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic2|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic7|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk:aggregate of all instances|numberReadAveraged_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic2|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic7|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic8|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic0|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|droppedTx_summation"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic5|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|read_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic3|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic3|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       15.244717597961426,
+                                                       15.244698524475098,
+                                                       15.24467945098877
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "mem|usage_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "virtualDisk|write_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:4000|droppedTx_summation"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic8|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic1|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic4|received_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       },
+                                       {
+                                               "data": [
+                                                       0.0,
+                                                       0.0,
+                                                       0.0
+                                               ],
+                                               "intervalUnit": {
+                                                       "quantifier": 1
+                                               },
+                                               "statKey": {
+                                                       "key": "net:vmnic6|transmitted_average"
+                                               },
+                                               "timestamps": [
+                                                       1563301072756,
+                                                       1563301132765,
+                                                       1563301192756
+                                               ]
+                                       }
+                               ]
+                       }
+               }
+       ]
+}
diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_resources.json b/osm_mon/tests/unit/collector/vnf_collectors/vmware/vmware_mocks/vrops_resources.json
new file mode 100644 (file)
index 0000000..1165740
--- /dev/null
@@ -0,0 +1,447 @@
+{
+       "_copyright_comment": "Copyright 2016-2019 VMware Inc.  This file is part of ETSI OSM  All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may  not use this file except in compliance with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. For those usages not covered by the Apache License, Version 2.0 please contact:  osslegalrouting@vmware.com",
+       "links": [
+               {
+                       "href": "/suite-api/api/resources?resourceKind=VirtualMachine&amp;page=0&amp;pageSize=1000",
+                       "name": "current",
+                       "rel": "SELF"
+               },
+               {
+                       "href": "/suite-api/api/resources?resourceKind=VirtualMachine&amp;page=0&amp;pageSize=1000",
+                       "name": "first",
+                       "rel": "RELATED"
+               },
+               {
+                       "href": "/suite-api/api/resources?resourceKind=VirtualMachine&amp;page=0&amp;pageSize=1000",
+                       "name": "last",
+                       "rel": "RELATED"
+               }
+       ],
+       "pageInfo": {
+               "page": 0,
+               "pageSize": 1000,
+               "totalCount": 130
+       },
+       "resourceList": [
+               {
+                       "badges": [
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "RISK"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "CAPACITY_REMAINING"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "EFFICIENCY"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "WORKLOAD"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 366.0,
+                                       "type": "TIME_REMAINING"
+                               },
+                               {
+                                       "color": "GREY",
+                                       "score": -1.0,
+                                       "type": "COMPLIANCE"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "HEALTH"
+                               }
+                       ],
+                       "creationTime": 1559557138756,
+                       "dtEnabled": true,
+                       "identifier": "VROPS-UUID-1",
+                       "links": [
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "linkToSelf",
+                                       "rel": "SELF"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/relationships",
+                                       "name": "relationsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "propertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/alerts?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "alertsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/symptoms?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "symptomsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/statkeys",
+                                       "name": "statKeysOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/stats/latest",
+                                       "name": "latestStatsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "latestPropertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/credentials/",
+                                       "name": "credentialsOfResource",
+                                       "rel": "RELATED"
+                               }
+                       ],
+                       "relatedResources": [
+                       ],
+                       "resourceHealth": "GREEN",
+                       "resourceHealthValue": 100.0,
+                       "resourceKey": {
+                               "adapterKindKey": "VMWARE",
+                               "name": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML",
+                               "resourceIdentifiers": [
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityInstanceUUID"
+                                               },
+                                               "value": "VMWARE-UUID-VM-1"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityName"
+                                               },
+                                               "value": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityObjectID"
+                                               },
+                                               "value": "VMWARE-OID-VM-1"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityVCID"
+                                               },
+                                               "value": "1ec8501f-dce7-4e0b-8f8b-19ba7060d33c"
+                                       }
+                               ],
+                               "resourceKindKey": "VirtualMachine"
+                       },
+                       "resourceStatusStates": [
+                               {
+                                       "adapterInstanceId": "fcf7ba35-72f0-4d36-a12d-45a0c4065e17",
+                                       "resourceState": "STARTED",
+                                       "resourceStatus": "DATA_RECEIVING",
+                                       "statusMessage": ""
+                               }
+                       ]
+               },
+               {
+                       "badges": [
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "RISK"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "CAPACITY_REMAINING"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "EFFICIENCY"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "WORKLOAD"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 366.0,
+                                       "type": "TIME_REMAINING"
+                               },
+                               {
+                                       "color": "GREY",
+                                       "score": -1.0,
+                                       "type": "COMPLIANCE"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "HEALTH"
+                               }
+                       ],
+                       "creationTime": 1559557138756,
+                       "dtEnabled": true,
+                       "identifier": "VROPS-UUID-2",
+                       "links": [
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "linkToSelf",
+                                       "rel": "SELF"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/relationships",
+                                       "name": "relationsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "propertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/alerts?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "alertsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/symptoms?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "symptomsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/statkeys",
+                                       "name": "statKeysOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/stats/latest",
+                                       "name": "latestStatsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "latestPropertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/credentials/",
+                                       "name": "credentialsOfResource",
+                                       "rel": "RELATED"
+                               }
+                       ],
+                       "relatedResources": [
+                       ],
+                       "resourceHealth": "GREEN",
+                       "resourceHealthValue": 100.0,
+                       "resourceKey": {
+                               "adapterKindKey": "VMWARE",
+                               "name": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML",
+                               "resourceIdentifiers": [
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityInstanceUUID"
+                                               },
+                                               "value": "VMWARE-UUID-VM-2"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityName"
+                                               },
+                                               "value": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityObjectID"
+                                               },
+                                               "value": "VMWARE-OID-VM-2"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityVCID"
+                                               },
+                                               "value": "1ec8501f-dce7-4e0b-8f8b-19ba7060d33c"
+                                       }
+                               ],
+                               "resourceKindKey": "VirtualMachine"
+                       },
+                       "resourceStatusStates": [
+                               {
+                                       "adapterInstanceId": "fcf7ba35-72f0-4d36-a12d-45a0c4065e17",
+                                       "resourceState": "STARTED",
+                                       "resourceStatus": "DATA_RECEIVING",
+                                       "statusMessage": ""
+                               }
+                       ]
+               },
+               {
+                       "badges": [
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "RISK"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "CAPACITY_REMAINING"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "EFFICIENCY"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 0.0,
+                                       "type": "WORKLOAD"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 366.0,
+                                       "type": "TIME_REMAINING"
+                               },
+                               {
+                                       "color": "GREY",
+                                       "score": -1.0,
+                                       "type": "COMPLIANCE"
+                               },
+                               {
+                                       "color": "GREEN",
+                                       "score": 100.0,
+                                       "type": "HEALTH"
+                               }
+                       ],
+                       "creationTime": 1559557138756,
+                       "dtEnabled": true,
+                       "identifier": "VROPS-UUID-3",
+                       "links": [
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "linkToSelf",
+                                       "rel": "SELF"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/relationships",
+                                       "name": "relationsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "propertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/alerts?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "alertsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/symptoms?resourceId=01ffd926-f8eb-4153-bb59-4d3da4ce7982",
+                                       "name": "symptomsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/statkeys",
+                                       "name": "statKeysOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/stats/latest",
+                                       "name": "latestStatsOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/resources/01ffd926-f8eb-4153-bb59-4d3da4ce7982/properties",
+                                       "name": "latestPropertiesOfResource",
+                                       "rel": "RELATED"
+                               },
+                               {
+                                       "href": "/suite-api/api/credentials/",
+                                       "name": "credentialsOfResource",
+                                       "rel": "RELATED"
+                               }
+                       ],
+                       "relatedResources": [
+                       ],
+                       "resourceHealth": "GREEN",
+                       "resourceHealthValue": 100.0,
+                       "resourceKey": {
+                               "adapterKindKey": "VMWARE",
+                               "name": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML",
+                               "resourceIdentifiers": [
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityInstanceUUID"
+                                               },
+                                               "value": "VMWARE-UUID-VM-3"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": false,
+                                                       "name": "VMEntityName"
+                                               },
+                                               "value": "52a28e3c-4e5b-4408-b8e3-7755a4222774-vc-HNILML"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityObjectID"
+                                               },
+                                               "value": "VMWARE-OID-VM-3"
+                                       },
+                                       {
+                                               "identifierType": {
+                                                       "dataType": "STRING",
+                                                       "isPartOfUniqueness": true,
+                                                       "name": "VMEntityVCID"
+                                               },
+                                               "value": "1ec8501f-dce7-4e0b-8f8b-19ba7060d33c"
+                                       }
+                               ],
+                               "resourceKindKey": "VirtualMachine"
+                       },
+                       "resourceStatusStates": [
+                               {
+                                       "adapterInstanceId": "fcf7ba35-72f0-4d36-a12d-45a0c4065e17",
+                                       "resourceState": "STARTED",
+                                       "resourceStatus": "DATA_RECEIVING",
+                                       "statusMessage": ""
+                               }
+                       ]
+               }
+       ]
+}